Char position of token...
Hi, 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 Best regards, Gilberto Cuba ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Char position of token...
On 11/22/05 3:23 PM, Gilberto Cuba [EMAIL PROTECTED] wrote: Hi, 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 Here you go, Gilbert: function stsTokenCharChunk pTokenNum,pData put the number of tokens of pData into tNumTokens put 0 into tStartOff repeat with x = 1 to pTokenNum put offset(token x of pData,pData,tStartOff) + tStartOff into tChar end repeat return char tChar to \ (tChar + length(token pTokenNum of pData)-1) end stsTokenCharChunk If you don't want it coming back char 3 to 5 but want it as 3,5 or something else, just change the last return line. Have fun! Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Char position of token...
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 ~ [EMAIL PROTECTED] http://www.jaedworks.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Char position of token...
On 11/22/05 3:48 PM, Jeanne A. E. DeVoto [EMAIL PROTECTED] wrote: 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 Unfortunately this won't work for some tokens, or when there's more than one of the same token in a string, like: put word 1 of (word 2 to 4 of the uProp of this card) and we're looking for the second word token. Also some tokens have a space before them, so doing -1 on the offset should be -2 (or some trimming should take place). However for the math formula presented, these should work fine, but just be aware if you want to make it more general purpose. Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution