forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to get an unknown number of items back with vdsipp?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Mar 04, 2003 1:28 am    Post subject: How to get an unknown number of items back with vdsipp? Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Mar 04, 2003 1:58 pm    Post subject: Reply with quote

How do the E-mail & Username look like in that database? Something like Username|Emailaddress ?
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Mar 04, 2003 3:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Mar 04, 2003 3:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Mar 04, 2003 3:50 pm    Post subject: Reply with quote

Thanks Skit3000. I'll give that a shot.
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Mar 07, 2003 1:53 am    Post subject: Reply with quote

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? Crying or Very sad Embarassed

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Mar 07, 2003 7:23 am    Post subject: Reply with quote

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
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Mar 07, 2003 5:28 pm    Post subject: Reply with quote

Thanks Dr.Dread.
I've been trying over and over to get the list thing to work.
Kinda hard Laughing

Anyways, I got it working. Thanks again.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group