Jesper Lund wrote:
BUGS
If you find bugs, please try to fix them - but please report them to me as well. If you fix them, please let me have a copy of the fix.
I haven't found any bugs, but I have a suggestion which -- IMHO -- would improve ValReal (the same applies to ValInteger, etc).
First, my modified ValReal; second, an explanation of the modification.
type str255 = string [255];
[...]
Ok - thanks. I note Frank's comments - and so I will leave "Val" alone. Frank - will your "Val" procedure deal with reals as well?
- The formal parameter S is declared as a string[255], instead of the schema
type 'string' (which has a different meaning than in Borland Pascal, where it means string[255]).
In GPCTYPES.PAS (soon to be merged with SYSTEM.PAS), "string" is redefined as "bpstring", if "_Borland_Pascal_" is defined.
- Unless GPC is really good at optimizing string expressions, the "hack"
s[Length(s)+1] := chr ( 0 )
is faster than adding chr(0) to the string variable. Of course, it cannot be range-checked ...
Yes, it is. This is how it is implemented in "AddNull", which was in the strings unit before, but I have now moved it into the system unit, since the system unit also uses that functionality.
Any thoughts on whether the system unit should now export this AddNull function so that it can be available globally? This would introduce something which is not in the BP system unit.
Best regards, The Chief -------- Dr. Abimbola A. Olowofoyeku (The African Chief) Email: laa12@keele.ac.uk Author of: Chief's Installer Pro 4.01 for Win16 and Win32: Winner of PC PLUS Magazine Gold Award (April 1995 U.K. edition) http://ourworld.compuserve.com/homepages/African_Chief/
ftp://ftp.demon.co.uk/pub/ibmpc/win3/apps/chief/pro/chief401.zip