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


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri May 16, 2003 1:19 pm Post subject: Adding several registry entries into LIST |
|
|
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 |
|
 |
LOBO Valued Contributor


Joined: 14 Mar 2002 Posts: 241 Location: Wilmington, Delaware, USA
|
Posted: Fri May 16, 2003 2:01 pm Post subject: Re: Adding several registry entries into LIST |
|
|
| 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 |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri May 16, 2003 2:50 pm Post subject: |
|
|
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 |
|
 |
LOBO Valued Contributor


Joined: 14 Mar 2002 Posts: 241 Location: Wilmington, Delaware, USA
|
Posted: Fri May 16, 2003 2:57 pm Post subject: |
|
|
| 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 |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri May 16, 2003 3:03 pm Post subject: |
|
|
Oh... was that all?
damn, sorry. I should have caught that myself
hehehe thanks  _________________
 |
|
| Back to top |
|
 |
LOBO Valued Contributor


Joined: 14 Mar 2002 Posts: 241 Location: Wilmington, Delaware, USA
|
Posted: Fri May 16, 2003 3:07 pm Post subject: |
|
|
No problem. We all miss the easy ones sometimes
-Mark |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri May 16, 2003 3:12 pm Post subject: |
|
|
yepp, that's so true
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri May 16, 2003 3:26 pm Post subject: |
|
|
Couldn't get LIST remove to work. But this worked
| Code: | if @match(LIST1,EMPTY)
LIST delete,LIST1,@index(LIST1)
end |
_________________
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sat May 17, 2003 1:38 am Post subject: |
|
|
ok, thanks for the tip  _________________
 |
|
| Back to top |
|
 |
|
|
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
|
|