|
|
|||||||
Hi, Apologies for the really stupid question. It's been a long while since I last did any kixtart work. I don't know if I'm remembering this correctly but was there a command which will bring up a dialogue box in Windows to accept input from the user (a string of characters) ? I immediately remembered the MessageBox function but then also remembered that this only displays different buttons for the user to click on. Was there one similar to MessageBox but which allows the user to type the answer to a question (for instance) ? Thanks |
||||||||
|
|
|||||||
A real GUI box is not available in kixtart. You can use GET and GETS that both take input from the command line but if you really want a GUI box then you can do this with kixforms. |
||||||||
|
|
|||||||
Don't listen to Mart Here's some code: Code: Function InputBox($strPrompt, Optional $strTitle, $strDefaultValue) Dim $objSC $objSC = CreateObject("ScriptControl") $objSC.Language = "VBScript" $InputBox = $objSC.Eval('InputBox("'+$strPrompt+'","'+$strTitle+'","'+$strDefaultValue+'")') EndFunction $=InputBox("Enter your input","This is a title") ? "You've put in: "+$ |
||||||||
|
|
|||||||
LOL Not realy kixtart. You use some VB stuff in your example. |
||||||||
|
|
|||||||
Well all the code is native kix |
||||||||
|
|
|||||||
Excellent Thanks.... shame Kix doesn't have a small text box like that itself. |
||||||||
|
|
|||||||
It does - it's called "kixforms". (www.kixforms.org). Requires a DLL to be registered, but the power is awesome! It not only provides a GUI, but allows cool things like network Socket communications, timed events, and math functions. Glenn |
||||||||
|
|
|||||||
Yep, well aware of Kixforms. I didn't really want to do it that way as it is for such a tiny little script. One question to the user, they enter the relevant info which is stored in a variable. We do one thing with the variable and script ends. Might have been a bit bloated to use Kixforms. |