         Edinburgh IMP77 Compiler - Version 8.4

    1  ! I have found some bugs with the TOSTRING and SUBSTRING functions in
    2  ! imp23b. When used in an IF statement they evaluate incorrectly, as
    3  ! the program below shows, though they evaluate correctly if you write
    4  ! them out. (the IF bug mentioned in the last mail message also occurs
    5  ! with UNLESS)
    6  
    7  %begin
    8     %constant %string (9)    ten      = "123456789"
    9     %String(255)  Beta
   10  
   11     %if tostring('a') = "a" %then printstring("pass") %and newline
   12  
   13     Beta = Ten
   14     %if substring(beta,4,7)="4567" %then printstring ("pass") %and newline
   15  
   16  %End %of %Program

    7 Statements compiled
