Jump to content

Store user-input interactively


 Share

Recommended Posts

I want to prompt the user if the system is 32 or 64 bit (probably using a Msgbox) and store the input in a variable and proceed

How can I do that ?

Is MsgBox the only option to do it ? Any Alternative ?

(I do not want to add additional inputbox in my GUI for this)

Link to comment
Share on other sites

Thanks Jos,

I see that ita a macro but how do I use that?

Also OS Archicture is not my only problem, I need to take several input from user interactively (without cluttering the GUI with checkbox, inputbox, etc )

Any other way of achieving this?

Link to comment
Share on other sites

  • Moderators

As far as @OSArch, something like this:

If @OSArch = "X86" Then
   ;Do something
Else
   ;Do something else
EndIf

Regarding your other problems, it would help a whole lot if you spelled out what they are. But with the limited info, the best way would be an InputBox. Something akin to this:

$answer1 = InputBox("Test", "What is your name?")

If $answer1 = "Bob" Then
    MsgBox(0, "", "Good morning, Bob!")
ElseIf $answer1 = "Sally" Then
    MsgBox(0, "", "Hi Sally!")
Else
    MsgBox(0, "", "I don't know you, " & $answer1 & ". You're not getting in!")
EndIf
Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

THANKS JLogan3o13

I want to avoid any additional inputbox in the GUI and hence the problem

These are the options I am trying to fetch from user

1) install on 32 or 64 bit ?

2) install on platform XP or Win7

3) install server or client  version?

4) Install full or demo version ?

Regards,

sumitd

Link to comment
Share on other sites

  • Moderators

Well, Jos gave you the @OSArch macro. Did you look at the help file for a macro to find XP or WIN7?

As for #s 3 and 4, you're going to have to do either an InputBox or a MsgBox to gather the info. Either way, the basic structure I gave you is the same:

1. Create a variable to store the InputBox or MsgBox return

2. Create an If..Then statement to handle what you do with the possible return values.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

@JLogan3o13,

Yes the macro works fine. (Thanks for that)

For #2,3 & 4, My original question still remains, How do I store the MsgBos return in a variable

(Also it seems MsgBox supports inputs like OK, Cancel or their combination) Can I create custom MsgBox buttons and store the user input in a variable ? (After this step, if-else will work fine)

Link to comment
Share on other sites

  • Developers

MsgBox() doesn't have an option to request and return a user requested input field, other than the Button they pressed like Yes/No/Ok/Cancel.

You either need to use InputBox() or build you own GUI. The helpfile contains much information and many examples to get you started.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

Once again, there is a macro for #2 to show you whether the system is XP or WIN7, I'm looking to you to crack open the help file and look for it ;)

Also as I said, you would simple make the Msgbox a variable, and get its return value. The help file explains this.

Yes, you can build a custom GUI, or use Melba's ExtMsgBox UDF to create a unique MsgBox.

 

Edit: Too slow, Jos is on fire this morning :)

Edit 2: Melba's UDF - http://www.autoitscript.com/forum/index.php?showtopic=109096

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...