| View previous topic :: View next topic |
| Author |
Message |
Gosha_Mala Newbie
Joined: 14 Apr 2009 Posts: 2
|
Posted: Tue Apr 14, 2009 1:21 pm Post subject: Convert table LIST into a line |
|
|
Hi,
I'm a beginer in VDS scripting and run out of ideas of how to solve a simple problem. I have a simple table list like:
John;
Paul;
George;
Ringo;
What would be the best way to convert it to a line?
John;Paul;George;Ringo;
Thank you. |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Tue Apr 14, 2009 2:20 pm Post subject: |
|
|
Hi Gosha_Mala.
Wellcome to VDS.
You can read every table item and put them into a variable.
You can try this:
| Code: | %%linevar =
list seek,list1,0
repeat
%a = @next(list1)
if %a
%%linevar = %%linevar%a
end
until @null(%a) |
Good luck
_______________
uVeDeSe
_______________
visit: http://www.uvedese.es |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Apr 14, 2009 5:04 pm Post subject: |
|
|
Yup, what he said up there.  _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
Gosha_Mala Newbie
Joined: 14 Apr 2009 Posts: 2
|
Posted: Wed Apr 15, 2009 5:14 am Post subject: |
|
|
uvedese,
Thank you very much!  |
|
| Back to top |
|
 |
JerryDee Contributor


Joined: 19 Oct 2005 Posts: 53 Location: Czech Republic
|
Posted: Wed Apr 15, 2009 9:35 am Post subject: |
|
|
Hi Gosha_Mala!
For your task you can also use right this function: @text(list)
e.g.
| Code: |
list create,1
list loadtext,1
"John;
"Paul;
"George;
"Ringo;
%%linevar = @text(1)
list close,1
exit
|
 _________________ Jerry
(VDS 4,5,6 Pro | V-Setup 3) |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Apr 15, 2009 3:58 pm Post subject: |
|
|
@text() will not pull it all into a single line though. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
JerryDee Contributor


Joined: 19 Oct 2005 Posts: 53 Location: Czech Republic
|
Posted: Wed Apr 15, 2009 5:10 pm Post subject: |
|
|
Oh, I'm sorry - you are right, Garret, I looked at it only in "debug window" and was hasty  _________________ Jerry
(VDS 4,5,6 Pro | V-Setup 3) |
|
| Back to top |
|
 |
JerryDee Contributor


Joined: 19 Oct 2005 Posts: 53 Location: Czech Republic
|
Posted: Wed Apr 15, 2009 5:47 pm Post subject: |
|
|
O.K. - my another attempt
| Code: |
# The @strrep() is accepted only for VDS6
list create,1
list loadtext,1
"John;
"Paul;
"George;
"Ringo;
%%linevar = @strrep(@text(1),@cr()@chr(10),"",ALL)
info %%linevar
list close,1
exit
|
Edit: This my "custom-function" works pretty well but in a final effect is much slower - so it can serve only as a little (funny) exhibition of using of a new vds function _________________ Jerry
(VDS 4,5,6 Pro | V-Setup 3) |
|
| Back to top |
|
 |
|