To parse the value entered in the editbox.

Get help with using AutoHotkey and its commands and hotkeys
chngrcn
Posts: 140
Joined: 29 Feb 2016, 08:55

To parse the value entered in the editbox.

16 Feb 2018, 09:02

Code: Select all

Gui, Add, Edit, x32 y40 w320 h90 vInpt, EB542219*34JP6237*40372894838
Gui, Add, Edit, x32 y160 w320 h20 vEdi1, %Edi1%
Gui, Add, Edit, x32 y210 w320 h20 vEdi2, %Edi2%
Gui, Add, Edit, x32 y260 w320 h20 vEdi3, %Edi3%
Gui, Add, Text, x32 y140 w100 h20 , Edi1
Gui, Add, Text, x32 y190 w100 h20 , Edi2
Gui, Add, Text, x32 y240 w100 h20 , Edi3
Gui, Add, Text, x32 y20 w200 h20 , Main Table 
Gui, Show, w479 h379, Gui
return
Hello

in the above code I want to do;

I want to parse the value entered in the main table box.

"*" to decompose the values up.


the result will be:

main table = EB542219*34JP6237*40372894838

edi1 = EB542219
edi2 = 34JP6237
edi3 = 40372894838

thank you for your help.
Odlanir
Posts: 274
Joined: 20 Oct 2016, 08:20

Re: To parse the value entered in the editbox.

16 Feb 2018, 09:35

Code: Select all

Gui, Add, Edit, x32 y40 w320 h90 vInpt, EB542219*34JP6237*40372894838
Gui, Add, Edit, x32 y160 w320 h20 vEdi1, %Edi1%
Gui, Add, Edit, x32 y210 w320 h20 vEdi2, %Edi2%
Gui, Add, Edit, x32 y260 w320 h20 vEdi3, %Edi3%
Gui, Add, Text, x32 y140 w100 h20 , Edi1
Gui, Add, Text, x32 y190 w100 h20 , Edi2
Gui, Add, Text, x32 y240 w100 h20 , Edi3
Gui, Add, Text, x32 y20 w200 h20 , Main Table 
Gui, Add, Button, x32 y300 w200 h60 gBut, Do the work 
Gui, Show, w479 h379, Gui
return

ExitApp

But:
    Gui, Submit, NoHide
    Arr := StrSplit(Inpt, "*")
    loop, 3
        GuiControl,,Edi%A_index%, % Arr[a_index]
return
____________________________________________________________________________
Windows 7 Home Premium 64 bit - Autohotkey v1.1.24.02 64-bit Unicode
chngrcn
Posts: 140
Joined: 29 Feb 2016, 08:55

Re: To parse the value entered in the editbox.

19 Feb 2018, 01:22

Can we put a check here?

if the Inpt box ( vInpt) is empty, exit sub.
BoBo
Posts: 2515
Joined: 13 May 2014, 17:15

Re: To parse the value entered in the editbox.

19 Feb 2018, 09:51

Yes "we" can.

Code: Select all

But:
    Gui, Submit, NoHide
    If (inpt != " ") {    ; if input is NOT empty go on. Else ...
        Arr := StrSplit(Inpt, "*")
        Loop, 3
            GuiControl,,Edi%A_index%, % Arr[a_index]
        }
    Return 
chngrcn
Posts: 140
Joined: 29 Feb 2016, 08:55

Re: To parse the value entered in the editbox.

20 Feb 2018, 04:30

:) thank you very much bobo.. i can speak english a little. Excuse me!
Johana
Posts: 184
Joined: 02 May 2017, 02:34

Re: To parse the value entered in the editbox.

20 Feb 2018, 06:55

BoBo wrote:Yes "we" can.

Code: Select all

But:
    Gui, Submit, NoHide
    If (inpt != " ") {    ; if input is NOT empty go on. Else ...
        Arr := StrSplit(Inpt, "*")
        Loop, 3
            GuiControl,,Edi%A_index%, % Arr[a_index]
        }
    Return 
Bobo, is there a difference if there's a space where the " " are? I.e: Does this work:

Code: Select all

If (inpt != "") 
BoBo
Posts: 2515
Joined: 13 May 2014, 17:15

Re: To parse the value entered in the editbox.

20 Feb 2018, 07:35

Well, there is a difference indeed ...

Code: Select all

; inpt :=
; inpt := ""
inpt := " "

If (inpt != " ")   ; if var doesn't contain a space character
   MsgBox % "1 |" . inpt . "|"
If (inpt != "")   ; if var isn't empty
   MsgBox % "2 |" . inpt . "|"
Johana
Posts: 184
Joined: 02 May 2017, 02:34

Re: To parse the value entered in the editbox.

20 Feb 2018, 07:37

BoBo wrote:Well, there is a difference indeed ...

Code: Select all

; inpt :=
; inpt := ""
inpt := " "

If (inpt != " ")   ; if var doesn't contain a space character
   MsgBox % "1 |" . inpt . "|"
If (inpt != "")   ; if var isn't empty
   MsgBox % "2 |" . inpt . "|"
Thanks!
chngrcn
Posts: 140
Joined: 29 Feb 2016, 08:55

Re: To parse the value entered in the editbox.

21 Feb 2018, 01:10

Odlanir wrote:

Code: Select all

Gui, Add, Edit, x32 y40 w320 h90 vInpt, EB542219*34JP6237*40372894838
Gui, Add, Edit, x32 y160 w320 h20 vEdi1, %Edi1%
Gui, Add, Edit, x32 y210 w320 h20 vEdi2, %Edi2%
Gui, Add, Edit, x32 y260 w320 h20 vEdi3, %Edi3%
Gui, Add, Text, x32 y140 w100 h20 , Edi1
Gui, Add, Text, x32 y190 w100 h20 , Edi2
Gui, Add, Text, x32 y240 w100 h20 , Edi3
Gui, Add, Text, x32 y20 w200 h20 , Main Table 
Gui, Add, Button, x32 y300 w200 h60 gBut, Do the work 
Gui, Show, w479 h379, Gui
return

ExitApp

But:
    Gui, Submit, NoHide
    Arr := StrSplit(Inpt, "*")
    loop, 3
        GuiControl,,Edi%A_index%, % Arr[a_index]
return

I would like to ask my friends something else.
in the above code, but not in the editbox's change event?

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot] and 86 guests