Sign in to follow this  
Followers 0
GersonSevero

How to input number and save for use after

2 posts in this topic

I'm making a program for automate simulations on a software of civil engineering. I need to input a certain of number in the input box, after that I need to use that number in another actions. Help to do that. 

Thanks

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=d:\gerson\desktop\tcc automação\autoit programaÇÃo\testes\layautosim.kxf
$dlgTabbed = GUICreate("AutoSim", 401, 455, 277, 10)
$MenuItem4 = GUICtrlCreateMenu("&Programa")
$MenuItem5 = GUICtrlCreateMenuItem("Salvar", $MenuItem4)
$MenuItem6 = GUICtrlCreateMenuItem("Salvar Como...", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Abrir", $MenuItem4)
$MenuItem3 = GUICtrlCreateMenu("&Editar")
$MenuItem2 = GUICtrlCreateMenu("&Ajuda")
$MenuItem1 = GUICtrlCreateMenu("&Sobre")
GUISetIcon("", -1)
$PageControl1 = GUICtrlCreateTab(16, 64, 376, 368)
$Estrutura = GUICtrlCreateTabItem("Camada 1")
$Label1 = GUICtrlCreateLabel("Camada 1", 56, 96, 72, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
$Label2 = GUICtrlCreateLabel("Espessura (cm)", 24, 128, 96, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label3 = GUICtrlCreateLabel("Inicial", 56, 152, 30, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label4 = GUICtrlCreateLabel("Final", 160, 152, 26, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label5 = GUICtrlCreateLabel("Passo", 232, 152, 34, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 32, 176, 81, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 136, 176, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 224, 176, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label8 = GUICtrlCreateLabel("Módulo de Resiliência (MPa)", 24, 216, 170, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
GUICtrlCreateInput("", 29, 272, 81, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label9 = GUICtrlCreateLabel("Inicial", 53, 248, 30, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label10 = GUICtrlCreateLabel("Final", 157, 248, 26, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 133, 272, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label11 = GUICtrlCreateLabel("Passo", 229, 248, 34, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 221, 272, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Modelo = GUICtrlCreateTabItem("Camada 2")
$Label6 = GUICtrlCreateLabel("Camada 2", 48, 97, 72, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
$Label7 = GUICtrlCreateLabel("Espessura (cm)", 31, 133, 96, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label12 = GUICtrlCreateLabel("Inicial", 73, 156, 37, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 49, 180, 81, 20, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label13 = GUICtrlCreateLabel("Final", 177, 156, 31, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 153, 180, 65, 20, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label14 = GUICtrlCreateLabel("Passo", 249, 156, 37, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 241, 180, 65, 20, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label15 = GUICtrlCreateLabel("Módulo de Resiliência (MPa)", 41, 220, 170, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label16 = GUICtrlCreateLabel("Inicial", 70, 252, 37, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 46, 276, 81, 20, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label17 = GUICtrlCreateLabel("Final", 174, 252, 31, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 150, 276, 65, 20, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label18 = GUICtrlCreateLabel("Passo", 246, 252, 37, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 238, 276, 65, 20, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Ajustes = GUICtrlCreateTabItem("Camada 3")
GUICtrlCreateInput("", 226, 285, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label19 = GUICtrlCreateLabel("Passo", 234, 261, 34, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 138, 285, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label20 = GUICtrlCreateLabel("Final", 162, 261, 26, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 34, 285, 81, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label21 = GUICtrlCreateLabel("Inicial", 58, 261, 30, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label22 = GUICtrlCreateLabel("Módulo de Resiliência (MPa)", 29, 229, 170, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
GUICtrlCreateInput("", 37, 189, 81, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label23 = GUICtrlCreateLabel("Inicial", 61, 165, 30, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 141, 189, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label24 = GUICtrlCreateLabel("Final", 165, 165, 26, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 229, 189, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label25 = GUICtrlCreateLabel("Passo", 237, 165, 34, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label26 = GUICtrlCreateLabel("Espessura (cm)", 27, 134, 96, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label27 = GUICtrlCreateLabel("Camada 3", 44, 98, 72, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
$TabSheet1 = GUICtrlCreateTabItem("Configuração")
$TabSheet2 = GUICtrlCreateTabItem("Ajustes")
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("&Simular", 310, 440, 75, 25)
$Button2 = GUICtrlCreateButton("&Cancelar", 222, 440, 75, 25)
$Button3 = GUICtrlCreateButton("&Ajuda", 8, 440, 75, 25)
$Icon1 = GUICtrlCreateIcon("D:\GERSON\Desktop\TCC Automação\AUTOIT PROGRAMAÇÃO\Icone3.ico", -1, 336, 8, 48, 48)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites



Here is example...

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

;#######################
Global $Tab0Input1_Value
;#######################

#Region ### START Koda GUI section ### Form=d:\gerson\desktop\tcc automação\autoit programaÇÃo\testes\layautosim.kxf
$dlgTabbed = GUICreate("AutoSim", 401, 455, 277, 10)
$MenuItem4 = GUICtrlCreateMenu("&Programa")
$MenuItem5 = GUICtrlCreateMenuItem("Salvar", $MenuItem4)
$MenuItem6 = GUICtrlCreateMenuItem("Salvar Como...", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Abrir", $MenuItem4)
$MenuItem3 = GUICtrlCreateMenu("&Editar")
$MenuItem2 = GUICtrlCreateMenu("&Ajuda")
$MenuItem1 = GUICtrlCreateMenu("&Sobre")
GUISetIcon("", -1)
$PageControl1 = GUICtrlCreateTab(16, 64, 376, 368)
$Estrutura = GUICtrlCreateTabItem("Camada 1")
$Label1 = GUICtrlCreateLabel("Camada 1", 56, 96, 72, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
$Label2 = GUICtrlCreateLabel("Espessura (cm)", 24, 128, 96, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label3 = GUICtrlCreateLabel("Inicial", 56, 152, 30, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label4 = GUICtrlCreateLabel("Final", 160, 152, 26, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label5 = GUICtrlCreateLabel("Passo", 232, 152, 34, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
;#################################################################################
$Tab0Input1 = GUICtrlCreateInput("", 32, 176, 81, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
;#################################################################################
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 136, 176, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 224, 176, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label8 = GUICtrlCreateLabel("Módulo de Resiliência (MPa)", 24, 216, 170, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
GUICtrlCreateInput("", 29, 272, 81, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label9 = GUICtrlCreateLabel("Inicial", 53, 248, 30, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label10 = GUICtrlCreateLabel("Final", 157, 248, 26, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 133, 272, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label11 = GUICtrlCreateLabel("Passo", 229, 248, 34, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 221, 272, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

;#################################################################################
$Button = GUICtrlCreateButton("press", 29, 320)
;#################################################################################

$Modelo = GUICtrlCreateTabItem("Camada 2")
$Label6 = GUICtrlCreateLabel("Camada 2", 48, 97, 72, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
$Label7 = GUICtrlCreateLabel("Espessura (cm)", 31, 133, 96, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label12 = GUICtrlCreateLabel("Inicial", 73, 156, 37, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 49, 180, 81, 20, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label13 = GUICtrlCreateLabel("Final", 177, 156, 31, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 153, 180, 65, 20, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label14 = GUICtrlCreateLabel("Passo", 249, 156, 37, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 241, 180, 65, 20, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label15 = GUICtrlCreateLabel("Módulo de Resiliência (MPa)", 41, 220, 170, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label16 = GUICtrlCreateLabel("Inicial", 70, 252, 37, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 46, 276, 81, 20, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label17 = GUICtrlCreateLabel("Final", 174, 252, 31, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 150, 276, 65, 20, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Label18 = GUICtrlCreateLabel("Passo", 246, 252, 37, 16)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
GUICtrlCreateInput("", 238, 276, 65, 20, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial Rounded MT Bold")
$Ajustes = GUICtrlCreateTabItem("Camada 3")
GUICtrlCreateInput("", 226, 285, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label19 = GUICtrlCreateLabel("Passo", 234, 261, 34, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 138, 285, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label20 = GUICtrlCreateLabel("Final", 162, 261, 26, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 34, 285, 81, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label21 = GUICtrlCreateLabel("Inicial", 58, 261, 30, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label22 = GUICtrlCreateLabel("Módulo de Resiliência (MPa)", 29, 229, 170, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
GUICtrlCreateInput("", 37, 189, 81, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label23 = GUICtrlCreateLabel("Inicial", 61, 165, 30, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 141, 189, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label24 = GUICtrlCreateLabel("Final", 165, 165, 26, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateInput("", 229, 189, 65, 22, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER))
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label25 = GUICtrlCreateLabel("Passo", 237, 165, 34, 18)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label26 = GUICtrlCreateLabel("Espessura (cm)", 27, 134, 96, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label27 = GUICtrlCreateLabel("Camada 3", 44, 98, 72, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
$TabSheet1 = GUICtrlCreateTabItem("Configuração")
$TabSheet2 = GUICtrlCreateTabItem("Ajustes")
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("&Simular", 310, 440, 75, 25)
$Button2 = GUICtrlCreateButton("&Cancelar", 222, 440, 75, 25)
$Button3 = GUICtrlCreateButton("&Ajuda", 8, 440, 75, 25)
$Icon1 = GUICtrlCreateIcon("D:\GERSON\Desktop\TCC Automação\AUTOIT PROGRAMAÇÃO\Icone3.ico", -1, 336, 8, 48, 48)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            ;###########################################
        Case $Button
            $Tab0Input1_Value = GUICtrlRead($Tab0Input1)
            MsgBox(0,"Value of input", $Tab0Input1_Value)
            ;###########################################
    EndSwitch
WEnd

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
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
Sign in to follow this  
Followers 0