Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables and labels share names in certain cases #314

Open
Banaanae opened this issue Nov 22, 2024 · 0 comments
Open

Variables and labels share names in certain cases #314

Banaanae opened this issue Nov 22, 2024 · 0 comments

Comments

@Banaanae
Copy link
Collaborator

V1:

Gui, Add, ListBox, vThing gThing, Normal|High|Low
Gui, Show
return

Thing:
GuiControlGet, Thing
MsgBox % Thing
return

V2 (Converted):

myGui := Gui()
ogcListBoxThing := myGui.Add("ListBox", "vThing", ["Normal", "High", "Low"])
ogcListBoxThing.OnEvent("DoubleClick", Thing.Bind("DoubleClick"))
myGui.Show()
return

Thing(A_GuiEvent := "", GuiCtrlObj := "", Info := "", *)
{ ; V1toV2: Added bracket
global ; V1toV2: Made function global
Thing := ogcListBoxThing.Text
MsgBox(Thing)
return
} ; V1toV2: Added bracket in the end

V2 (Expected):

myGui := Gui()
ogcListBoxThing := myGui.Add("ListBox", "vThing", ["Normal", "High", "Low"])
ogcListBoxThing.OnEvent("DoubleClick", LblThing.Bind("DoubleClick"))
myGui.Show()
return

LblThing(A_GuiEvent := "", GuiCtrlObj := "", Info := "", *)
{ ; V1toV2: Added bracket
global ; V1toV2: Made function global
Thing := ogcListBoxThing.Text
MsgBox(Thing)
return
} ; V1toV2: Added bracket in the end

Since goto calls are already updated, it would be easiest to update the label (func) name
This is the last issue before Process_ex3 is converting correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant