Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 09-27-2012, 05:30 PM
garyb@se.rr.com garyb@se.rr.com is online now
Registered User
 
Join Date: 02-19-2004
Location: Saint Augustine, FL
Posts: 21
Question Return value of InputBox

I am curious... if you present an inputbox in a vbscript to the user, how do you determine if the Cancel button of the inputbox was clicked?

I would like to abort the build process if the Cancel button is clicked on the inputbox.

Perhaps there is a better method?

dim sTemp
dim objMacro

sTemp = InputBox("Do you want to transmit ActiveX32 to the FTP site?","Transmit File","NO")
Set objMacro = vbld_TempMacros.Add("FTPActivex", sTemp)


Any help is appreciated.
Reply With Quote
  #2  
Old 09-27-2012, 09:52 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
I would probably use the Shell Popup method for that, or check for an empty string returned from InputBox. See the Prompt.bld sample.
http://kinook.com/VisBuildPro/Manual/promptsample.htm
Reply With Quote
  #3  
Old 09-28-2012, 07:49 AM
garyb@se.rr.com garyb@se.rr.com is online now
Registered User
 
Join Date: 02-19-2004
Location: Saint Augustine, FL
Posts: 21
Quote:
Originally Posted by kinook View Post
I would probably use the Shell Popup method for that, or check for an empty string returned from InputBox. See the Prompt.bld sample.
http://kinook.com/VisBuildPro/Manual/promptsample.htm
Thank you for the info. I looked through the recommended sample project however it does not tell me if the inputbox cancel button was clicked and that is what I am trying to determine.

I already define a default value for the inputbox, so the script can deal with yes or no answers, but if the cancel is clicked I want to abort the project build. Is this possible?
Reply With Quote
  #4  
Old 09-28-2012, 07:53 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
It will return an empty string if canceled.
http://www.w3schools.com/vbscript/func_inputbox.asp

To fail the build from script code, use Step.BuildStatus = vbldStepStatFailed
Reply With Quote
  #5  
Old 09-28-2012, 10:28 AM
garyb@se.rr.com garyb@se.rr.com is online now
Registered User
 
Join Date: 02-19-2004
Location: Saint Augustine, FL
Posts: 21
Quote:
Originally Posted by kinook View Post
It will return an empty string if canceled.
http://www.w3schools.com/vbscript/func_inputbox.asp

To fail the build from script code, use Step.BuildStatus = vbldStepStatFailed
Got it! That worked... Thank you.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 01:56 PM.


Copyright © 1999-2023 Kinook Software, Inc.