[fpc-pascal] Re: Error: Identifier not found "ChooseFont"

2009-09-14 Thread yu ping
 WindowsXP,fpc224

2009/9/14 yu ping :
> When I try to use ChooseFont function in my programm,I get following error:
> test.pas(37,35) Error: Identifier not found "ChooseFont"
>
> Isn't the function in windows unit?
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] GetLastOSError return values?

2009-09-14 Thread Graeme Geldenhuys
Hi,

I'm using Linux. The online (html) help doesn't give any clue as to what
the return values are for GetLastOSError(). Where can I find this
information?

Running out of options in the FPC code, I looked at MSEgui code. I found
MSEgui uses the value 4 as an error and anything else as success. Still
this means nothing to me. Where does the magic value 4 come from? Where
are the error numbers documented?

Any clues?

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] GetLastOSError return values?

2009-09-14 Thread Jonas Maebe


On 14 Sep 2009, at 17:06, Graeme Geldenhuys wrote:

I'm using Linux. The online (html) help doesn't give any clue as to  
what

the return values are for GetLastOSError(). Where can I find this
information?


By definition, that error number is completely OS-specific. Under  
Linux, the error numbers are whatever the system calls or libc calls  
return. You can find the error numbers in e.g. /usr/include/asm- 
generic/errno.h on most recent Linux systems.



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


[fpc-pascal] Error: Identifier not found "ChooseFont"

2009-09-14 Thread yu ping
When I try to use ChooseFont function in my programm,I get following error:
test.pas(37,35) Error: Identifier not found "ChooseFont"

Isn't the function in windows unit?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Bus error on ARM-WinCE crosscompiler FPC 2.3.1

2009-09-14 Thread Bogdan
Hi

If I crosscompile the folowing program with
Lazarus-0.9.29-21694-fpc-2.3.1-20090914-win32.exe and
Lazarus-0.9.29-21694-fpc-2.3.1-20090914-cross-arm-wince-win32.exe:

program test4;

{$MODE Delphi}
{$APPTYPE CONSOLE}

uses
{$IFDEF WINDOWS} Windows, {$ENDIF}
  SysUtils, Classes, DateUtils;

{$IFDEF WINDOWS} {$R test4.rc} {$ENDIF}

function cvt1 (t: TdateTime): string;
var yy,mm,dd,hh,nn,ss,ms: Word;
begin
  DecodeDateTime (t,yy,mm,dd,hh,nn,ss,ms);
  result := Format('%d %d %d %d %d %d %d',[yy,mm,dd,hh,nn,ss,ms]);   // <<<<< 
Bus error or misaligned data access 
end;

function cvt2 (t: TdateTime): string;
var yy,mm,dd,hh,nn,ss,ms: Word;
begin
  DecodeDateTime (t,yy,mm,dd,hh,nn,ss,ms);
  try
result := Format('%d %d %d %d %d %d %d',[yy,mm,dd,hh,nn,ss,ms]);  // OK, no 
Bus Error 
  except
on E: Exception do writeln ('cvt2 ERROR ' + E.Message);
  end;
end;


begin
  try
writeln ('cvt1: Now = ' + cvt1(Now));
  except
on E: Exception do writeln ('cvt1 ERROR ' + E.Message);
  end;

  writeln ('cvt2: Now = ' + cvt2(Now));
end.

and download to ARM (Advantech UNO-1019, WinCE 5.0) the output from program is:

  cvt1 ERROR Bus error or misaligned data access
  cvt2: Now = 2009 9 14 12 55 31 0


Crosscompiling with 2.2.4   Lazarus-0.9.29-21694-fpc-2.2.4-20090914-win32.exe 
and
Lazarus-0.9.29-21694-fpc-2.2.4-20090914-cross-arm-wince-win32.exe is OK:

  cvt1: Now = 2009 9 14 13 20 11 0
  cvt2: Now = 2009 9 14 13 20 11 0


Is this Bus error a compiler bug or something else ?

Regards .

Bogdan

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

Re: [fpc-pascal] Re: Error: Identifier not found "ChooseFont"

2009-09-14 Thread Marco van de Voort
In our previous episode, yu ping said:
> 2009/9/14 yu ping :
> > When I try to use ChooseFont function in my programm,I get following error:
> > test.pas(37,35) Error: Identifier not found "ChooseFont"
> >
> > Isn't the function in windows unit?

Those functions moved to the commdlg unit because of Delphi compatibility.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Error: Identifier not found "ChooseFont"

2009-09-14 Thread yu ping
thanks,
another question,which unit is "PropertySheet" function in?

2009/9/15 Marco van de Voort :
> In our previous episode, yu ping said:
>> 2009/9/14 yu ping :
>> > When I try to use ChooseFont function in my programm,I get following error:
>> > test.pas(37,35) Error: Identifier not found "ChooseFont"
>> >
>> > Isn't the function in windows unit?
>
> Those functions moved to the commdlg unit because of Delphi compatibility.
> ___
> fpc-pascal maillist  -  fpc-pas...@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