Re: [fpc-pascal] case statement

2023-12-16 Thread Gerhard Scholz via fpc-pascal
statement list = statement { ";" statement } statementlist itself is not explained; I assume "statementlist" to be the same as "statement list" It is included in the definition of the try...except statement. ELSE/OTHERWISE I assume that came historically; the first implementation of a PASC

Re: [fpc-pascal] Range check error warning.

2020-03-24 Thread Gerhard Scholz
z := x AND y is a bitwise AND (not (foldhiddenmask or currentfoldhiddenmask)) results in dec: -193hex: ff3f bin: 0011 this AND hex: $ff (bin: 1 ) gives bin: 0011 AND bin:

Re: [fpc-pascal] Range check error warning.

2020-03-24 Thread Gerhard Scholz
what about foldlevelmask = (not (foldhiddenmask or currentfoldhiddenmask)) and $ff ; instead of the " f... := byte(...) " line ? - Original Message - From: "fredvs via fpc-pascal" To: Cc: "fredvs" Sent: Tuesday, March 24, 2020 1:08 AM Subject: [fpc-pascal] Range check error warn

Re: [fpc-pascal] Variant part in objects?

2019-11-25 Thread Gerhard Scholz
Do it like this: type obj = object vars : record case boolean of end ; end ; - Original Message - From: "Ryan Joseph via fpc-pascal" To: "FPC-Pascal user

Re: [fpc-pascal] LongBool True = -1

2018-05-19 Thread Gerhard Scholz
Afaik, the bool types (longbool, wordbool, bytebool) come from the C language and are mostly used to interface with C libraries (for example: windows). The definitions there are: 0 means FALSE, anything else means TRUE. Normally C routines return a dword/word/byte filled with ones for TRUE and

Re: [fpc-pascal] Variant record consistency

2016-08-07 Thread Gerhard Scholz
I assume, my response was a bit unclear. If you code it like this, you should get a runtime-error or compiler-error if the two variants are not same-sized, and I assume, this is what you wanted. - Original Message - From: "Gerhard Scholz" To: "FPC-Pascal users dis

Re: [fpc-pascal] Variant record consistency

2016-08-07 Thread Gerhard Scholz
if same size is necessary, I would do it like this: const topDataQword= 29; topNameChar= 231; type Tfnord1 = array[0..topDataQword] of qword ; Tfnord2 = record name: array[0..topNameChar] of char; inode: qword end ; Tfnord= rec

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-25 Thread Gerhard Scholz
I downloaded ftp://freepascal.stack.nl/pub/fpc/beta/2.6.4-rc1/i386-win32/fpc-2.6.4rc1.i386-win32.exe The setup the said: "The setup files are corrupted. Please obtain a new copy of the program." I did that; the second copy also didn't work. Greetings Gerhard - Original Message - Fr

Re: [fpc-pascal] Re: ++ and -- ( and +=, -=, ...)

2013-08-01 Thread Gerhard Scholz
Semantically, it's not the same, but a += b can be replaced by inc ( a, b ) ; It's readable, it looks like normal standard Pascal; and it's clear that the address of a is calculated only once. If a,b are not ordinals, inc could be overloaded. Greetings Gerhard - Original Message

Re: [fpc-pascal] ++ and -- ( and +=, -=, ...)

2013-07-31 Thread Gerhard Scholz
.) On 30 Jul 2013, at 22:17, Gerhard Scholz wrote: Beside of the question, if ++,--,+=,etc. fit into Pascal or not, there stays the question: is it a plus? I expected that a[i] += 3 compiles better than a[i] := a[i] + 3 I expected that the computation of a[i] is done only once, but the produced co

Re: [fpc-pascal] ++ and -- ( and +=, -=, ...)

2013-07-30 Thread Gerhard Scholz
(If +=, -= etc. would have been copied from Algol68 and not from C, it would have been written +:= -:=, which looks more pascal-like. And the acceptance for these constructs would be wider, I assume. Just an optical note to that theme). Beside of the question, if ++,--,+=,etc. fit into Pascal

Re: [fpc-pascal] Weird absence of compilation error

2013-03-21 Thread Gerhard Scholz
This must be read as follows: function Tmp: Double; begin Result := 10; // there is a semicolon (mispelling?) [statement 1] + Element;[statement 2] end; So, Result becomes 10. The next line is a function call without storing the result. The lea

Re: [fpc-pascal] Set size limit

