Re: if statement not working

new topic     » goto parent     » topic index » view thread      » older message » newer message

-------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. blink

Karl Bochert

-------Phoenix-Boundary-07081998---

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu