Re: if statement not working
- Posted by kbochert at ix.netcom.com Mar 23, 2002
- 524 views
-------Phoenix-Boundary-07081998- You wrote on 3/23/02 5:53:37 PM: >It *IS* difficult telling the dumb computer what you really want: > > firstnonspace=1 > while x[firstnonspace]=' ' do firstnonspace+=1 end while > while 1 do > i = match({' ',9},x[firstnonspace..length(x)]) > if i then > i+=firstnonspace-1 > x=x[1..i-1]&x[i+1..length(x)] > end if >.... i.e. regex_find ("\b[^ 9]*", x) -- find the pattern x = regex_head & regex_tail -- leave out the match .... This kind of thing is easier with regular expressions. Karl Bochert -------Phoenix-Boundary-07081998---