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 


Simple Randomizer tester

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


Joined: 05 Feb 2004
Posts: 642
Location: Eastern Indiana

PostPosted: Sun Jan 02, 2005 5:37 am    Post subject: Simple Randomizer tester Reply with quote

Just a simple Randomizer Tester...
Code:

Title Randomizer
OPTION DECIMALSEP, "."
LIST CREATE,1,SORTED

DIALOG CREATE,Randomizer,-1,0,240,155,,savepos
DIALOG ADD,LINE,LINE1,5,55,179,140

DIALOG ADD,STYLE,STYLE1,,10,,,CC6600

DIALOG ADD,LIST,counter,55,65,20,18,Counter
DIALOG ADD,LIST,numbers,5,5,40,140,Examples
DIALOG ADD,LIST,testing,90,65,40,20,testing

DIALOG ADD,TEXT,TEXT,20,75,,,Randomizer,,STYLE1
DIALOG ADD,BUTTON,start,13,168,45,20,START
DIALOG ADD,BUTTON,retry,39,168,45,20,RESET
DIALOG ADD,BUTTON,exit,120,138,75,17,PAUSE "/" EXIT

DIALOG SHOW

dialog disable,retry

:Evloop
wait event
goto @event()

:retryBUTTON
LIST clear,1
dialog clear,numbers
dialog clear,testing
dialog clear,counter
%%text_counter = 0
%%testing = no
dialog enable,start
dialog disable,retry
goto Evloop


:skip-retry

:startBUTTON
%%pause = off
dialog disable,retry
:START
LIST clear,1
:restart
%%count = 0
%%min = 1
%%max = 40
REPEAT
%%dt = @ext(@datetime())
    if @greater(@len(%%dt_old), @len(%%dt))
       REPEAT
         %%dt = %%dt"0"
       UNTIL @equal(@len(%%dt), @len(%%dt_old))
    end
    %%dt_old = %%dt
    if @greater(@len(%%dt), @len(%%max))
       %%rand = @substr(%%dt, @succ(@diff(@len(%%dt), @len(%%max))), @len(%%dt))
    end
UNTIL @both(@greater(%%rand, @pred(%%min)), @greater(@succ(%%max), %%rand))

dialog clear,testing
LIST add,testing,%%rand
wait "0.1"
LIST add,1,%%rand
wait "0.1"
%%count_eighteen = @count(1)
dialog clear,counter
dialog set,counter,%%count_eighteen

%E = @event()
IF @equal(%E,exitBUTTON)
%%count_eighteen = 10
dialog set,testing,Pause
%%pause = on
END
IF @equal(%E,CLOSE)
goto close
END
#  below partially determines how many numbers to process
#  above REPEAT may beed adjustments for more numbers
IF @not(@greater(%%count_eighteen,9))
goto restart
END

IF @unequal(%%pause,on)
dialog set,testing,Done"!"
%%pause = off
END

dialog disable,start
dialog enable,retry

dialog set,numbers,@text(1)
goto evloop

:exitBUTTON

:CLOSE
LIST close,1
STOP
Back to top
View user's profile Send private message Visit poster's website
GeoTrail
Valued Contributor
Valued Contributor


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

PostPosted: Wed Mar 30, 2005 9:24 am    Post subject: Reply with quote

Why the wait commands on line 65 and 67?
Seems to work fine here without them.

_________________
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 -> Visual DialogScript 5 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