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 


New Project Template
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Sun Jan 12, 2003 4:46 pm    Post subject: New Project Template Reply with quote

__________________________________________________________________________________________________________________________
New Project Template

Note: Not a demonstration. This is my New Project Template so some things may seem unclear. Will post a demonstration project upon request.

Intermediate Code: Beginners may find this code hard to understand during the first few weeks of programming.

Additional Credit goes out to Skit3000 and Mac, who have shown me more than I care to admit in the past four months.

Includes code to handle some pretty standard stuff:
Scaling
Decimal seperator
Class Handle included for reference
Proper timer handling for multiple dialogs
Proper dialog selection in evloop before jumping to an event
Proper handling of resize event
Proper handling of dragdrop event
Mouseover Subroutines
Flat Control Subroutine
Array (List) Handling Subroutine

NOTE:
Suggestions for new subroutines graciously accepted!
Improvements greatly accepted!
Asking to remove a subroutine or a section of code however may seem rude.

Code:

option decimalsep,"."
option scale,96

TITLE New Project Template

DIALOG CREATE,New Project Template,-1,0,500,300,Dragdrop,Click,Resizable,Class TVDSDialog
  DIALOG SHOW

rem %%mouseover = Status1|BUTTON1
rem gosub mouseover start
 
  :TIMER
rem gosub Mouseover Check
rem goto %%event
 
  :EVLOOP
wait event,0.1
%%eventdialog = @event(d)
parse "%%event;%%dialog",%%eventdialog
if @equal(%%event,timer)
goto timer
end
dialog select,%%dialog
goto %%event
 
  :CLOSE
  exit
 
  :CLICK
  goto evloop
   
  :RESIZE
  parse "%%H;%%W",@dlgpos(,HW)
  if @equal(%%dialog,0)
rem dialog 0 resize events go here
  end
  goto evloop
 
  :DRAGDROP
  if @null(%%dropfilescreate)
  list add,dropfiles,0,0,0,0
  %%dropfilescreate = true
  else
  end
list clear,dropfiles
list dropfiles,dropfiles
  goto evloop
 
rem----------------Include in all code (100 lines below main code is my preference)-----

:mouseover start
if @null(%%mouseovercreate)
dialog add,list,mouseover,0,0,0,0
%%mouseovercreate = true
end

repeat
parse "%a;%b",%%mouseover
%%remainder = @substr(%%mouseover,@sum(@len(%a),2),@len(%%mouseover))
if %a
list add,mouseover,%a|@winexists(@win(~%a))
%%mouseover = %%remainder
end
until @null(%a)
exit

:mouseover check
list seek,mouseover,0
:mouseloop
parse "%a;%b",@item(mouseover)
%%check = @winatpoint(@mousepos(X),@mousepos(Y))
if @equal(%%check,%b)
%%event = %amouseover
%%mouseover = %a
goto mousedone
end
if @equal(@pred(@count(mouseover)),@index(mouseover))
if @null(%%mouseover)
else
%%lastmouseover = %%mouseover
%%mouseover = ""
end
goto mousedone
else
list seek,mouseover,@succ(@index(mouseover))
goto mouseloop
end
:mousedone
if @null(%%mouseover)
if %%lastmouseover
%%event = %%lastmouseover""mouseout
%%lastmouseover = ""
else
%%event = evloop
end
end
exit

:Makeflat
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"1",@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,l),2,@dlgpos(%%flatdialog,h)
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"2",@dlgpos(%%flatdialog,t),@diff(@fadd(@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w)),2),2,@dlgpos(%%flatdialog,h)
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"3",@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w),2
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"4",@diff(@fadd(@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,h)),2),@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w),2
  %%flatdialognumber = 1
  repeat
  DIALOG DISABLE,"BITBTN"%%flatdialog%%flatdialognumber
  %%flatdialognumber = @succ(%%flatdialognumber)
  until @equal(%%flatdialognumber,5)
exit

:array
dialog add,list,%%array,0,0,0,0
list clear,%%array
repeat
parse "%a;%b",%%split
%%remainder = @substr(%%split,@sum(@len(%a),2),@len(%%split))
if %a
list add,%%array,%a
%%split = %%remainder
end
until @null(%a)
exit


NodNarb
Back to top
View user's profile Send private message AIM Address
Skit3000
Admin Team


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

PostPosted: Sun Jan 12, 2003 6:55 pm    Post subject: Reply with quote

Hi Brandon,

Nice code you've got there! But I'm afraid I couldn't let it to change some things... Smile

Code:

