Asked — Edited

Addminute() Usage

The example:


$LaterHour = $hour
$LaterMinute = AddMinute($minute, 1)

RepeatUntil($hour < $LaterHour AND $minute < $LaterMinute)
 Print($second)
EndRepeatUntil

Verification of syntax reports 'No errors'

When I start the script I receive the error in the debug window

Quote:

Error on line 2: Unknown function: AddMinute

What am I missing in this code?


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

United Kingdom
#1  

Can't say I've ever used those commands since you can simply use $minute + 1 (or whatever) to make $laterminute.

#2  

Can not seem to find some examples or documentation on of of the bullet point date time functions. Is there a better place to look then the script window help for information on those functions?

#3  

Looking at the EZ-Script Manual it does not list what to pass to the function or what is returned. Perhaps try using $LaterMinute = AddMinute($minute), my guess is the function is passed a time and returns a time with a minute added. Thats my quick guess, could be wrong. Obviously the function is not recognized which could be linked to the number of arguments being passed to it.

United Kingdom
#4  

I believe it's a typo in the script help, it should be AddMinutes

$newtime = AddMinutes($time, 5)
Print($time)
Print($newtime)

Should provide with this;

Quote:

17:04 22/01/2015 05:09:56 PM Done (00:00:00.0040002)

The syntax is; AddMinutes([time],[number of minutes])

#5  

@Rich You know I was looking at that and saw AddSeconds() and AddHours() used 's' as well, another thought but looked over it.

#6  

Thanks guys for the help. Just used to thinking so matter of fact. I did notice the missing 's' but it just didn't sink in.