Jump to content

Loop back and keep data


Jackized
 Share

Recommended Posts

Is there a way to loop back to the beginning and keep the already entered data in the GUI Input boxes? I can GUIDelete and start a new GUI but all the typed data has to be redone. Here is a sample.


 

#Include <GuiConstants.au3>

Dim $msg,$okbutton,$cancelbutton,$objOU,$intAccValue,$strGroup1,$strGroup2
Dim $strFirstName,$strLastName,$strUserName,$strUserName2,$strPassword,$strDescription,$strContainer
Dim $Combo,$Duration


Do

$Form1 = GuiCreate("", 300, 300)
         GUISetBkColor(0xA6CAF0)

        GuiCtrlCreateLabel("First Name:", 50, 10)
        $strFirstName = GuiCtrlCreateInput("", 50, 25, 200, 20)

        GUICtrlSetState ( $okbutton, $GUI_FOCUS )
        GuiSetState()

    $okbutton = GUICtrlCreateButton ("OK",75,240,50,20)
    $cancelbutton = GUICtrlCreateButton ("Cancel",175,240,50,20)

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton
            Exit
    Case $msg = $okbutton
            $strFirstName = GUICtrlRead($strFirstName)
            ExitLoop
    EndSelect
Wend


$len = StringLen($strFirstName)

    If $len > "20" then
        MsgBox(0, "ERROR Name to long", $strFirstName & " can't be over 20 characters." & @CRLF & "Total: " & $len)
        ;Exit
        GUIDelete($Form1)
    EndIf

Until $len < "20"

MsgBox(0, "Done", "")

 

Edited by Jos
added codebox
Link to comment
Share on other sites

REad the input to a variable..

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

#Include <GuiConstants.au3>

Dim $msg,$okbutton,$cancelbutton,$objOU,$intAccValue,$strGroup1,$strGroup2
Dim $strFirstName,$strLastName,$strUserName,$strUserName2,$strPassword,$strDescription,$strContainer
Dim $Combo,$Duration



  $Form1 = GuiCreate("", 300, 300)
         GUISetBkColor(0xA6CAF0)

        GuiCtrlCreateLabel("First Name:", 50, 10)
        $strFirstName = GuiCtrlCreateInput("", 50, 25, 200, 20)

    $okbutton = GUICtrlCreateButton ("OK",75,240,50,20)
    $cancelbutton = GUICtrlCreateButton ("Cancel",175,240,50,20)

        GUICtrlSetState ( $okbutton, $GUI_FOCUS )
        GuiSetState()


While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton
            Exit
    Case $msg = $okbutton
            $strFirstName = GUICtrlRead($strFirstName)
         $len = StringLen($strFirstName)

        If $len < "20" then ExitLoop
        MsgBox(0, "ERROR Name to long", $strFirstName & " can't be over 20 characters." & @CRLF & "Total: " & $len)
    EndSelect
Wend


MsgBox(0, "Done", "")

 

Link to comment
Share on other sites

There, the OP doesn't even have to try.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Link to comment
Share on other sites

  • Moderators
12 hours ago, Nine said:

ya and ty

"REad the input to a variable.."

was sooo helpful !

Since this forum operates on the "Teach a Man to Fish" motto rather than simply barfing up code without any explanation for a new coder, neither was terribly helpful. Rather than responding to every last jibe, how about focusing on helping people improve their coding abilities rather than spoon-feeding them, as I assume that is why you're here.

"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

You're correct, sadly i had my child on my lap, she was messing with the keyboard and that was the only thing i could write at the moment.

I wanted to add more to my answer, but when i came back to edit there was no longer need for it.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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

×
×
  • Create New...