Niels AD
Niels AD
It's difficult to say without knowing your adjustments, but by default the System unit refers to the global namespace of the current script; so what you are doing here does...
Yes, this a bug. Not sure what would be the best way to fix this. For completeness sake; PascalScript also has this issue :stuck_out_tongue_winking_eye: Thanks for reporting!
FPC does it like this: ``` 1: if (counter > limit) then goto 6 2: dec counter 3: inc counter 4: [LOOP BODY] 5: if (counter < limit) then goto...
The `downto` example is something different. As @riwu said, this is because you are assigning a negative number to an unsigned variable. [Range checking](http://www.freepascal.org/docs-html/3.0.0/prog/progsu65.html#x72-710001.2.65) before assigning integer types could catch...
See tests for (1) [autoproperties](https://github.com/nielsAD/lape/blob/master/tests/Directive_AutoProperties.lap), (2) [constaddress](https://github.com/nielsAD/lape/blob/master/tests/Operators_ConstPointer.lap) (allows pointers to constants), (3) [compound operators](https://github.com/nielsAD/lape/blob/master/tests/Operators_Compound.lap). As for the index operation; probably the result type is lost somewhere.
The code you pasted above works for me (RangeChecking is turned on by default). Maybe check if you made any modifications to handling `lcoRangeCheck`.
The best way to work around this is by just using a 32 bit integer type and wrapping the C fields into getters/setters. Adding this to Lape is possible but...
You might have to work with `constref` or `static` keywords as in [`tests/Method_OfType.lap`](https://github.com/nielsAD/lape/blob/master/tests/Method_OfType.lap).
I'm not sure what we discussed last time regarding fields. You might be able to find it in a mail? `$IF` conditionals shouldn't be that difficult to add, as you...
Yes, that should be turned into a union. ```pascal type TDateTimeRec = union Date: LongInt; Time: LongInt; DateTime: Double; end; var dt: TDateTimeRec; begin dt.Date := 1; WriteLn(dt); end; ```