How do I get the word before char x?

Mark Wieder mwieder at ahsoftware.net
Mon Jun 30 16:57:58 EDT 2008


Jan-

> put wird -1 of char 1 to x of theText

That has problems if char x is in a word. Try:

if char x of theText is space then
  put -1 into tPos
else
  put -2 into tPos
end if
put word tPos of (char 1 to x of theText)

-- 
 Mark Wieder
 mwieder at ahsoftware.net 






More information about the use-livecode mailing list