On Fri, 3 Dec 2010 11:23:48 +0100 Fred van der Windt <[email protected]> wrote:
:>The syntax for AND and OR operators in the Strcutured Programming Macros is differs slightly between the UNTIL= and WHILE= options of the DO macro and every other SPM macro that supports conditions. This is not only very confusing but I was just bitten by the fact that the DO macro may silently accept an incorrect UNTIL= or WHILE= parameter and generate the wrong code. Most likely because of keywords. :>For example: :>DO UNTIL=(CR,R1,LT,R2),AND,(CR,R3,LT,R4) :> DOEXIT (CR,R5,LT,R6),AND,(CR,R7,LT,R8) :>ENDDO :>contains an incorrect DO macro but generates the following code without any warnings or errors: :> DO UNTIL=(CR,R1,LT,R2),AND,(CR,R3,LT,R4) :>+...@lb2<mailto:+...@lb2> DC 0H :> DOEXIT (CR,R5,LT,R6),AND,(CR,R7,LT,R8) :>+ CR R5,R6 :>+ BRC 11,#...@lb6 :>+ CR R7,R8 :>+ BRC 4,#...@lb1 :>+...@lb6<mailto:+...@lb6> DC 0H :> ENDDO :>+...@lb3<mailto:+...@lb3> DC 0H :>+ CR R1,R2 :>+ BRC 11,#...@lb2 :>+...@lb1<mailto:+...@lb1> DC 0H :>The DO macro seems to simply ignore the ",AND,(CR,R3,LT,R4)" and generates incomplete code (as far as the programmer's intentions are concerned). The correct syntax is: :>DO UNTIL=(CR,R1,LT,R2,AND,CR,R3,LT,R4) :> DOEXIT (CR,R5,LT,R6),AND,(CR,R7,LT,R8) :>ENDDO :>But why is this error not properly signalled? Because it wasn't coded to do it. :> Is it possible to change the macros to use one, consistent syntax (while maintaining backward compatability? Consistent syntax? Who knows? But the DO macro can check N'&SYSLIST and react if the number is incorrect. -- Binyamin Dissen <[email protected]> http://www.dissensoftware.com Director, Dissen Software, Bar & Grill - Israel Should you use the mailblocks package and expect a response from me, you should preauthorize the dissensoftware.com domain. I very rarely bother responding to challenge/response systems, especially those from irresponsible companies.
