Char position of token...

Jeanne A. E. DeVoto revolution at jaedworks.com
Tue Nov 22 16:48:35 EST 2005


At 4:23 PM -0500 11/22/2005, Gilberto Cuba wrote:
>How I can know the position of char of the determined token of the string?
>
>Example:
>
>put "a*sin(x+b)" into temp
>put token 5 of temp   -- that return "x"
>put char 7 of temp  -- that return "x"
>...
>now, well
>...
>put token 3 of temp  -- that return "sin"
>put char 3 to 5 of temp  -- that return "sin"
>
>then, i need any function that return the follow values:
>
>token 5 of temp --->  char 7 of temp
>token 3 of temp --->  char 3 to 5 of temp

Try something like this:

   put offset(token 5 of temp,temp) -- gives position of first char of token 5
   put offset(token 6 of temp,temp) - 1 -- gives position of last char 
of token 5
-- 
jeanne a. e. devoto ~ revolution at jaedworks.com
http://www.jaedworks.com



More information about the use-livecode mailing list