TMobjs
Doug Easterbrook
doug at artsman.com
Fri Mar 4 17:27:55 UTC 2022
you can create an object that inherits from TMObjs
to turn a list into a string.. is generally
do list.$define(Column1, column2, column3)
do list.$add(value 1, value2, value 3)
etc
do tmobjs.$listtostring(packedstring,# of columns to pack,List,separator,’Column1,column2’,SelectedOnly)
where
packed string is the char you want to put it inot
# of columns are those that you want to extract from your list. It doesn’t have to be all the columns, you can be selective
List - the list where the data is coming from
separator - something that you want to use to separate the data. we typically use `. (back quote) or , (comma) - the character you use should not be in the contents of the data
’Column1,column2’ are the names of the columns you want. it doesn’t have to be in the same order as the list definition, and it doesn’t have to be all the columns
selected only. defaults to false (all rows), but you can only do selected.
to get it out of the packed string, its the reverse
do list.$define(Column1, column2, column3)
do tmobjs.$listtostring(packedstring,# of columns to pack,List,separator,’Column1,column2’)
we use this all the time for things like making ‘in clauses’ for findign dta in sql.
eg
tmobjs.$listtostring(search,1,List,separator,’Seq_field’,SelectedOnly)
if len(search)>0
calc search as con (‘MykeyField in (‘,search,’)’)
end if
can’t say how often we’ve used that to work on data people have selected in a list.
hope that helps.
Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978
> On March 3, 2022, at 7:25 PM, Mike Rowan <michael.rowan3 at gmail.com> wrote:
>
> Argh. Typo. I should say list to string and vice-versa. Sorry.
>
> On Fri, Mar 4, 2022 at 12:46 PM Mike Rowan <michael.rowan3 at gmail.com> wrote:
>
>> I have TMobjs v258A All platforms installed on my MacBookPro (Ctalina)
>>
>> I am using $makeparamrow, no problems. However I don't see anything to
>> do with list to row or vice-versa.
>>
>> Your guidance, as always, is welcome.
>>
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list