Re: [fpc-pascal] Ido not understand UTF8 in Windows console.

2010-02-17 Thread JoshyFun
Hello FPC-Pascal,

Wednesday, February 17, 2010, 10:46:18 PM, you wrote:

LFDAM> {código de página UTF8}
LFDAM> //sin firma Unicode BOM
LFDAM> Begin
LFDAM>  Writeln('code page UTF8 - 65001 en Windows');
LFDAM>  Writeln('camión')
LFDAM> End.
LFDAM> Using the command chcp, change the code page to 65001, the UTF-8 for
LFDAM> Windows. I compiled the program, and then run and get the following 
errror:
LFDAM> Runtime error 101 at $00401460
LFDAM>$00401460
LFDAM>$004069B1

If you are doing this in Lazarus by default you are creating a GUI
application, so any writeln will raise an error as stdout is closed.

LFDAM> The same program when compiled and run on linux, no error. works well.
LFDAM> What am I doing wrong?

Linux always have a stdout open.

LFDAM> Original Message Spanish:
LFDAM> No entiendo UTF8 en consola Windows
LFDAM> Yo escribí el siguiente programa, usando un editor UTF8, sin marca de 
BOM.
LFDAM> Usando el comando chcp, cambio el código de página a 65001, el UTF8 para
LFDAM> Windows. Compilo el programa, y después lo ejecuto y aparece el siguiente
LFDAM> error :
LFDAM> El mismo programa, cuando lo compilo y lo ejecuto en linux, no aparece
LFDAM> ningún error. funciona bien.
LFDAM> ¿Qué estoy haciendo mal?

Lo mismo pero en español :) Vamos que elimines el flag de "Win32 GUI
application" en Compiler -> Linker.

Por cierto CP_UTF8 sólo funciona en >=NT 4.0 con fuentes TrueType en
ventana y muchos bats y similares dejan de funcionar.

-- 
Best regards,
 JoshyFun

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Ido not understand UTF8 in Windows console.

2010-02-17 Thread Luis Fernando Del Aguila Mejía
Translate Message : English
Ido not understand UTF8 in Windows console.
I wrote the following program, using an editor UTF8 without BOM mark.

{código de página UTF8}
//sin firma Unicode BOM
Begin
 Writeln('code page UTF8 - 65001 en Windows');
 Writeln('camión')
End.

Using the command chcp, change the code page to 65001, the UTF-8 for 
Windows. I compiled the program, and then run and get the following errror:
Runtime error 101 at $00401460
   $00401460
   $004069B1

The same program when compiled and run on linux, no error. works well.
What am I doing wrong?

Original Message Spanish:
No entiendo UTF8 en consola Windows
Yo escribí el siguiente programa, usando un editor UTF8, sin marca de BOM.
Usando el comando chcp, cambio el código de página a 65001, el UTF8 para 
Windows. Compilo el programa, y después lo ejecuto y aparece el siguiente 
error :
El mismo programa, cuando lo compilo y lo ejecuto en linux, no aparece 
ningún error. funciona bien.
¿Qué estoy haciendo mal?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Printing of FPC program listing

2010-02-17 Thread James Gibbens

Thank you - will try
My computer runs on Windows XP.

- Original Message - 
From: "Marco van de Voort" 

To: "FPC-Pascal users discussions" 
Sent: Wednesday, February 17, 2010 11:32 AM
Subject: Re: [fpc-pascal] Printing of FPC program listing



In our previous episode, James Gibbens said:



Thank you for the answers and advice I have received. Three new issues if
you good people don't mind.


Operating system?


1. I want to print my program listing by using the print option in the
File drop-down menu (Free Pascal IDE window).  I click on the Print 
option

but nothing happens - the printer is on and it does print.  How can I fix
that?


2. The window of the Free Pascal IDE is only 21 lines high. Is it 
possible to show more lines on the computer screen? How can I do that?


Enlarge the window before starting. OS? If *nix, try to use a XTerm 
console,

and see if that improves.


3. Is it possible to get FPC to use a comma (,) in stead of a period (.)
as the separator between integer and fraction?  The way they do it in
Europe?


There are some possibilities. In general TP functions don't, and Delphi
functions do honour the locale. Delphi (sysutils) routines often have a
TFormatSettings parameters where you can pass custom locale settings.

Or try setting "decimalseparator" to ','

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is fppkg dead?

2010-02-17 Thread Graeme Geldenhuys
Michael Van Canneyt wrote:
> 
> It is not dead, but it takes time to set it up.


Good to know. In 2009-01 you mentioned in a message that it needs more
testing. So what can I do to help the testing process?  I already have a
90% working fpmake.pp for fpGUI, which I believe is required for 'fppkg
archive' support or something.

