| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 18, 2003 2:56 am Post subject: cancel button question |
|
|
hello all
When i have it ask a user for input and if they hit the cancel button my program keeps running it don't stop what i'am doing wrong or missing
| Code: |
%%P1 = @input(Enter your name : ,User)
|
thanks |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Feb 18, 2003 4:08 am Post subject: |
|
|
Try something like this:
| Code: |
%%P1 = @input(Enter your name : ,User)
if @not(%%P1)
goto EVLOOP
end
|
Cheers, Mac  _________________ 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 |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 18, 2003 4:16 am Post subject: hummm |
|
|
but i don't have a evloop in my script  |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Feb 18, 2003 4:19 am Post subject: |
|
|
Well... the point is to check if you have user input or not,
you can do whatever ya want from there. If you insist
on getting user input, put a label above the @input() and
keep sending it back there...
| Code: |
:GetInfo
%%P1 = @input(Enter your name : ,User)
if @not(%%P1)
goto GetInfo
end
|
Or ya can have the program exit or whatever...
Cheers, Mac  _________________ 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 |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 18, 2003 4:24 am Post subject: hummm |
|
|
but the cancel button still don't work  |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Feb 18, 2003 4:27 am Post subject: |
|
|
C'mon Tim - what do ya want it to do if the user hits CANCEL? _________________ 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 |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 18, 2003 4:29 am Post subject: |
|
|
exit the script
sorry i should have said that |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Feb 18, 2003 4:30 am Post subject: |
|
|
OK - my bad. Since ya have "User" as the default, ya gotta
check for that, as well as no value...
| Code: |
%%P1 = @input(Enter your name : ,User)
if @not(%%P1) @equal(%%P1, "User")
EXIT
end
|
Cheers, Mac  _________________ 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 |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 18, 2003 4:34 am Post subject: hummm |
|
|
hummm unless i'am missing something here Cancel still does not exit the script  |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Feb 18, 2003 4:38 am Post subject: |
|
|
OK - check the example again, I edited it right after I posted it.
If this is in a subroutine, you'll have to use "goto CLOSE" or
something. You should always have a CLOSE label - this is what
Windows looks for to close the program at shutdown, etc.
Cheers, Mac  _________________ 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 |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 18, 2003 5:48 am Post subject: cool |
|
|
thanks that seems to work
question what s/w you guys used to make icons for vds?
thanks |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 18, 2003 6:08 am Post subject: hummm |
|
|
humm
well i thought it was working but now no mater if i hit ok or cancel it stops the script  |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Feb 18, 2003 6:30 am Post subject: |
|
|
Just follow Mac's lead - he knows what he's doing..
Try something like this:
| Code: |
:LABEL
%%P1 = @input(Enter your name : ,User)
if @not(%%P1)@equal(%%P1, "User")
INFO Exiting..
goto CLOSE
else
goto DOSOME
end
:CLOSE
EXIT
:DOSOME
INFO Name entered..
|
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 18, 2003 7:04 am Post subject: kk |
|
|
| question when someone enter a name into the text box but the next question they are asked to enter a file name how can one check to make sure the file ext is enter in the text box to and if they don't enter the file ext have vds added it..can this be done? |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Feb 18, 2003 8:28 am Post subject: |
|
|
Sure thing.
You have your filename in a variable, so you just evaluate the filename to check if it matches your
requirements:
For example (filename in variable %%file):
| Code: |
%%file = myname.tx
REM Let's say you want to force the .TXT extension
if @equal(@ext(%%file),txt)
REM Required file extension OK - go do your stuff
goto SOMELABEL
else
REM No extension or not the right one
%%file = @name(%%file)".txt"
Info %%file
end
|
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
|