convert [*] to the n with tab

rev at armbase.com rev at armbase.com
Mon Aug 29 05:48:38 EDT 2005


Quoting Mark Smith <mark at maseurope.net>:

> 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...

Yep I eventiually tried that too. I even made it simple and tried it on the
original field.

I used (without any luck)
on mouseUp
replaceText(field "preparsed",[0],comma)
end mouseUp

I get an error at [

cheers
bob


>
> 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
>>
>
> _______________________________________________
> 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