| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 3:53 am Post subject: help with list |
|
|
how do i make a list that has commads in it do the command in order? meaning
when program run it reads a list....like a file called test.txt in this file are commands like
run test1.bat
run test2.bat
etc
and then run one at a time in order?
and tips on this?
p.s i hope i explain this well...hard to explain....
thanks |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Mar 05, 2003 6:51 am Post subject: |
|
|
Try something like this:
| Code: | list create,1
list add,1,RUN|test1.bat|parameters
list add,1,RUN|test2.bat|parameters
%%inc = 0
REM cycle through the list
repeat
%%item = @item(1,%%inc)
REM parse each item to obtain your stuff
parse "%%cmd;%%file;%%param",%%item
if @equal(%%cmd,RUN)
RUN %%file %%param,WAIT
end
if @equal(%%cmd,SHELL)
SHELL open,%%file,%%param,,WAIT
end
%%inc = @succ(%%inc)
until @equal(%%inc,@count(1)) |
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 4:38 pm Post subject: ok |
|
|
is there a limit on how many items i can have in a list?
thanks |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Wed Mar 05, 2003 5:03 pm Post subject: |
|
|
| I think something around 98726284^28374... Just kidding... But itīs enough to put a few lines in like you mentioned.... |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 5:15 pm Post subject: also to |
|
|
your code works but there was a error on my part when i tried to explain it...
when the program is run i forgot to say that it needs to wait 2 mins or so then run the first list then run a second list and run the lists in order....
sorry
thanks |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 5:16 pm Post subject: ohhhh |
|
|
| only a few line it can do? |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Mar 05, 2003 5:23 pm Post subject: |
|
|
Lists are limited only by available memory, except Windows
95 has a limit of 32767 items in a visible list (not the ones
made with LIST CREATE).
You can insert a WAIT time into the list @item() as well. If you
allow a field for it, just check for a parsed value and add this to
your loop:
| Code: |
if %%wait
WAIT %%wait
end
|
If you need a WAIT before a list item, just add an item with all
fields blank except the %%wait time.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 5:40 pm Post subject: hummmm |
|
|
hummm
i think i follow what you mean mac on the wait...hummm if i have alot of items would it be better to have it read a txt file that have the batch file names in it? if so how would i do that?
thanks |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Mar 05, 2003 6:07 pm Post subject: |
|
|
| Code: | list create,1
list loadfile,1,yourtextfile.txt
|
Then you have the contents of your text file in your list. By the way, there may be problems
(in Win2K + XP) when trying to load lists longer than 100,000 recs. See here:
http://www.vdsworld.com/forum/viewtopic.php?t=1165
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 6:56 pm Post subject: ok |
|
|
ok
thanks
i'am having a hard time getting the timer to work and the second list to work  |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Mar 05, 2003 8:09 pm Post subject: |
|
|
To get the wait to to you will need to specify a value for %%wait, like this:
| Code: | %%wait = 2
REM **** If you don't want it to wait, use < %%wait = "" > to clear the variable |
... And what second list?  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 8:25 pm Post subject: ahhh kk |
|
|
ahhh kk i see what you mean..question tho i thought that i read somewhere its not good to uses the wait command like this? this true?
thanks |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 8:28 pm Post subject: yea |
|
|
the second list i did forget to mention in the first post...
that list would also run diff types of batch files to |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Mar 05, 2003 8:29 pm Post subject: |
|
|
I don't see any problem with it. In some cases it can cause trouble when
using a large amount of wait time, such as WAIT 10 since your program
won't let the user have any interaction. The solution to this would be the
following:
| Code: | %%wait = 10
if %%wait
wait event,%%wait
if @event()
goto evloop
end
end |
NOTE: This code hasn't been tested so it's not guaranteed to work. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Mar 05, 2003 8:49 pm Post subject: kk |
|
|
i see what you mean how would i added a second list to it?
so it would run the first list like every 2mins then run the second list in order then go back to the first list etc.
thanks |
|
| Back to top |
|
 |
|