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 


General Help With VDS5

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DW
Contributor
Contributor


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Tue Dec 21, 2004 9:53 am    Post subject: General Help With VDS5 Reply with quote

Just some general questions.

1. Whats is the best method of handling child dialogs? At the moment i create a dialog and then hide it before creating the child.
Is this a good or bad way of handling them? Should I use a way like the one in the example files that come with VDS?

2. Functions and commands, whats the difference? and how do I make functions/commands that return one or more values to another section of the script. Global variables. Also can you make function variables only that dont leak in to the script?

3. if and end functions, if i run an if condition which then goes to another labels mid function, whats the best way to make sure the if it is ended.

4. Lists, whats the best way to manage hidden lists and how do you make sure a list is closed eeven when caused to goto another label mid function?

5. include files, whats the best way to use this feature? Right now i have been using them to split the script up into sections. Is their more power in them?

6. resources, whats the best way to include the icos, bmps, etc into the exe? I find that when i use the resource command i cant run the script unless its compiled because the resources are not found.

7. Edit eliments, how can i make it so that only x number of chars can be entered? Also is their a way to limit the input, to say no symbols, etc?

Can anyone help me work this all out?
Thank you.
Back to top
View user's profile Send private message
Skit3000
Admin Team


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

PostPosted: Tue Dec 21, 2004 11:37 am    Post subject: Reply with quote

Here are the ones I knew from the head... Smile

  1. You can first create the main dialog, without the "DIALOG SHOW" command, and then create the child windows. This way, you can close the windows without closing your program itself.

  2. The different between functions and commands is that commands don't return a value, functions do. A function can be spotted by the @functionname()-syntax. All other things like "list" and "dialog" are commands. If you want to use global variables within functions, just use variables which have two %-characters. All single-% variables can only be used in the function itself.

  3. -

  4. Just put a "list close,<number>" before the actual GOTO command.

  5. If I have a large script with multipy dialogs, I put every dialog (with all its labels) into a new dsc file. I also put functions and commands in another file, so that I can easily find the code I want.

  6. -

  7. -


_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
DW
Contributor
Contributor


Joined: 21 Mar 2003
Posts: 175
Location: UK

PostPosted: Tue Dec 21, 2004 3:42 pm    Post subject: Reply with quote

with regards to number 1

Code:
Title test
DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,67,99,,,BUTTON1

 
  :child
  DIALOG CREATE,child,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,67,99,,,child
  DIALOG SHOW
:Evloop
  wait event
  goto @event()
:BUTTON1BUTTON
 :Close
  exit


if i have this example and i run it, i see the child but no main dialog. now how would i close the child and open the main dlg?
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Dec 21, 2004 5:40 pm    Post subject: Reply with quote

Just execute the DIALOG SHOW.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Fri Dec 24, 2004 11:16 pm    Post subject: Reply with quote

I deal with #3 like this:

Code:


:EvLoop
  wait event
  goto @event

:Test_A
  %g = evloop
  if %x
    rem do something
    %g = label_a
  end
  goto %g

:LABEL_A
  info percentx was true
  goto evloop



Good luck...
Hooligan

_________________
Hooligan

Why be normal?
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
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