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 


Adding several registry entries into LIST

 
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: Fri May 16, 2003 1:19 pm    Post subject: Adding several registry entries into LIST Reply with quote

What's wrong with this?
Code:
LIST CREATE,1, SORTED
%X = 1

  DIALOG CREATE,New Dialog,-1,0,243,223
REM *** Modified by Dialog Designer on 16.05.2003 - 15:09 ***
  DIALOG ADD,LIST,LIST1,36,27
  DIALOG SHOW

REPEAT
  %%Result = @REGREAD(CURUSER,Software\GeoTrail Corporation\Experiment,test %X,EMPTY)
  %X = @SUM(%X,1)
UNTIL @EQUAL(%%Result,EMPTY)
  LIST ADD,LIST1,%%Result

:Evloop
wait event
goto @event()

:Close
  exit


I'm trying to understand how the LIST command works and here I'm trying to add several registry entries into the LIST1 object. But all I get into the object is the word EMPTY...

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Fri May 16, 2003 2:01 pm    Post subject: Re: Adding several registry entries into LIST Reply with quote

GeoTrail wrote:
What's wrong with this?
Code:
LIST CREATE,1, SORTED
%X = 1

  DIALOG CREATE,New Dialog,-1,0,243,223
REM *** Modified by Dialog Designer on 16.05.2003 - 15:09 ***
  DIALOG ADD,LIST,LIST1,36,27
  DIALOG SHOW

REPEAT
  %%Result = @REGREAD(CURUSER,Software\GeoTrail Corporation\Experiment,test %X,EMPTY)
  %X = @SUM(%X,1)
UNTIL @EQUAL(%%Result,EMPTY)
  LIST ADD,LIST1,%%Result

:Evloop
wait event
goto @event()

:Close
  exit


I'm trying to understand how the LIST command works and here I'm trying to add several registry entries into the LIST1 object. But all I get into the object is the word EMPTY...


GeoTrail,
The reason you are only getting EMPTY added to the list once is because of the following.

First in your @regread function you have

Code:
@REGREAD(CURUSER,Software\GeoTrail Corporation\Experiment,test %X,EMPTY)


The last parameter ,EMPTY tells VDS that if the registry key is not there to make your variable whatever the parameter supplied is, in this case EMPTY

Secondly your until statement tells the program to stop once %%result equals empty then add %%result to the list. Since the registry key didn't exist you made the result equal EMPTY then went to the until statement.

- Mark
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
GeoTrail
Valued Contributor
Valued Contributor


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

PostPosted: Fri May 16, 2003 2:50 pm    Post subject: Reply with quote

Yes, I know about that.
The EMPTY value will be the default value if there is no data read from the registry.

I was thinking that:

It reads the values from the registry, they do exist 'cause I added them my self to test the code. I have added test 1, test 2 etc. When there is no more strings to read from the registry, it will return EMPTY.

Atleast that is what I wanted it to do.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Fri May 16, 2003 2:57 pm    Post subject: Reply with quote

Code:
LIST CREATE,1, SORTED
%X = 1

  DIALOG CREATE,New Dialog,-1,0,243,223
REM *** Modified by Dialog Designer on 16.05.2003 - 15:09 ***
  DIALOG ADD,LIST,LIST1,36,27
  DIALOG SHOW

REPEAT
  %%Result = @REGREAD(CURUSER,Software\GeoTrail Corporation\Experiment,test %X,EMPTY)
  %X = @SUM(%X,1)
LIST ADD,LIST1,%%Result
UNTIL @EQUAL(%%Result,EMPTY)
 

:Evloop
wait event
goto @event()

:Close
  exit


Sorry I missed it you need the list add command before your until statement.

-Mark
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
GeoTrail
Valued Contributor
Valued Contributor


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

PostPosted: Fri May 16, 2003 3:03 pm    Post subject: Reply with quote

Oh... was that all? Laughing
damn, sorry. I should have caught that myself Laughing

hehehe thanks Wink

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Fri May 16, 2003 3:07 pm    Post subject: Reply with quote

No problem. We all miss the easy ones sometimes Wink


-Mark
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
GeoTrail
Valued Contributor
Valued Contributor


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

PostPosted: Fri May 16, 2003 3:12 pm    Post subject: Reply with quote

yepp, that's so true Smile

Got one more question though.
Now I get the value EMPTY at the end of the list.
How can I delete that entry in the list?
I tried this, but no go
Code:
LIST DELETE,@count(LIST1)

_________________
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: Fri May 16, 2003 3:20 pm    Post subject: Reply with quote

Try list remove... I believe it isn't mentioned in the helpfile... Confused
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
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 May 16, 2003 3:26 pm    Post subject: Reply with quote

Couldn't get LIST remove to work. But this worked
Code:
if @match(LIST1,EMPTY)
  LIST delete,LIST1,@index(LIST1)
end

_________________
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: Fri May 16, 2003 3:39 pm    Post subject: Reply with quote

Code:
LIST DELETE,@count(LIST1)


I know why it doesn't work. A list starts counting at 0, but if you count the number of items, it will start counting at 1. So list delete,@pred(@count(LIST1)) should work too...

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
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: Sat May 17, 2003 1:38 am    Post subject: Reply with quote

ok, thanks for the tip Smile
_________________
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