Legacy Variable Assignment with Commas

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
BoredErica1
Posts: 8
Joined: 18 Apr 2022, 14:43

Legacy Variable Assignment with Commas

Post by BoredErica1 » 07 Aug 2022, 13:16

Hi,
I am trying to assign some variables. To save space, put them on the same line with commas like so:

Code: Select all

1a := 1, 1b := "r", 1c := 5, 1d := "p"
This works, but they way I currently use the script requires I constantly change the values of these variables manually. So I have to open script up with np++ and click on the 1, backspace, change it to 5 and whatnot. For 1b and 1d, the value is always a string (a letter). I find it a little annoying to constantly change the value with the quotation marks. (I know, kind of weird of me.) Is there a way to have multiple variable assignments on the same line but be able to assign a string to a variable without using quotation marks, like with legacy assignment? When I do that, the variable doesn't get assigned if I'm using commas.

In the future I might be able to add a system that reads some strings, parses it, and then figures out what the variables need to be changed to, but I'm not quite there yet, so this is an interim solution.

Thanks

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Legacy Variable Assignment with Commas

Post by boiler » 07 Aug 2022, 13:46

BoredErica1 wrote: (I know, kind of weird of me.)
Especially since you don't have to retype the quotation marks.

BoredErica1 wrote: Is there a way to have multiple variable assignments on the same line but be able to assign a string to a variable without using quotation marks, like with legacy assignment?
No.

Post Reply

Return to “Ask for Help (v1)”