WHILE ch > "!" DO pat[i] := ch; INC(i); Texts.Read(R, ch) END; pat[i] := 0X; IF ch = "!" THEN pat[i+1] := “!" ELSE pat[i+1]:= 0X END ; (*directory option*)
Even better (and shorter). So that’s the fix.
WHILE ch > "!" DO pat[i] := ch; INC(i); Texts.Read(R, ch) END; pat[i] := 0X; IF ch = "!" THEN pat[i+1] := â!" ELSE pat[i+1]:= 0X END ; (*directory option*)
Maybe I'm missing something (and at the risk of flogging another dead horse), surely the IF statement is unnecessary? If ch is "!" then we want to put it in pat[i+1], if not then since PROCEDURE List only compares with that value, any other one will do. So that's why I suggested putting ch in in both cases. FWIW, I was also concerned about what would have to change if another option was added. Paul (bracing myself!) :)
Hi, i := 0; WHILE ch > "!" DO pat[i] := ch; INC(i); Texts.Read(R, ch) END; pat[i] := 0X; pat[i+1] := ch; (*directory option*) Just tested the above here on FPGA system, seems to work. -- Tomas Kral <thomas.kral@email.cz>
participants (3)
-
Andreas Pirklbauer -
Paul Reed -
Tomas Kral