Por quê esse script não funciona corretamente? Topic is solved

Tire suas dúvidas sobre programação em AutoHotkey

Moderator: Gio

User avatar
fx_spencer
Posts: 6
Joined: 06 Dec 2021, 07:45
Contact:

Por quê esse script não funciona corretamente?  Topic is solved

Post by fx_spencer » 06 Dec 2021, 08:23

Code: Select all

; Generated by Auto-GUI 3.0.1
#SingleInstance Force
#NoEnv
SetWorkingDir %A_ScriptDir%
SetBatchLines -1

Gui Font, s9, Segoe UI
Gui Add, Button, x142 y12 w80 h23 gCheck, &OK
Gui Add, Edit, x13 y13 w120 h21 vEdit

Gui Show, w233 h58, Window
Return

var := "1"
Check:
GuiControlGet,Edit 

if (Edit = "") {
    MsgBox, EditBox is empty, so i am going to put 1 on it.
    var := "1"
    GuiControl,,Edit, %var%
} else {
    var := %Edit%
    MsgBox, EditBox was not empty, congratulations! Setted the var value to its value. (%var%)
}
return 

GuiEscape:
GuiClose:
    ExitApp
A Parte
MsgBox, EditBox was not empty, congratulations! Setted the var value to its value. (%var%)
não funciona direito. Ao invés de aparecer o valor da variável
var
, não aparece nada.

User avatar
fx_spencer
Posts: 6
Joined: 06 Dec 2021, 07:45
Contact:

Re: Por quê esse script não funciona corretamente?

Post by fx_spencer » 06 Dec 2021, 08:51

Resolvido, apenas mudei de %var% para % var.

garry
Posts: 3740
Joined: 22 Dec 2013, 12:50

Re: Por quê esse script não funciona corretamente?

Post by garry » 07 Dec 2021, 12:58

Eu mudei > var: = edit

Code: Select all

;-------- saved at 星期二 十二月 2021-12-07  17:50 UTC --------------
;- Por quê esse script não funciona corretamente? 
;- https://www.autohotkey.com/boards/viewtopic.php?f=69&t=97518

; Generated by Auto-GUI 3.0.1
#SingleInstance Force
#NoEnv
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
Gui Font, s9, Segoe UI
Gui Add, Button, x142 y12 w80 h23 gCheck, &OK
Gui Add, Edit, x13 y13 w120 h21 vEdit
Gui Show, w233 h58, Window
Return
;---------------
Check:
GuiControlGet,Edit 
if (Edit = "") {
    MsgBox, EditBox is empty, so i am going to put 1 on it.
    var := "1"
    GuiControl,,Edit, %var%
} else {
    var := Edit
    MsgBox, EditBox was not empty, congratulations! Setted the var value to its value. (%var%)
}
return 
;--------------
GuiEscape:
GuiClose:
ExitApp
;--------------

Post Reply

Return to “Ajuda e Suporte Geral”