Newbie with syntax problem
Posted: 28 Mar 2024, 01:01
Hi, sorry for being such a newbie but scouring help, adjusting, displaying, rinsing and repeating is getting me nowhere on some of the absolute basics. I have finally worked out the syntax for where you put the curly brackets for block code, but displaying a variable still escapes me.
My code shows up the correct notepad window, and then the messagebox shows "Hello World! <> 2. MyVar". That is, the name of the variable, not the value.
If I change the statement "Myvar := 3" to "MyVar := 2", then the true part of the if statement executes, as expected. So the part I'm not understanding is how to display it.
What is wrong with my use of the variable?
Thanks heaps,
Jack
Code: Select all
^6:: ; Ctrl+Alt+N
{
if WinExist("*fgsfhgsfhg - Notepad"){
MyVar := "3"
if (MyVar = "2")
MsgBox "Hello World!" . MyVar
else
MsgBox "Hello World! <> 2" . MyVar
}
else
Run "Notepad"
}
If I change the statement "Myvar := 3" to "MyVar := 2", then the true part of the if statement executes, as expected. So the part I'm not understanding is how to display it.
What is wrong with my use of the variable?
Thanks heaps,
Jack