Determine last character of a variable

Warren Kuhl warrenkuhl at gmail.com
Wed Aug 26 13:46:59 EDT 2009


Phil/Stephen,

Thanks for your help!  I never understood what the -1 meant when dealing
with characters.

Appreciate your quick responses!
Warren


On 8/26/09, Phil Davis <revdev at pdslabs.net> wrote:
>
> Try "char 1 to -1 of tdata".
>
> char -1 is the last char
> char -2 is the next-to-last char
> and so on.
>
> Phil Davis
>
>
> Warren Kuhl wrote:
>
>> This is probably a very stupid question..
>>
>> I am trying to extract a substring from a variable and am unsure how to
>> determine the last character...
>>
>> I tried...
>> put char 1 to last character of tdata into tsubstring
>> ...but this fails.
>>
>> Thanks for any help!
>> Warren
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>>
>
> --
> Phil Davis
>
> PDS Labs
> Professional Software Development
> http://pdslabs.net
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list