2013-03-11 Thread Gerhard Scholz
Sorry, there are some changes neccessary: drop the reference to unit uAsms delete the line FillOnes ( ... it was there for debugging purposes - Original Message - From: "Gerhard Scholz" To: "FPC-Pascal users discussions" Cc: Sent: Mo

Re: [fpc-pascal] Set size limit

2013-03-11 Thread Gerhard Scholz
Here is a unit that could be useful. Works with pentium and Win32; not tested with other CPUs or operating system. I hope you have 7zip, or I will create a zip file. Greetings Gerhard - Original Message - From: "Daniel Gaspary" To: "FPC-Pascal users discussions" Sent: Saturday,

Re: [fpc-pascal] Compiled program is a virus (seems to be internallinker problem)

2013-02-11 Thread Gerhard Scholz
- Original Message - From: "Gerhard Scholz" To: "FPC-Pascal users discussions" Sent: Monday, February 11, 2013 11:07 PM Subject: Re: [fpc-pascal] Compiled program is a virus (seems to be internallinker problem) @Martin: Compile line: ppc386 -vv -al -CioOrt -Cs

Re: [fpc-pascal] Compiled program is a virus (seems to be internallinker problem)

2013-02-11 Thread Gerhard Scholz
ect: Re: [fpc-pascal] Compiled program is a virus (seems to be internallinker problem) On 11/02/2013 20:22, Gerhard Scholz wrote: Platform: Win32, FPC2.7.1, Virusscanner Avira Free Antivirus The compiled program is assumed to be a virus. Name:TR/Crypt.XPACK.Gen2 (according to Avira, shall b

[fpc-pascal] Compiled program is a virus (seems to be internal linker problem)

2013-02-11 Thread Gerhard Scholz
Platform: Win32, FPC2.7.1, Virusscanner Avira Free Antivirus The compiled program is assumed to be a virus. Name:TR/Crypt.XPACK.Gen2 (according to Avira, shall be a trojan) Compile line: ppc386 -vv -al -CioOrt -Cs600-gclt -Mobjfpc -O1 -OpPENTIUM With the external linker ( -Xe ) t

[fpc-pascal] Re: [fpc-announce] Feature announcement: Type helpers

2013-02-07 Thread Gerhard Scholz
Hello, I tried to compile the example: type TLongIntHelper = type helper for LongInt class procedure Test; static; end; class procedure TLongIntHelper.Test; begin Writeln('Test'); end; var i: LongInt; begin i.Test; $12345678.Test; LongInt.Test; end. Result: 0:25:46,51 G:\o

Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-25 Thread Gerhard Scholz
have it, of course I can also mail the files. Gerhard - Original Message - From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Thursday, January 24, 2013 9:32 AM Subject: Re: [fpc-pascal] Linker Error: what does this mean? On Wed, January 23, 2013 2

Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-23 Thread Gerhard Scholz
the help. Greetings Gerhard - Original Message - From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Wednesday, January 23, 2013 1:00 AM Subject: Re: [fpc-pascal] Linker Error: what does this mean? On 23 Jan 13, at 0:01, Gerhard Scholz wrote: The

Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-22 Thread Gerhard Scholz
8.380.376 bytes, the .OBJ made by vp has 7.002.097 bytes. - Original Message - From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Tuesday, January 22, 2013 10:13 PM Subject: Re: [fpc-pascal] Linker Error: what does this mean? On 22 Jan 13, at 21:31,

[fpc-pascal] Linker Error: what does this mean?

2013-01-22 Thread Gerhard Scholz
Question: what's the reason for this error? Linking .\read.exe Error: Failed reading coff file, illegal reloctype $ while reading .\U_UNIDAT The program compiles wonderfully with VirtualPascal; I wanted to recompile it with FPC. Gerhard ___

Re: [fpc-pascal] printing each Friday the 13 using Pascal

2012-08-06 Thread Gerhard Scholz
a quick and dirty solution - Original Message - From: ik To: FPC-Pascal users discussions Sent: Monday, August 06, 2012 1:19 PM Subject: [fpc-pascal] printing each Friday the 13 using Pascal Hi list, A friend of mine started a hobby project: Printing every Friday the 13, in a range of

Re: [fpc-pascal] Creating video files

2012-06-21 Thread Gerhard Scholz
zysztof wrote: Hmm, external application is nice idea. But VirtualDub is windows only. Anyone know multi-platform comandline video converter? What I found is Mencoder. I must test it 2012/6/20 Gerhard Scholz : In my opinion, the easiest way is to create a series of BMP's and then use VirtualDu

Re: [fpc-pascal] Creating video files

2012-06-20 Thread Gerhard Scholz
In my opinion, the easiest way is to create a series of BMP's and then use VirtualDub or VirtualDubMod (I think it's at Sourceforge). Greetings - Original Message - From: "Krzysztof" To: "fpc-pascal" Sent: Tuesday, June 19, 2012 3:53 PM Subject: [fpc-pascal] Creating video files > Hi

Re: [fpc-pascal] 2.4.0: Some lines are not compiled (just thrown away)

2010-02-13 Thread Gerhard Scholz
y 12, 2010 7:13 PM Subject: Re: [fpc-pascal] 2.4.0: Some lines are not compiled (just thrown away) On 24 Jan 2010, at 21:10, Gerhard Scholz wrote: Some lines are ignored. An IF-clause is ignored. Versin 2.2.4 runs o.k. Fixed. Please report bugs at http://bugs.freepascal.org in the futu

[fpc-pascal] 2.4.0: Some lines are not compiled (just thrown away)

2010-01-24 Thread Gerhard Scholz
Some lines are ignored. An IF-clause is ignored. Versin 2.2.4 runs o.k. The program: program rangtest ; type trange = 0..2030 ; ytrange = 1990..2030 ; CONST lrange = low ( trange ) ; hrange = high ( trange ) ; ylrange = low ( ytrange ) ; yhrange = high ( ytrange )

Re: [fpc-pascal] Origin of FPC features

2009-02-10 Thread Gerhard Scholz
Bitpacked Structures: The first time I've seen bitpacked structures (arrays & records) was on the pascal compiler for Control Data machines, about 1980. If I remember right, it was the original ETH Zürich compiler, made by someone of the Wirth staff. ( the keyword BITPACKED was not used, it wa

Re: [fpc-pascal] fast integer multiplication and one asm questio

2005-08-02 Thread Gerhard Scholz
> [EMAIL PROTECTED] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fpc-pascal digest..." > > > Today's Topics: > >1. Re: lazarus crash at start (Jesus Reyes) >2. Re: fast integer multipli

Re: [fpc-pascal] fast integer multiplication

2005-08-01 Thread Gerhard Scholz
... >>The code generated for the above sample is: >># [16] c:=a*b; >>movlU_P$PROJECT1_A,%edx >>movlU_P$PROJECT1_B,%eax >>mull%edx >>movl$0,%edx >>movl%eax,U_P$PROJECT1_C >>movl%edx,U_P$PROJECT1_C+4 >> >>What I want is the above code, but without the "

Re: [fpc-pascal] profiler

2005-07-02 Thread Gerhard Scholz
I have problems when compiling with -pg (profiler) Is this my fault or a compiler error? P:\FmtBCD>ppc386 -a -pg -Croit -Op1 testprof Free Pascal Compiler version 2.1.1 [2005/06/25] for i386 Copyright (c) 1993-2005 by Florian Klaempfl Target OS: Win32 for i386 Compilin

Re: [fpc-pascal] showing source linenumbers on exceptions

2005-06-27 Thread Gerhard Scholz
Hi, compilation with the parameter -gl should do your job: ppc386 -gl myprogram (if your compiler name is ppc386, else insert your name instead Gerhard -Ursprüngliche Nachricht- Von: "Bartek" <[EMAIL PROTECTED]> An: Gesendet: Montag, 27. Juni 2005 22:51 Betreff: [fpc-pascal] showi

Re: [fpc-pascal] Optimize code for speed

2005-06-13 Thread Gerhard Scholz
al Message ----- From: "Gerhard Scholz" <[EMAIL PROTECTED]> To: "FPC-Pascal users discussions" Sent: Friday, June 10, 2005 12:46 PM Subject: Re: [fpc-pascal] Optimize code for speed > - Original Message - > From: "L505" <[EMAIL PROTECTED]> >

Re: [fpc-pascal] Optimize code for speed

2005-06-10 Thread Gerhard Scholz
- Original Message - From: "L505" <[EMAIL PROTECTED]> To: "FPC-Pascal users discussions" Sent: Friday, June 10, 2005 10:18 AM Subject: [fpc-pascal] Optimize code for speed ... > 1. begin >M yString=Do.Something >StrList3.add(MyString); > end > > 2. beg

Re: [fpc-pascal] Past list archives

2005-06-01 Thread Gerhard Scholz
Sorry, that list mentioned below: http://www.freepascal.org/mailist.html is dead. (Objekt nicht gefunden! Der angeforderte URL konnte auf dem Server nicht gefunden werden.) Greetings Gerhard - Original Message - From: "Jonas Maebe" <[EMAIL PROTECTED]> To: "Mike's Mail" <[EMAIL PR

[fpc-pascal] Re: ReadLn issues a warning

2005-05-20 Thread Gerhard Scholz
Hello, this is a general feature when using an uninitialized variable as a VAR parameter. The compiler cannot know if the called routine needs the parameter values, or if the parameter is only used to return values back to the caller. So, I think, a warning here could be helpful (in the case of