Page 1 of 1
line delimited list
Posted: Wed Sep 03, 2014 9:53 am
by link76
Hello,
I would like to see the line delimited list of columns in my FORM dg ...?
thx
Re: line delimited list
Posted: Wed Sep 03, 2014 5:35 pm
by Klaus
Hi link76,
you need to loop through the datgrid array!
Something like this, I use only three columns in my example,
you need to use of course the names of YOUR columns in the datagrid!
Code: Select all
on mouseUp
## Get the datagrid data, which is an array:
put the dgdata of grp "your datagrid here" into tData
## We use the KEYS of that array (1 to N), which is a CR delimited list, for the following loop
put the keys of tData into tKeys
## we use tis variable for the text list:
put empty into tTextList
## here we create a simple (test) TAB and CR delimited list from the array data
repeat for each line tKey in tKeys
put tData[tKey]["column 1"] & TAB & tData[tKey]["column 2"] & TAB & tData[tKey]["column 3"] & CR after tTextList
end repeat
## get rid of trailing CR
delete char -1 of tTextList
## Now display list in a field
put tTextList into fld "whatever"
end mouseUp
Hint:
If one of your columns contains MULTILINE text, this will of course "break" the list a bit
Best
Klaus
Re: line delimited list
Posted: Wed Sep 03, 2014 9:48 pm
by snm
put the dgText of grp "DataGrid" into fld "Field"
should work for any count of columns.
Marek
Re: line delimited list
Posted: Wed Sep 03, 2014 10:10 pm
by Klaus
"dgtext" does really work with a FORM datagrid?

Re: line delimited list
Posted: Thu Sep 04, 2014 6:32 am
by snm
Why not? I didn't use FORM yet, but didn't find any info it should not work.
By the way, are there columns in DataGrid FORM?
Marek
Re: line delimited list
Posted: Thu Sep 04, 2014 12:41 pm
by Klaus
Hi Marek,
hmmm, true!
I think that I always associate a datagrid of type TABLE with ONE-line data and a datagrid
of type FORM with MULTI-line data, where a TAB and CR delimited list will not make much sense.
But obviously we can also use dgtext with FORMs, too.
@link76
So just try:
...
put the dgtext of grp "your FORM datagrid here..." into fld "the field with some TABstops in it"
...
Best
Klaus
Re: line delimited list
Posted: Thu Sep 04, 2014 1:01 pm
by snm
So 1 small beer for me
Marek
Re: line delimited list
Posted: Thu Sep 04, 2014 1:07 pm
by Klaus
YES!
I was very surprised that in bars in Portugal they really sell "um fino", which is a 0.1 liter glass of beer!
Still wondering what that's good for

Re: line delimited list
Posted: Thu Sep 04, 2014 1:14 pm
by snm
In our country small beer is min. 0,33 l
Marek
Re: line delimited list
Posted: Thu Sep 04, 2014 1:20 pm
by Klaus
Hi Marek,
you are czech, right?
Well, that is no wonder, it is the country of origin of all the beer in the world
Best
Klaus
Re: line delimited list
Posted: Thu Sep 04, 2014 2:33 pm
by snm
50% / 50%
Czech beer is known on all over the word.
I'm from Poland. We have also our own good beer.
Marek
Re: line delimited list
Posted: Thu Sep 04, 2014 3:19 pm
by Klaus
Oh, sorry, but I was quite near

Re: line delimited list
Posted: Thu Sep 04, 2014 4:31 pm
by snm
Yes, for me only about 450 km to boarder / 8-9 hours of drive (terrible roads and a lot of police radars). But we can drink this beer in Germany - the same 450 km to the boarder, but new speedway only 4 hours.
Marek