File window character eating
Posted on 1999-01-18
I'm trying to get into Pascal and I'm having some trouble understanding the file window.
1/ I want to skip leading non-digits from an input stream and I have the following code
while not c in ['0'..'9'] do read (c);
This isn't working, properly, I'm not processing all the characters it seems. I'm not sure how to rewrite that loop using the input window. I think I must need it because I think my read statement is going too far.
2/ I'm trying to use the file window to slip blanks, like so
while input^ <> ' ' do read (c);
This sometimes crashes. What am I doing wrong?