convert [*] to the n with tab

Mark Smith mark at maseurope.net
Mon Aug 29 05:31:15 EDT 2005


I suspect you're going to need the replaceText function. It uses regex, 
which I'm afraid I can't help with. But someone here can and will, I'm 
sure...

Mark

On 29 Aug 2005, at 09:45, rev at armbase.com wrote:

> Quoting rev at armbase.com:
>
>> Hi All.
>>
>> I have a field with text items separated with charachters bounded by 
>> multiples
>> of [*].
>>
>> eg
>> [0][0][9]item1[0][0][0][6]item2[0]item3
>>
>> I would like the separator items [*] or [*][*] or [*][*][*] etc to be 
>> replaced
>> with a single tab.
>> I thought of this script
>>
>> on mouseUp
>>  put "preparsed" into p -- insert your field name here
>>  put empty into v
>>  repeat with x = 1 to the number of lines of fld p
>>  --put empty into v
>>  get line x of fld p
>> replace [*] with \
>> end repeat
>> end mouseUp
>>
>> However I keep getting the error
>>
>> compiling at 9:18:04 AM
>> Type	Expression: bad factor
>> Object	convert [*]n to tab delimiter
>> Line	replace [*] with \
>> Hint	[
>>
>> Any ideas. Is it the case that I cant use [ as a charachter? It was 
>> inserted OK.
>
> I also  tried
>
> on mouseUp
>  put "preparsed" into p -- insert your field name here
>  repeat with x = 1 to the number of lines of fld p
>  get line x of fld p
> replace "[*]" with "\" in
> end repeat
> put it into field "withtabs"
> end mouseUp
>
> And tried
> on mouseUp
>  put "preparsed" into p -- insert your field name here
>
> replace "[*]" with "\" in fld p
>
> put fld p into field "withtabs"
> end mouseUp
>
> No Luck.
>
> Cheers
> Bob
>>
>> All the best
>> Bob
>>
>> _______________________________________________
>> 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
>>
>
>
>
> _______________________________________________
> 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