Jump to content

input


spuri
 Share

Recommended Posts

I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. :mellow: How could I get Input1 value?

...
$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)
...
$project = GUICtrlRead($Input1)
Msgbox(0,"test",  $project )
Msgbox(0,"test",  $Input1 )
...
Edited by spuri
Link to comment
Share on other sites

I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. :mellow: How could I get Input1 value?

...
$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)
...
$project = GUICtrlRead($Input1)
Msgbox(0,"test",  $project )
Msgbox(0,"test",  $Input1 )
...
GuiCtrlRead is the proper function for capturing GUI input. Post the whole script and we can help find the problem.
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
Link to comment
Share on other sites

I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. :mellow: How could I get Input1 value?

...
 $Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)
 ...
 $project = GUICtrlRead($Input1)
 Msgbox(0,"test",  $project )
 Msgbox(0,"test",  $Input1 )
 ...
Use the included inputbox function and then you will not need the GUICtrlRead to read the value of your inputbox.

$input1 = InputBox("Blank input","Input something here:",'','','', 28, 125, 345, 22)

MsgBox(0,'',$input1)

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Link to comment
Share on other sites

Kerros is right :

$input1 = InputBox("Blank input","Input something here","The text you want to read","","", 28, 125, 345, 22)

MsgBox(0,"Read InputBox","The text write in inputbox is :"&$input1)

Just use the constant of your inputbox

Link to comment
Share on other sites

thanks inputbox works with Kerros's example butnot with GUICtrlCreateInput

$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)

I would like to xcopy d:\templateclient\tempproj dir to D:\{selected-dir-client}\tempproj

full code

#Region ### START Koda GUI section ### Form=c:\program files\autoit3\forms\mb01.kxf
$Form1 = GUICreate("Project-R", 413, 305, 272, 188)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetIcon("D:\81.ico")
$PageControl1 = GUICtrlCreateTab(8, 8, 396, 256)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("New Project")
$Button2 = GUICtrlCreateButton("Create Project", 272, 208, 75, 25, 0)
    GUICtrlSetOnEvent(-1, "NewClientClick")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Combo1 = GUICtrlCreateCombo("", 36, 77, 337, 25)
    GUICtrlSetOnEvent(-1, "Combo1Change")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

;---problem2---- !!!!!!!!!!!!!!!
GUICtrlCreateInput("", 40, 168, 337, 22)

GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$TabSheet2 = GUICtrlCreateTabItem("New Client")

;---problem2----
$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)

GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateTabItem("")

$Exit = GUICtrlCreateButton("&Exit", 318, 272, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Exitclick")

$input11 = InputBox("Blank input","Input something here:",'','','', 28, 125, 345, 22)



GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1                 
    Sleep(100)
WEnd


;------------------------------------Backup Button Function-------------------------------------------
Func NewClientClick()
    $client = GUICtrlRead($Combo1)
    $project = GUICtrlRead($Input1)

        Msgbox(0,$project,  $client )

EndFunc
;-------------------------------------End of Backup Button Function------------------------------------------
Edited by spuri
Link to comment
Share on other sites

thanks inputbox works with Kerros's example butnot with GUICtrlCreateInput

$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)

GuiCtrlRead($Input1);Read the input

I would like to xcopy d:\templateclient\tempproj dir to D:\{selected-dir-client}\tempproj

DirCopy("D:\templateclient\tempproj","D:\"&GuiCtrlRead($Input1)&"\tempproj",flag)
Edited by FireFox
Link to comment
Share on other sites

You are right but I need to copy ACL so probably xcopy is the answer and I still can not get the $Input1 value.

why this does not work?

Func NewClientClick()
    $project = GUICtrlRead($Input1)
    Msgbox(0,'test',  $project )
EndFunc

I get this

Posted Image

should this variable be global?

Edited by spuri
Link to comment
Share on other sites

You are not looking at the right input box. In your code, the input you are looking for is on line 39. If you delete line 44, and assign input on line 39 to $Input1 [e.g., $Input1 = GUICtrlCreateInput("", 40, 168, 337, 22)], everything works OK.

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...