Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Multi-line statements

The OI precompiler allows the vertical bar character '|' to be used for splitting a single Basic+ statement over multiple lines (see RTP5 compiler doesn't like multi lines). The SRP precompiler appears to be using this character for something else, though.
Is there another way for the SRP precompiler to support multiline statements?

Cheers, M@

Comments

  • It does use it to support the ability for a single line of Enhanced BASIC+ to behave like a single line of code when debugging. Otherwise, you'd have have to "step over" some lines of code three or four times. The semicolon is used for most things, but I had to use the Pipe to support hidden gosubs. For example, this:

    Service Whatever(Data, Test)

    Becomes this:

    Whatever: | Data = If Assigned(Param1) then Param1 else "";Test = If Assigned(Param2) then Param2 else ""

    Without that pipe, the colon is treated as concatenation. Semi-colon doesn't work either. So, the answer is, no, I can't not use it unless we give up Events, Services, and the upcoming Tests features of the language.

    I am curious why my use of pipes would be interfering.
  • M@ - Add this line to your code and compile:
    #pragma output SYSLISTS MY_PRECOMPILER_OUTPUT
    Then open this record up and let us know what seems to be the problem.
  • Ah, my bad! It turns out my syntax wasn't quite the right and neither precompiler was happy with it.

    I was doing this
    If (shape.right >= selection.left) AND | (shape.top <= selection.bottom) AND | (shape.left <= selection.right) AND | (shape.bottom >= selection.top) then Gosub Overlap End
    but should be doing this
    If (shape.right >= selection.left) | AND (shape.top <= selection.bottom) | AND (shape.left <= selection.right) | AND (shape.bottom >= selection.top) then Gosub Overlap End
    Cheers, M@
Sign In or Register to comment.