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 


help with list
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 3:53 am    Post subject: help with list Reply with quote

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
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


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

PostPosted: Wed Mar 05, 2003 6:51 am    Post subject: Reply with quote

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
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 4:38 pm    Post subject: ok Reply with quote

is there a limit on how many items i can have in a list?

thanks
Back to top
View user's profile Send private message
Skit3000
Admin Team


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

PostPosted: Wed Mar 05, 2003 5:03 pm    Post subject: Reply with quote

I think something around 98726284^28374... Just kidding... But itīs enough to put a few lines in like you mentioned....
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 5:15 pm    Post subject: also to Reply with quote

your code works but there was a error on my part when i tried to explain it...Embarassed

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
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 5:16 pm    Post subject: ohhhh Reply with quote

only a few line it can do?
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Mar 05, 2003 5:23 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 5:40 pm    Post subject: hummmm Reply with quote

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
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


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

PostPosted: Wed Mar 05, 2003 6:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 6:56 pm    Post subject: ok Reply with quote

ok

thanks


i'am having a hard time getting the timer to work and the second list to work Sad
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Mar 05, 2003 8:09 pm    Post subject: Reply with quote

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? Confused

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 8:25 pm    Post subject: ahhh kk Reply with quote

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
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 8:28 pm    Post subject: yea Reply with quote

the second list i did forget to mention in the first post... Embarassed


that list would also run diff types of batch files to
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Mar 05, 2003 8:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Mar 05, 2003 8:49 pm    Post subject: kk Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
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