rem Define your CLASS name here
%%Classname = TVDSDialog
option decimalsep,"."
option fieldsep,"|"
option scale,96

TITLE New Project Template

rem Click on the line below and press F2 to change the dialog...
DIALOG CREATE,New Project Template,-1,0,500,300,Dragdrop,Click,Resizable,Class %%classname
  DIALOG SHOW

rem Place here all the dialog elements which you want to check for
rem Mouseover events like this:
rem             BUTTON1|EDIT1
%%Mouseover =
rem If there is a Mouseover event, the name will be elementnameMOUSEOVER
gosub Mouseover Start

rem This you can use to make dialog elements look flat.
rem Use it like this:
rem            BUTTON1|EDIT1
%%flatdialog =
gosub Makeflat
 
:EVLOOP
wait event,0.1
  parse "%%event;%%dialog",@event(D)
  dialog select,%%dialog
goto %%event
 
:TIMER
gosub Mouseover Check
goto %%event

:CLICK
info Click event on dialog
goto evloop
   
:RESIZE
rem Place here your resize code like:
parse "%%height;%%width",@dlgpos(,HW)
info The height of this dialog is now %%height@cr()The width is %%width...
goto evloop
 
:DRAGDROP
if @null(%%dropfilescreate)
  list add,dropfiles,0,0,0,0
  %%dropfilescreate = true
  end

list clear,dropfiles
list dropfiles,dropfiles
goto evloop

:CLOSE
exit

 
rem ----------------Include in all code (100 lines below main code is my preference)-----

:mouseover start
if @null(%%mouseovercreate)
dialog add,list,mouseover,0,0,0,0
list add,mouseover,
%%mouseovercreate = true
end

repeat
parse "%a;%b",%%mouseover
%%remainder = @substr(%%mouseover,@sum(@len(%a),2),@len(%%mouseover))
if %a
list add,mouseover,%a|@winexists(@win(~%a))
%%mouseover = %%remainder
end
until @null(%a)
exit

:mouseover check
list seek,mouseover,0
:mouseloop
parse "%a;%b",@item(mouseover)
%%check = @winatpoint(@mousepos(X),@mousepos(Y))
if @equal(%%check,%b)
%%event = %a"MOUSEOVER"
%%mouseover = %a
goto mousedone
end
if @equal(@pred(@count(mouseover)),@index(mouseover))
if @null(%%mouseover)
else
%%lastmouseover = %%mouseover
%%mouseover = ""
end
goto mousedone
else
list seek,mouseover,@succ(@index(mouseover))
goto mouseloop
end
:mousedone
if @null(%%mouseover)
if %%lastmouseover
%%event = %%lastmouseover""MOUSEOUT
%%lastmouseover = ""
else
%%event = EVLOOP
end
end
exit

:Makeflat
%%temp1 = %%flatdialog
repeat
parse "%%flatdialog",%%temp1
%%temp1 = @strdel(%%temp1,1,@fadd(@len(%%flatdialog),0))
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"1",@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,l),2,@dlgpos(%%flatdialog,h)
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"2",@dlgpos(%%flatdialog,t),@diff(@fadd(@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w)),2),2,@dlgpos(%%flatdialog,h)
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"3",@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w),2
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"4",@diff(@fadd(@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,h)),2),@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w),2
  %%flatdialognumber = 1
  repeat
  DIALOG DISABLE,"BITBTN"%%flatdialog%%flatdialognumber
  %%flatdialognumber = @succ(%%flatdialognumber)
  until @equal(%%flatdialognumber,5)
until @equal(%%temp1,)

exit

:array
dialog add,list,%%array,0,0,0,0
list clear,%%array
repeat
parse "%a;%b",%%split
%%remainder = @substr(%%split,@sum(@len(%a),2),@len(%%split))
if %a
list add,%%array,%a
%%split = %%remainder
end
until @null(%a)
exit


BTW. Where is that Array label for???
Back to top
View user's profile Send private message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Sun Jan 12, 2003 7:12 pm    Post subject: Reply with quote

Cool beans Skit!

I like how you updated the flat buttons alot...and the option fieldsep...and how you made it to where people don't have to remember to initialze the mouseover...cool!

What I didn't like is you took out the special form handling code from the evloop...what that does is it makes certain the right dialog is selected...of course I forgot to comment on that before so it was probably difficult to tell. Here's an updated evloop.

Code:

  :EVLOOP
wait event,0.1
%%eventdialog = @event(d)
parse "%%event;%%dialog",%%eventdialog
rem Special timer handling for applications with multiple forms
if @equal(%%event,timer)
rem make certain the correct dialog is selected before entering the timer event like this
   rem dialog select,0
