| View previous topic :: View next topic |
| Author |
Message |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Mar 04, 2003 1:28 am Post subject: How to get an unknown number of items back with vdsipp? |
|
|
Hi again guys.
I've been playing around alittle with the vdsipp extension.
One thing I really like about it is it's POST and GET features.
But one thing has got me wondering...
Lets say I wanna get a user and an email address from a database. That's not a problem. Just use the normal GET method and add the two items to 2 variables in VDS.
But what if I have a database with an unknown number of items? A download database or something and I wanna get all the items in the database table back using the GET function and then display them in VDS using variables or some other way. Is this possible? _________________
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Mar 04, 2003 1:58 pm Post subject: |
|
|
| How do the E-mail & Username look like in that database? Something like Username|Emailaddress ? |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Mar 04, 2003 3:38 pm Post subject: |
|
|
Well, that's up to me how I want to output the data.
Using name|email is what I had in mind. _________________
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Mar 04, 2003 3:44 pm Post subject: |
|
|
Then you can try something like this... Be sure that %%database must hold the output from your database...
| Code: | %%database = user1|email1|user2|email2|user3|email3
list create,9
repeat
parse "%%username;%%email",%%database
%%database = @strdel(%%database,1,@sum(@len(%%username),@len(%%email),2))
list add,9,%%username|%%email
until @equal(%%database,)
info List 9 now holds this usernames:@cr()@cr()@text(9)@cr()@cr()Use "@match()" to search through it... |
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Mar 04, 2003 3:50 pm Post subject: |
|
|
Thanks Skit3000. I'll give that a shot. _________________
 |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri Mar 07, 2003 1:53 am Post subject: |
|
|
Hi Skit3000.
The code worked great.
But I've been trying for hours now trying to figure out how I can add the records into a list object to be displayed in a dialog.
Here is the code I'm using now: | Code: | list create,3
repeat
parse "%%firstname;%%lastname",%%database
%%database = @strdel(%%database,1,@sum(@len(%%firstname),@len(%%lastname),2))
list add,3,%%firstname|%%lastname
until @equal(%%database,)
%%SearchName = Ingrid
IF @MATCH(3, %%SearchName)
LIST SEEK,3,@INDEX(3)
%I = @ITEM(3)
parse "%%Firstname;%%Lastname",%I
INFO Welcome %%Firstname %%Lastname!
END
LIST CLOSE, 3 |
I can get data from one record, like the first and lastname, but how can I add all the records to a list?  _________________
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Mar 07, 2003 7:23 am Post subject: |
|
|
You have all your recs nicely in list 3. Create a visible list, you know, DIALOG ADD,list,VISIBLE,....
Then use LIST ASSIGN,VISIBLE,3
Should put the contents of list 3 into the VISIBLE list on your dialog.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri Mar 07, 2003 5:28 pm Post subject: |
|
|
Thanks Dr.Dread.
I've been trying over and over to get the list thing to work.
Kinda hard
Anyways, I got it working. Thanks again. _________________
 |
|
| Back to top |
|
 |
|