kelp7
(Starting to like KiXtart)
2015-03-25 09:48 AM
User input

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


Mart
(KiX Supporter)
2015-03-25 10:13 AM
Re: User input

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.

Arend_
(MM club member)
2015-03-25 10:39 AM
Re: User input

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: "+$


Mart
(KiX Supporter)
2015-03-25 10:47 AM
Re: User input

LOL

Not realy kixtart. You use some VB stuff in your example.


Arend_
(MM club member)
2015-03-25 10:48 AM
Re: User input

Well all the code is native kix ;\)

kelp7
(Starting to like KiXtart)
2015-03-25 11:57 AM
Re: User input

Excellent \:\) Thanks.... shame Kix doesn't have a small text box like that itself.

Glenn BarnasAdministrator
(KiX Supporter)
2015-03-25 02:39 PM
Re: User input

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


kelp7
(Starting to like KiXtart)
2015-03-25 03:01 PM
Re: User input

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.