goto timer
end
dialog select,%%dialog
goto %%event


New ideals for gosubs in the include section especially appreciated!

NodNarb

PS After I get used to this code I will be removing the comments from my template...but the code here will remain commented.
Back to top
View user's profile Send private message AIM Address
Skit3000
Admin Team


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

PostPosted: Sun Jan 12, 2003 7:21 pm    Post subject: Reply with quote

It doesn't matter from which dialog you call the timer loop, it will always be the same (if I am right... Embarassed ), so the code unbeath should do the job...

Code:
:EVLOOP
wait event,0.1
%%eventdialog = @event(d)
parse "%%event;%%dialog",%%eventdialog
dialog select,%%dialog
goto %%event
Back to top
View user's profile Send private message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Sun Jan 12, 2003 10:53 pm    Post subject: Reply with quote

Well...that depends on how you look at it. If your code looks like this then your way is fine

Code:

:timer
dialog select,0
%%edit1 = @dlgtext(edit1)

:evloop
rem etc.


But if your code looks like this (like most of mine)
Code:

:timer
%%edit1 = @dlgtext(edit1)

:evloop
rem etc.


Then my way is better. Depends on your code style I guess Wink

NodNarb
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1711
Location: Space and Time

PostPosted: Tue Jan 14, 2003 6:45 pm    Post subject: Reply with quote

The mouseover code does not work with text and bitmaps.
Here is code that will work with all dialog elements.

You need to set the variable %%DlgTitle to 1 if you have a title
or NULL if you are not using a title.

Code:

rem Remember to set %%DlgTitle to 1 if your dialog has a title.

:mouseover start
   if @null(%%mouseovercreate)
      dialog add,list,mouseover,0,0,0,0
      list add,mouseover,
      %%mouseovercreate = true
   end
   repeat
      parse "%a;%b",%%mouseover
      %%remainder = @substr(%%mouseover,@sum(@len(%a),2),@len(%%mouseover))
      if %a
         list add,mouseover,%a
         %%mouseover = %%remainder
      end
   until @null(%a)
   exit

:Mouseover Check
   %%xyz = 0
   %%event =
   repeat
      %%item = @item(mouseover,%%xyz)
      if %%DlgTitle
         %y = @diff(@mousepos(y),22)
         %x = @diff(@mousepos(x),3)
      else
         %y = @mousepos(y)
         %x = @mousepos(x)
      end
      if @equal(1111,@greater(%x,@sum(@dlgpos(%%item,l),@dlgpos(,l)))@greater(@sum(@sum(@dlgpos(%%item,l),@dlgpos(%%item,w)),@dlgpos(,l)),%x)@greater(%y,@sum(@dlgpos(%%item,t),@dlgpos(,t)))@greater(@sum(@sum(@dlgpos(%%item,t),@dlgpos(%%item,h)),@dlgpos(,t)),%y))
         %%event = %%item"MOUSEOVER"
         %%lastmouseover = %%item
         %%mouseover = %%item
      end
      %%xyz = @succ(%%xyz)
   until @equal(%%xyz,@count(mouseover))
   if @null(%%event)
      if %%Lastmouseover
         %%event = %%Lastmouseover"MOUSEOUT"
         %%lastmouseover =
      else
         %%event = EVLOOP
      end
   end
   exit

_________________
Chris
Http://vdsfreak.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Tue Jan 14, 2003 7:30 pm    Post subject: Reply with quote

