I need to know how to make the cancel button do what i want. I am not tp good with VB yet just learning but here is what i have:
Vbstart
Function GetSerNum
GetSerNum = InputBox("Enter Your Serial Number : ")
End Function
vbend
VBEval>GetSerNum,sernum
///rest of script
I just copyed the example from the Vbsample script so i don;t know how to program button to do what i want them to do. Any help thanks.
Vb Cancel button
Moderators: Dorian (MJT support), JRL
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
From the VBScript documentation:
"If the user clicks OK or presses ENTER, the InputBox function returns whatever is in the text box. If the user clicks Cancel, the function returns a zero-length string ("")."
So, you can just check for an empty string:
Vbstart
Function GetSerNum
GetSerNum = InputBox("Enter Your Serial Number : ")
End Function
vbend
VBEval>GetSerNum,sernum
If>{%sernum%=""}
MessageModal>Nothing was entered
Endif
Get the VBScript documentation from:
http://www.mjtnet.com/resources.htm
"If the user clicks OK or presses ENTER, the InputBox function returns whatever is in the text box. If the user clicks Cancel, the function returns a zero-length string ("")."
So, you can just check for an empty string:
Vbstart
Function GetSerNum
GetSerNum = InputBox("Enter Your Serial Number : ")
End Function
vbend
VBEval>GetSerNum,sernum
If>{%sernum%=""}
MessageModal>Nothing was entered
Endif
Get the VBScript documentation from:
http://www.mjtnet.com/resources.htm