text into a tabstopped field

Jim Ault JimAultWins at yahoo.com
Sun Aug 20 04:19:44 EDT 2006


On 8/19/06 6:52 PM, "Mark Smith" <mark at maseurope.net> wrote:

> set the itemDelimiter to tab
> put "someInfo" into item 2 of line n of fld "someField"
> 
> On the other hand, if you're making many updates at once and the
> field contains a lot of data, it might be more efficient to put the
> field into a variable, update the variable and then put the variable
> back into the field.

Major Caveat!
the item in Rev does not always mean what you may think it should.

The number of items in "a,b,c,d,e,f,g" is 7
The number of items in "a,b,c,d,e,f," is 6
The number of items in "a,b,c,d,e,," is 6
The number of items in "a,,,,,," is 6
It is the same with cr's (lines)
The trailing comma is not counted as delimiting an empty item.  This will
throw off you updating algorithm.  One answer is to fill a far-right dummy
column with '1' or something to insure that you will be updating properly.

you could use [a very fast loop for Rev]

set the itemdel to tab
get fld dbTabList
repeat for each line LNN in it
   put LNN into newLine
   put 1 into item 20 of newLine  --insures 20 tabs minimum
   put newLine & cr after newTabList
end repeat
filter newTabList without empty

Jim Ault
Las Vegas
> 
> On 20 Aug 2006, at 02:33, Mark MacKenzie wrote:
> 
>> Hello.  I need to put a DB query result into a RunRev stack field
>> which has tabstops at 62,123,282,467,606,822,911.
>> I don't wish to just put the query result into the field as this
>> overwrites all current information in that field.
>> 
>> I just want to update portions of this field.  For example I would
>> like to put "some information" in field "SomeField" between its
>> first and second tabstops.
>> 
>> In some cases the query result would be a single number while in
>> other cases it could be a short phrase.
>> 
>> I am stumped.
>> 
>> Regards
>> 
>> Mark MacKenzie
>> Past Ink Publishing
>> _______________________________________________
>> 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