You also mentioned hosting your own repository. How do I do this and how do
I tell fppkg where to look for this new repository.

Looking at this file, the syntax is pretty simple, but how do I tell fppkg
to look at my packages.xml file on my server?

  http://www.freepascal.org/repository/packages.xml


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] C thread callbacks

2010-02-17 Thread Jonas Maebe


On 17 Feb 2010, at 09:41, Wimpie Nortje wrote:

I have a C library that uses threads. These threads use callbacks  
into my pascal for events. What must happen for the pascal events  
handlers to be able to safely access the main thread's resources?


The same as what must happen for C event handlers to access those  
resources.


This is the same situation where I would use TThread.Synchronize if  
the threads were TThread objects.


Then you must implement such a mechanism in the C program as well, or  
some other way to synchronise with its main thread.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is fppkg dead?

2010-02-17 Thread Jonas Maebe


On 17 Feb 2010, at 09:21, Graeme Geldenhuys wrote:


Is fppkg a dead initiative?


It is only sleeping.


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Printing of FPC program listing

2010-02-17 Thread Marco van de Voort
In our previous episode, James Gibbens said:


> Thank you for the answers and advice I have received. Three new issues if
> you good people don't mind.

Operating system?

> 1. I want to print my program listing by using the print option in the
> File drop-down menu (Free Pascal IDE window).  I click on the Print option
> but nothing happens - the printer is on and it does print.  How can I fix
> that?

> 2. The window of the Free Pascal IDE is only 21 lines high. Is it possible to 
> show more lines on the computer screen? How can I do that?

Enlarge the window before starting. OS? If *nix, try to use a XTerm console,
and see if that improves.

> 3. Is it possible to get FPC to use a comma (,) in stead of a period (.)
> as the separator between integer and fraction?  The way they do it in
> Europe?

There are some possibilities. In general TP functions don't, and Delphi
functions do honour the locale. Delphi (sysutils) routines often have a 
TFormatSettings parameters where you can pass custom locale settings.

Or try setting "decimalseparator" to ','

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] C thread callbacks

2010-02-17 Thread Wimpie Nortje

Hi

I have a C library that uses threads. These threads use callbacks into 
my pascal for events. What must happen for the pascal events handlers to 
be able to safely access the main thread's resources?


This is the same situation where I would use TThread.Synchronize if the 
threads were TThread objects.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is fppkg dead?

2010-02-17 Thread Michael Van Canneyt



On Wed, 17 Feb 2010, Graeme Geldenhuys wrote:


Is fppkg a dead initiative?  Or is this ever going to go "live" for other
developers or even FPC to push packages to the repository too? If so, what
is the requirements to get access, or should we all host our own repositories?

---
$ fppkg list
Name InstalledAvailable
lnet -0.6.3-0
---


fppkg was announced over a year ago. It was said that as soon as sufficient
testing was done, other packages would become available. I guess this
confirms that fppkg is a 'dead in the water' initiative - not even FPC is
using it. :-(  It sounded like such a nice idea though.


It is not dead, but it takes time to set it up.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Is fppkg dead?

2010-02-17 Thread Graeme Geldenhuys
Is fppkg a dead initiative?  Or is this ever going to go "live" for other
developers or even FPC to push packages to the repository too? If so, what
is the requirements to get access, or should we all host our own repositories?

---
$ fppkg list
Name InstalledAvailable
lnet -0.6.3-0
---


fppkg was announced over a year ago. It was said that as soon as sufficient
testing was done, other packages would become available. I guess this
confirms that fppkg is a 'dead in the water' initiative - not even FPC is
using it. :-(  It sounded like such a nice idea though.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Exec(), Linux, and /dev/null redirection

2010-02-17 Thread Marco van de Voort
In our previous episode, cobines said:
> 2010/2/17 Zitt Zitterkopf :
> > Exec( '/bin/mount', '/dev/'+ aline +' /media/' + aline + ' &> /dev/null');
> 
> Try:
> 
> Exec( '/bin/mount', '/dev/'+ aline +' /media/' + aline + ' 1>/dev/null');
> 
> for redirecting STDOUT or
> 
> Exec( '/bin/mount', '/dev/'+ aline +' /media/' + aline + ' 2>/dev/null
> 1>/dev/null');
> 
> for redirecting STDOUT and STDERR.

Try
fpsystem

it executes a shell, and &> 1> 2> are shell commands, and won't work with
direct execution commands like exec (which is old anyway, use
executeprocess)

> This puts stdout and stderr into one pipe however. There must be some
> way to read from stdout and stderr separately, maybe using TProcess,
> but I've never needed it so I don't know how.

TProcess is definitely the thing to look at.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal