Hello at all (first of all sorry for my bad english ;-) )
At the moment i want to greate a menu with diffrents function to help me at work. But i have 2 Problem (i post my code below)
You cann see i create a Menu and call this function. At the moment i try to code my Button3 (Move IFMS).
You have to know, for 3 of 5 Buttons/executable i need a putty conection so i create a function initial_putty (here i have some input options Server, User, Password).
I want to call function this function in every function of the buttons (to inital my putty window)
Well, if i press my Button3 it jumps to my function moveifms (i delete the code from moveifms for a better overview). This function call my putty_inital_putty. Now i have 2 Problems
First problem: You can see i create a OK Button. If my input is done i want press OK Button, save the input in variables and close my Gui and go back to the caller function (move_ifms).
In for examble shell skripts i have the option break; to go back.
Can someone help me out? Is this a bad code idea? How i can save my input and go back to moveifms?
Best Regards
;Includes
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <File.au3>
#include <Array.au3>
#include <MsgBoxConstants.au3>
#include <EditConstants.au3>
Func initial_putty()
Global $mhost = "", $muser = "", $mpassword = "";
Local $msg
$puttygui = GUICreate("Initial Connect", 200, 200)
Local $Button1 = GUICtrlCreateButton("OK", 50, 150, 90, 30)
Local $Button2 = GUICtrlCreateButton("Cancel", 120, 150, 90 ,30)
GUICtrlCreateLabel("Hostname:", 10, 10, 100)
GUICtrlCreateLabel("Username:", 10, 50, 100)
GUICtrlCreateLabel("Password:", 10, 75, 100)
GUISetState()
$mhost = GUICtrlCreateInput("", 75, 5, 100, 20)
$muser = GUICtrlCreateInput("", 75, 50, 100, 20)
$mpassword = GUICtrlCreateInput("", 75, 75, 100, 20)
ExitLoop
EndFunc
func moveifms()
;Here was some code but i delete better overview<----
initial_putty()
EndFunc
func Menu()
;Variables for func Menu:
Local $iMsg
Local $iGUIWidth = 120, $iGUIHeight = 450
; Aufbau der Gui
Local $windows = GUICreate ("SAP Helper GUI", $iGUIWidth, $iGUIHeight)
Local $FileMenu = GUICtrlCreateMenu("File")
Local $idExitItem = GUICtrlCreateMenuItem("Exit", $FileMenu)
Local $HelpMenu = GUICtrlCreateMenu("?")
Local $idAboutItem = GUICtrlCreateMenuItem("About", $HelpMenu)
;Aufbau der Buttons
;Breite; Höhe GuiFenster; Länge des Button; Höhe des Button
Local $Button1 = GUICtrlCreateButton("Plan Jobs", 5, 25, 90, 30)
Local $Button2 = GUICtrlCreateButton("Switch Kernel", 5, 65, 90, 30)
Local $Button3 = GUICtrlCreateButton("Move IFMS File", 5, 105, 90, 30)
Local $Button4 = GUICtrlCreateButton("Change Pass.", 5, 145, 90, 30)
Local $Button5 = GUICtrlCreateButton("Exit", 5, 400, 90, 30)
GUISetState(@SW_SHOW)
;Starte Menu
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $idExitItem
ExitLoop
Case $idAboutItem
MsgBox($MB_SYSTEMMODAL, "About", "GUI Menu Test")
Case $Button1
PlanJobs()
Case $Button2
switchkernel()
Case $Button3
moveifms()
Case $Button4
changepass()
Case $Button5
MsgBox($MB_SYSTEMMODAL, "Bye, bye", "Programm will timeout after 5 seconds or select the OK button.", 5)
ExitLoop
EndSwitch
WEnd
EndFunc
Menu()