Jump to content

Using input from GUI Form


JonMay
 Share

Recommended Posts

Hello all,

I'm quite new, and have worked through a couple of the tutorials mentioned on the forum, so I hope I know enough to explain the problem I'm up against.

The outcome of the script is that someone enters the login initials, old asset number and new asset number into a form, then the script runs tasks to copy files and config files from the old PC (networked as \\$login-$oldassetnumber\d$) to the new one (networked as \\$login-$newassetnumber\d$)

The two problems I'm having is:

a) getting the process button to do anything (I'm unsure on how to get it to progress to finish the script holding what's been inputted in memory)

:P re-calling the tags if the first problem could be resolved, that I intend to use in the rest of the script.

What I've got so far:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$Label1 = GUICtrlCreateLabel("User Login:", 200, 160, 58, 17)
$Login = GUICtrlCreateInput("", 280, 160, 121, 21)
$OldAsset = GUICtrlCreateInput("", 280, 208, 121, 21)
$Label2 = GUICtrlCreateLabel("Old Asset", 200, 208, 49, 17)
$NewAsset = GUICtrlCreateInput("", 280, 256, 121, 21)
$Label3 = GUICtrlCreateLabel("New Asset", 200, 256, 55, 17)
$Label4 = GUICtrlCreateLabel("PC Rollout", 224, 80, 156, 41)
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("v1.0.0 - JWM", 544, 408, 68, 17)
$ProcessButton = GUICtrlCreateButton("Go!", 256, 376, 75, 25, 0)
$Pic1 = GUICtrlCreatePic("D:\Data\logo_iopp.gif", 192, 2, 210, 34, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd



FileCopy("\\"&$Login&"-"&$OldAsset&"\d$\apps\notes\data\user.id","\\"&$Login&"-"&$NewAsset&"\d$\apps\notes\data\user.id")

Any help you guys could give would be greatly appreciated.

Thanks!

Link to comment
Share on other sites

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$Label1 = GUICtrlCreateLabel("User Login:", 200, 160, 58, 17)
$Login = GUICtrlCreateInput("", 280, 160, 121, 21)
$OldAsset = GUICtrlCreateInput("", 280, 208, 121, 21)
$Label2 = GUICtrlCreateLabel("Old Asset", 200, 208, 49, 17)
$NewAsset = GUICtrlCreateInput("", 280, 256, 121, 21)
$Label3 = GUICtrlCreateLabel("New Asset", 200, 256, 55, 17)
$Label4 = GUICtrlCreateLabel("PC Rollout", 224, 80, 156, 41)
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("v1.0.0 - JWM", 544, 408, 68, 17)
$ProcessButton = GUICtrlCreateButton("Go!", 256, 376, 75, 25, 0)
$Pic1 = GUICtrlCreatePic("D:\Data\logo_iopp.gif", 192, 2, 210, 34, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $ProcessButton
        $UserId = GUICtrlRead($Login)
        $oAssetId = GUICtrlRead($OldAsset)
        $nAssetId = GUICtrlRead($NewAsset)
               ; Build your Copy command using the Variables Read above
           ; FileCopy("\\"&$Login&"-"&$OldAsset&"\d$\apps\notes\data\user.id","\\"&$Login&"-"&$NewAsset&"\d$\apps\notes\data\user.id")
    EndSwitch
WEnd

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