[Solved] EnvSub error "Parameter #2 invalid" PostVer1.1

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

[Solved] EnvSub error "Parameter #2 invalid" PostVer1.1

22 Oct 2014, 09:48

Code: Select all

a := A_Now
a -= 8, Hours	;Parameter #2 invalid.
MsgBox, % a
a += 8, Hours	;OK
MsgBox, % a

Code: Select all

a := A_Now
b:=8
a -=% b, Hours
MsgBox, % a	;Empty
Same error using EnvSub.
Could use a += -8, Hours.
Last edited by RobertL on 22 Oct 2014, 20:29, edited 1 time in total.
我为人人,人人为己?
just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Bug? EnvSub error "Parameter #2 invalid" PostVer1.1

22 Oct 2014, 11:16

EnvSub wrote: TimeUnits
If present, this parameter directs the command to subtract Value from Var as though both of them are date-time stamps in the YYYYMMDDHH24MISS format.
Guest

Re: Bug? EnvSub error "Parameter #2 invalid" PostVer1.1

22 Oct 2014, 13:12

EnvAdd TimeUnits: If present, this parameter directs the command to add Value to Var, treating Var as a date-time stamp in the YYYYMMDDHH24MISS format and treating Value as the integer or floating point number of units to add (specify a negative number to perform subtraction). http://ahkscript.org/docs/commands/EnvAdd.htm

EnvSub: TimeUnits ... To add or subtract a certain number of seconds, minutes, hours, or days from a timestamp, use EnvAdd (subtraction is achieved by adding a negative number). http://ahkscript.org/docs/commands/EnvSub.htm
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

Re: [Solved]

22 Oct 2014, 21:02

Thanks. My thoughtless.
我为人人,人人为己?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, LRRUNB, OrangeCat and 162 guests