simple question

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

simple question

26 Nov 2013, 15:27

i try to resolve the error i get in this line:
n:=1
headline1_date%n% <> %headline1_date_%n%%
Error: Empty variable reference (%%).
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: simple question

26 Nov 2013, 16:19

Well Headline1_date seems to be empty.
Recommends AHK Studio
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: simple question

26 Nov 2013, 16:33

it is actually like this:
n:=1
headline1_date_%n% := "some value"
headline1_date%n% <> %headline1_date_%n%%

Error: Empty variable reference (%%).
nnnik wrote:Well Headline1_date seems to be empty.
User avatar
tomoe_uehara
Posts: 213
Joined: 05 Oct 2013, 12:37
Contact:

Re: simple question

27 Nov 2013, 00:46

Well, it's considered empty because of the last %%

Code: Select all

n := 1
headline1_date%n% := "apple"
headline2 := "orange"
if (headline1_date%n% <> headline2)
MsgBox It's different!
else
MsgBox It's equal!

headline1_date%n% := "apple"
headline2 := "apple"
if (headline1_date%n% <> headline2)
MsgBox It's different!
else
MsgBox It's equal!
ExitApp
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: simple question

27 Nov 2013, 07:53

thanks! my question above was posted hastily and not in full. basically, i was wondering if i could wrap % inside of %% (%headline1_date_%n%%), which could end in something like %something%n%% :ugeek:
User avatar
emmanuel d
Posts: 90
Joined: 17 Nov 2013, 04:45

Re: simple question

27 Nov 2013, 11:40

Something like this?:

Code: Select all

n:=1
headline1_date_%n% := "some value"
something:= "headline1_date_" ; something must have a value
var := %something%%n% ; 2 dynamic variables, the same as headline1_date_1 
msgbox,%var%
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: simple question

27 Nov 2013, 13:52

thanks! i think in the end, i did something similar:
headline := "Headline: "
ht := headline1_title_%n% ; Must be ":=" NOT "="
hh = %headline%%ht% ; Must be "=" NOT ":="
Title = %hh% >> ; Must be "=" NOT ":="
...

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 242 guests