Problem with assigning variable with value ending with colon

Report problems with documented functionality
mahi124
Posts: 1
Joined: 03 Apr 2018, 11:35

Problem with assigning variable with value ending with colon

03 Apr 2018, 11:47

Not sure if this is a bug or not. But looks like a bug to me...

Check the below code

Code: Select all

Driveget, dlist, list
Loop, Parse, dlist
{
thisDrive=%A_LoopField%:   		; <- this doesn't work, thisDrive is blank here

thisDrive = %A_LoopField%:  	; <- works fine
thisDrive := A_LoopField ":"  	; <- works fine
}

str = abcdef

test_var=%str%:   				; <- this doesn't work either

lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Problem with assigning variable with value ending with colon

03 Apr 2018, 22:09

That's a label.
Label names are not case sensitive, and may consist of any characters other than space, tab, comma and the escape character (`).
https://autohotkey.com/docs/misc/Labels.htm

Code: Select all

goto test_var=`%str`%
test_var=%str%:
MsgBox % A_ThisLabel
This is one reason to include whitespace around operators.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 113 guests