Thanks for pointing that out Chris! I didn't realize mine wasn't able to do bitmaps and text elements ;-(

Skit had already posted some code similar in a mouseover code thread but this is really good as well.

Only difference between the old one and the new one is the original works with with multiple dialogs (forms), but the new one works with text and bitmap elements! Guess it will depend on what the developer is doing...personally I'll probably have to use both scripts at one time or another.

More resources now though Wink

NodNarb
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Wed Jan 15, 2003 3:14 pm    Post subject: Reply with quote

I think i've finally got this refined the way I like it Wink Change to suit you individual needs of course!

Code:

gosub options

TITLE New Project Template

rem Click on the line below and press F2 to change the dialog...
DIALOG CREATE,New Project Template,-1,0,500,300,Dragdrop,Click,Resizable,Class TVDSDialog
  DIALOG SHOW

rem             BUTTON1|EDIT1
%%Mouseover =
rem If there is a Mouseover event, the name will be elementnameMOUSEOVER
gosub Mouseover Start
rem            BUTTON1|EDIT1
%%flatdialog =
gosub Makeflat

gosub Array
 
:EVLOOP
wait event,0.1
  parse "%%event;%%dialog",@event(D)
  dialog select,%%dialog
goto %%event
 
:TIMER
dialog select,0
gosub Mouseover Check
goto %%event

:CLICK
info Click event on dialog
goto evloop
   
:RESIZE
parse "%%width;%%height",@dlgpos(,WH)
goto evloop
 
:DRAGDROP
if @null(%%dropfilescreate)
  list add,dropfiles,0,0,0,0
  %%dropfilescreate = true
  end

list clear,dropfiles
list dropfiles,dropfiles
goto evloop

:CLOSE
exit

rem ----------begin gosubs----------



rem ---begin gosub---
:options
option decimalsep,"."
option scale,96
option fieldsep,"|"
exit
rem ---end gosub---
rem ---begin gosub---
:Mouseover Start
if @null(%%mouseovercreate)
dialog add,list,mouseover,0,0,0,0
list add,mouseover,
%%mouseovercreate = true
end

repeat
parse "%a;%b",%%mouseover
%%remainder = @substr(%%mouseover,@sum(@len(%a),2),@len(%%mouseover))
if %a
list add,mouseover,%a|@winexists(@win(~%a))
%%mouseover = %%remainder
end
until @null(%a)
exit
rem ---end gosub---
rem ---begin gosub---
:Makeflat
if @null(%%flatdialog)
exit
end
%%temp1 = %%flatdialog
repeat
parse "%%flatdialog",%%temp1
%%temp1 = @strdel(%%temp1,1,@fadd(@len(%%flatdialog),0))
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"1",@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,l),2,@dlgpos(%%flatdialog,h)
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"2",@dlgpos(%%flatdialog,t),@diff(@fadd(@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w)),2),2,@dlgpos(%%flatdialog,h)
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"3",@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w),2
  DIALOG ADD,BITBTN,"BITBTN"%%flatdialog"4",@diff(@fadd(@dlgpos(%%flatdialog,t),@dlgpos(%%flatdialog,h)),2),@dlgpos(%%flatdialog,l),@dlgpos(%%flatdialog,w),2
  %%flatdialognumber = 1
  repeat
  DIALOG DISABLE,"BITBTN"%%flatdialog%%flatdialognumber
  %%flatdialognumber = @succ(%%flatdialognumber)
  until @equal(%%flatdialognumber,5)
until @equal(%%temp1,)

exit
rem ---end gosub---
rem ---begin gosub---
:Array
if @null(%%array)
exit
else
end
dialog add,list,%%array,0,0,0,0
list clear,%%array
repeat
parse "%a;%b",%%split
%%remainder = @substr(%%split,@sum(@len(%a),2),@len(%%split))
if %a
list add,%%array,%a
%%split = %%remainder
end
until @null(%a)
exit
 
rem ---end gosub---
rem ---begin gosub---
:Mouseover Check
list seek,mouseover,0
:mouseloop
parse "%a;%b",@item(mouseover)
%%check = @winatpoint(@mousepos(X),@mousepos(Y))
if @equal(%%check,%b)
%%event = %a"MOUSEOVER"
%%mouseover = %a
goto mousedone
end
if @equal(@pred(@count(mouseover)),@index(mouseover))
if @null(%%mouseover)
else
%%lastmouseover = %%mouseover
%%mouseover = ""
end
goto mousedone
else
list seek,mouseover,@succ(@index(mouseover))
goto mouseloop
end
:mousedone
if @null(%%mouseover)
if %%lastmouseover
%%event = %%lastmouseover""MOUSEOUT
%%lastmouseover = ""
else
%%event = EVLOOP
end
end
exit
rem ---end gosub---



NodNarb
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1711
Location: Space and Time

PostPosted: Wed Jan 15, 2003 8:46 pm    Post subject: Reply with quote

As a work around for the bitmap mouseover, you can use a group the
same size as the bitmap (add it before the bitmap) and then use the
group as the mouseover.
I haven't fully tested this, but, it does work. This will not work for
all cases, but, it's a start.

There is also a "bug" in the mouse over code (both of them). If you
have 2 elements next to each other that have mouseovers, you
put the cursor over one then go right to the next, the MOUSEOUT
event is not created from the first one. I am trying to find a solution
for this. If anyone else finds a way, please post it.

Thanks,

_________________
Chris
Http://vdsfreak.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Tsunami1988
Contributor
Contributor


Joined: 15 Aug 2002
Posts: 70
Location: The Netherlands

