RE: [fpc-pascal] nested procedure as parameter question

2010-04-15 Thread Bruce Bauman
ed procedure as parameter question On Thu, Apr 15, 2010 at 2:51 PM, Bruce Bauman wrote: > I am porting a large amount of existing Pascal code (MetaWare) to Free > Pascal. Unfortunately, this code makes extensive use of nested > procedures, and the nested procedures often reference variables

[fpc-pascal] nested procedure as parameter question

2010-04-15 Thread Bruce Bauman
I am porting a large amount of existing Pascal code (MetaWare) to Free Pascal. Unfortunately, this code makes extensive use of nested procedures, and the nested procedures often reference variables in the enclosing scope. I know that I can't pass the nested routine by address to another procedure;

[fpc-pascal] installing on RHEL5 (libtinfo)

2010-03-04 Thread Bruce Bauman
I'm running CentOS 5.3 (x86_64), and want to install FPC 2.4 on my machine, preferably from an RPM, but I can't because of a failed dependency on libtinfo. I've found many references to this problem in the mailing lists, but am unsure of what the easiest solution is. 1) Can I install the FPC RPM w

[fpc-pascal] command line option to specify record alignment

2010-02-15 Thread Bruce Bauman
I've read through the documentation several times and cannot figure this out. The documentation is pretty unclear on this. I want a command line equivalent to {$PACKRECORDS 1}. Is there a way to do this via the command line? Thanks. -- Bruce CONFIDENTIALITY NOTICE: This e-mail is confi

RE: [fpc-pascal] can the output object filename be specified on the command line?

2009-12-03 Thread Bruce Bauman
Will it cause problems if the unit name (e.g. unit foo__bar;) doesn't match the source filename? I want to source filename to remain unchanged (e.g. bar.pas), but the unit name (and .ppu and .o filenames) to be different (e.g. foo__bar.o, foo__bar.ppu, unit foo__bar). Thus, the .ppu files are

[fpc-pascal] can the output object filename be specified on the command line?

2009-12-03 Thread Bruce Bauman
If I am compiling a file bar.pas, but I want the resulting .o filename to be something different, is there a way to do this? For example, I want the object filename to be foo__bar.o, but the source file is just bar.pas. Right now we can get this to work by creating a symlink from foo__bar.p

[fpc-pascal] Validate heap/stack addresses

2009-12-01 Thread Bruce Bauman
I'm trying to port/debug some ugly Pascal code. Is there a way I can tell if an arbitrary address is within the heap or stack? I want to do something like: Assert(ValidHeapAddress(a)) Assert(ValidStackAddress(a)) to catch potential errors in the code. I'm guessing any address b

RE: [fpc-pascal] convert st_mtime from BaseUnix.FpStat to year, month, day, hour, minute, sec

2009-11-23 Thread Bruce Bauman
To: FPC-Pascal users discussions Subject: Re: [fpc-pascal] convert st_mtime from BaseUnix.FpStat to year, month,day, hour, minute, sec On 23 Nov 2009, at 00:42, Bruce Bauman wrote: > If you look at the HTML documentation: > > http://www.freepascal.org/docs-html/rtl/

[fpc-pascal] convert st_mtime from BaseUnix.FpStat to year, month, day, hour, minute, sec

2009-11-20 Thread Bruce Bauman
I need to convert the st_time field of the record returned by BaseUnix.FpStat to the year, month, day, hour, minute and second and need to compensate for the local timezone. I've read over the RTL documentation and am thoroughly confused. Some of the documentation of the interfaces say that th

[fpc-pascal] FPC equivalent to "system" under Linux

2009-11-20 Thread Bruce Bauman
I'm porting some code which called "system". Is there an equivalent under FPC, or do I need to use FpFork/FpExecV? -- Bruce CONFIDENTIALITY NOTICE: This e-mail is confidential and intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recip

[fpc-pascal] sysutils.beep doesn't beep under Linux?

2009-11-18 Thread Bruce Bauman
I'm porting some code which "beeps" the console. When I use sysutils.beep() it doesn't work under Linux. What's the easiest way to accomplish this? Thanks. -- Bruce CONFIDENTIALITY NOTICE: This e-mail is confidential and intended solely for the use of the individual or entity to which it is

[fpc-pascal] question about FpTimes in BaseUnix package

2009-11-17 Thread Bruce Bauman
I am using the FpTimes function from the BaseUnix package. The documentation says it returns -1 on an error, otherwise the number of clock ticks since boot time. However, the return type of this function is TClock, which is unsigned. This, if I say: X := BaseUnix.FpTimes(T); if (X <> -1) then ..

[fpc-pascal] conformant arrays and Free Pascal

2009-11-05 Thread Bruce Bauman
I am trying to convert a huge amount of code written in MetaWare Professional Pascal to Free Pascal. Unfortunately, the MetaWare code makes fairly extensive use of Pascal conformant arrays. Free Pascal's open arrays are similar, but modifying all of the uses of conformant arrays would be a fairly

[fpc-pascal] writing to syslog from FreePascal

2009-10-28 Thread Bruce Bauman
We are porting an application which needs to write to the system log via syslog. We are running under Red Hat Enterprise Linux. Is there an existing mechanism to do this, or do we need to interface to C code ourselves? Thanks. -- Bruce CONFIDENTIALITY NOTICE: This e-mail is confidential an

RE: [fpc-pascal] open arrays as parameters (why packed not allowed)?

2009-10-16 Thread Bruce Bauman
Great, although ignoring the "packed" would be very useful as we are mechanically translating a large body of code. -- Bruce From: fpc-pascal-boun...@lists.freepascal.org on behalf of Jonas Maebe Sent: Fri 10/16/2009 4:50 AM To: FPC-Pascal users discussions

RE: [fpc-pascal] open arrays as parameters (why packed not allowed)?

2009-10-15 Thread Bruce Bauman
packed not allowed)? On 15 Oct 2009, at 14:49, Bruce Bauman wrote: [packed for open array parameters] > Is there a reason why "packed" is not allowed in this context? I think it's simply because I forgot to add it when adding support for packed arrays. Please file a b

[fpc-pascal] open arrays as parameters (why packed not allowed)?

2009-10-15 Thread Bruce Bauman
I am translating some Pascal code from MetaWare Professional Pascal to Free Pascal. The MetaWare code uses conformant arrays, which are not supported within Free Pascal. We are thus translating these to use Free Pascal open arrays. However, Free Pascal does not allow the "packed" qualifier on the