Re: [fpc-pascal] How to allocate a 2D array?

2009-01-13 Thread Arjan van Dijk
Thanks all!This one works!Arjan>He wants 2D dynamic arrays, let's give him one:>type>  TMyArray = array of array of Float;>var>  MyArray: TMyArray;>begin>  SetLength(MyArray,Width,Height); // Valid index now:>[0..Width-1,0..Height-1]>  // Do something with MyArray>  // No deallocation needed, the c

[fpc-pascal] How to allocate a 2D array?

2009-01-12 Thread Arjan van Dijk
Hi! In my code I often use 2D arrays. Until today, I kept the maximum dimension fixed to 400 * 300 points. How can I make allocatable columns of ARBITRARY size? For simplicity here a 1D reduction of the problem: This is what I have: CONST MaxN = 400; TYPE ColumnType = ARRAY[1..MaxN] OF Floa

Re: [fpc-pascal] stdout refuses to be redirected

2008-10-09 Thread Arjan van Dijk
> You can stop using crt, then you don't need to change your write > instuctions. And how about my calls to READKEY and KEYPRESSED? Would unit WINCRT bring a solution? Or should I reconsider the use of these two statements anyhow? Regards, Arjan ___

Re: [fpc-pascal] stdout refuses to be redirected

2008-10-09 Thread Arjan van Dijk
> You can stop using crt, then you don't need to change your write > instuctions. Phew Thanks! Arjan ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] stdout refuses to be redirected

2008-10-09 Thread Arjan van Dijk
> 1. Don't use the crt unit, it grabs the handling of output (writeln(s) > is translated to writeln(output,s); > > 2. Use writeln(stdout, DirInfo.Name) to bypass crt's handling of output. This indeed seems to solve both problems. Does this really mean that I should replace all WRITELN( statements

[fpc-pascal] stdout refuses to be redirected

2008-10-09 Thread Arjan van Dijk
Hi! The following small piece of code, with filename 'test.pas': PROGRAM Test; USES CRT,DOS; VAR DirInfo: SEARCHREC; BEGIN FINDFIRST('*.pas',ARCHIVE,DirInfo); WRITELN(DirInfo.Name); END. just gives the name of the first file with extension ".pas". It compiles and runs fine when I call is a

Re: [fpc-pascal] BLOCKWRITE-restrictions in writing .bmp-file?

2008-09-17 Thread Arjan van Dijk
> > IF (((NDum) MOD 4)<>0) THEN > > BLOCKWRITE(OutFile,Pixel,SIZEOF(Pixel)); > > IF (((NDum + 1) MOD 4)<>0) THEN > > BLOCKWRITE(OutFile,Pixel,SIZEOF(Pixel)); > > IF (((NDum + 2) MOD 4)<>0) THEN > > BLOCKWRITE(OutFile,Pixel,SIZEOF(Pixel)); > > 1. If NDum = 4k (e.g. 12=4*3), you

[fpc-pascal] BLOCKWRITE-restrictions in writing .bmp-file?

2008-09-17 Thread Arjan van Dijk
Hi! About 1 year ago, I had this excellently working UNIT of bitmap-picture handling routines. Today I wanted to use them again, but the result is crappy. I was wondering if this can have something to do with BLOCKWRITE-restrictions in the new version of FPC. I have 2 routines for writing gridded

Re: [fpc-pascal] IDE blows up itself

2007-07-13 Thread Arjan van Dijk
> Please create bug reports (both of you please), otherwise this will be > forgotten. Okay, I will. I wrote a piece of code to generate a sample input datafile for my program. When I ran my program on that datafile, there was no error! The original datafile comes from g77/Cygwin and both the real

[fpc-pascal] IDE blows up itself

2007-07-12 Thread Arjan van Dijk
Hi! I had problems debugging my program under the last official IDE/Freepascal for Windows, so I just installed the release candidate that is bound to become official in 2 months. My problem still stands: during my debug session the whole IDE simply disappears! I narrowed down the problem to just

[fpc-pascal] Profane question: can I use the IDE for another compiler/debugger?

2007-07-12 Thread Arjan van Dijk
Hi, About 50 percent of my programming is done in Freepascal where I really really (!!) have developed a profound (!!!) appreciation for the IDE, which just brings me back to the old Borland times. But: In the other 50 percent of time I have to (no escape) work with FORTRAN. At first I wrote a b

[fpc-pascal] Finding the cursor in the IDE

2006-09-19 Thread Arjan van Dijk
Hi, I often have problems finding the cursor in the IDE. In insert-mode it is just a slowly blinking underscore in the same colour as the rest. Can I modify the appearance of the cursor? Thanks, Arjan DISCLAIMER: htt