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 


Vectored Execution ... sort of

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Tue May 04, 2004 8:51 am    Post subject: Vectored Execution ... sort of Reply with quote

Hi

I've come up with a solution to speeding up the process deciding which part of the script should be executed from a large number of choices.

Say the script had to choose from 50 options you could put in 50 if...then statements and jump off from them. But what if your choice if the 50th then the script would have to do 50 tests which is a waste of processing time.

My solution is to use a list containing all the labels that are targeted and go straight to that item in the list and jump from there.

Please feel free to slag my script off as this is what usually happens when I post stuff on the forum.


Code:

Title Vectored Execution
  DIALOG CREATE,New Dialog,-1,0,189,127
  DIALOG ADD,COMBO,COMBO1,30,80,48,21,1
  DIALOG ADD,BUTTON,BUTTON1,74,48,86,24,RUN SECTION
  DIALOG ADD,TEXT,TEXT1,32,38,,,Section
  DIALOG SHOW
  list loadtext,COMBO1
"1
"2
"3
"4

  list create,1
  list loadtext,1
"section1
"section2
"section3
"section4

:Evloop
  wait event
  goto @event()

:BUTTON1BUTTON
  %a = @dlgtext(combo1)
  %a = @pred(%a)
  %b = @item(1,%a)
  goto %b

:section1
  info Section 1
  goto evloop

:section2
  info Section 2
  goto evloop
 
:section3
  info Section 3
  goto evloop

:section4
  info Section 4
  goto evloop

:Close
  list close,1
  exit
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 -> Visual DialogScript 3 Source Code 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