PostPosted: Wed Jan 15, 2003 8:51 pm    Post subject: Reply with quote

LiquidCode wrote:
There is also a "bug" in the mouse over code (both of them). If you
have 2 elements next to each other that have mouseovers, you
put the cursor over one then go right to the next, the MOUSEOUT
event is not created from the first one. I am trying to find a solution
for this. If anyone else finds a way, please post it.

Thanks,

I think it's a logic thing that you don't get a MOUSEOUT event, because you're getting on another element, which creates a MOUSEOVER event Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Wed Jan 15, 2003 10:40 pm    Post subject: Reply with quote

I'm not at home right now...so I can't test this...but I think it will work.

Code:

if @equal(%%check,%b)
if @both(@not(@equal(%%mouseover,%a)),%%mouseover)
%%lastmouseover = %%mouseover
%%mouseover = ""
else
%%mouseover = %a
%%event = %a"MOUSEOVER"
end
goto mousedone


EDITED 4:55pm

NodNarb
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1711
Location: Space and Time

PostPosted: Thu Jan 16, 2003 12:33 am    Post subject: Reply with quote

Thanks, I didn't even see that... Wink Here is my code updated with
a variation of your fix.

Code:

:Mouseover Check
%%xyz = 0
%%event =
repeat
   %%item = @item(mouseover,%%xyz)
   if @equal(%%DlgTitle,NOTITLE)
      %y = @mousepos(y)
      %x = @mousepos(x)
   else
      %y = @diff(@mousepos(y),22)
      %x = @diff(@mousepos(x),3)
   end
   if @equal(1111,@greater(%x,@sum(@dlgpos(%%item,l),@dlgpos(,l)))@greater(@sum(@sum(@dlgpos(%%item,l),@dlgpos(%%item,w)),@dlgpos(,l)),%x)@greater(%y,@sum(@dlgpos(%%item,t),@dlgpos(,t)))@greater(@sum(@sum(@dlgpos(%%item,t),@dlgpos(%%item,h)),@dlgpos(,t)),%y))
      if @both(@not(@equal(%%item,%%lastmouseover)),%%lastmouseover)
      else
         %%event = %%item"MOUSEOVER"
         %%lastmouseover = %%item
      end
   end
   %%xyz = @succ(%%xyz)
until @equal(%%xyz,@count(mouseover))
if @null(%%event)
   if %%Lastmouseover
      %%event = %%Lastmouseover"MOUSEOUT"
      %%lastmouseover =
   else
      %%event = EVLOOP
   end
end
exit

_________________
Chris
Http://vdsfreak.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
GeoTrail
Valued Contributor
Valued Contributor


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

PostPosted: Fri Feb 21, 2003 2:07 am    Post subject: Speaking of code templates... Reply with quote

I know I'm way out of my league here... Laughing
Anyways, guess we all should have our own template that we use to keep things clean.

I just started on my own template:
Code:
rem ****************************************************************************
rem *  Code template created by Robert Olsen.
rem *  Created for VDS v4.50
rem *  Date created: 27.02.2003 02:33 CET
rem *  Last updated: 27.02.2003 02:33 CET
rem ****************************************************************************

%%AppTitle = AppName goes here
%%AppVer = 1.00
%%AppBuild = 001
%%Copyright = Copyright (c) 2003 GeoTrail Corporation

DIALOG CREATE,New Dialog,-1,0,240,160
REM *** Modified by Dialog Designer on 21.02.2003 - 02:43 ***
  DIALOG ADD,TEXT,TEXT1,53,61,,,This is a test.
  DIALOG SHOW


:Evloop
  wait event, 0.1
  goto @event()

rem End of script.
:Close
  Exit


I just started this. And I figured it might be a good idea to add the 0.01 to the event to slow down the CPU usage. I've seen that mentioned in another post. Anyways, I get this message when trying to run it: "Invalid parameter to command"

Why can't I use 0.1 in the wait command?

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1537

PostPosted: Fri Feb 21, 2003 2:16 am    Post subject: Reply with quote

wait event, 0.1


When you use that code it causes a :TIMER event to trigger at every 0.1 seconds. Just put wait event and it will sit on that line automatically till any event occurs. If you really want the :TIMER event to trigger you'll definately need to put something like this in your code:

:TIMER
rem do whatever here
goto evloop
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


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

PostPosted: Fri Feb 21, 2003 2:27 am    Post subject: Reply with quote

Oh, OK. Didn't know that Embarassed

Thanks Embarassed

_________________
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 3 Source Code All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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