Are any possible commands on data in a field also possible in a variable ?

Eric Chatonet eric.chatonet at sosmartsoftware.com
Fri May 18 10:18:06 EDT 2007


Bonjour André,

Le 18 mai 07 à 15:59, André.Bisseret a écrit :

> Hi,
> I have a handler that transforms a table1 (that is placed in a  
> variable) in another one, say table2 (that has to be placed in a  
> field)
>
> My aim is to convey the data of table1 into table2,  but displayed  
> in another order.
>
> The handler that transforms table1 into table2 involves (mainly)  2  
> types of commands :
> - a number of « put such item of such line of table1 into such item  
> of such line of table2
> - and, a « find such item in table2 »
> (all that in several repeat loops).
>
> My handler works well when I use a field as a container for table2  
> when conveying data from table1 to table2. But it is quite time  
> consuming.
> So, in order to gain millisecs (in fact seconds !), I tried to work  
> with a variable as a container in which to install the data coming  
> from table1 before to, at the end, put this variable into the field  
> (that should be the final product of the handler).
>
> In my handler, I only replace « fld « thisfld » with a variable «  
> thisVar » ; nothing else.
> But when I do so, my handler does not works properly.
>
> I hope I am not too unclear ! ?
>
> My question is : are there commands that work on data in a field  
> but not on data in a variable ? Specifically, does « find » works  
> in a variable as well as in a field ?
> Am I missing something evident ?
>
> Thanks a lot in advance
>
> Best regards from Grenoble
> André

In variables, Put will work as you expect it but Find will not:
Use instead, combined with wholeMatches and caseSensitive if needed,  
itemOffset and/or lineOffset:

'find such item in table2' will become something like 'put <some  
value> into item itemOffset(< such item>,<table2 var>) of  <table2 var>'
When all calculation will be done, just 'put <table2 var> into fld  
"Table2"
BTW working with variables is much faster because, mainly, the screen  
is refreshed only once :-)

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
http://www.sosmartsoftware.com/
eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list