Asked — Edited
Resolved Resolved by WBS00001!

Ezscript Functions

I need to understand what the following functions do and how to use them, they maybe just what I need. Can someone assist?

Where can I find more information on the following script functions. Specifically what they do and what the syntax looks like to use them.

Scientific Math Functions

Now()

Today()

DateTime Functions

MinDate()

MaxDate()

MonthName()

AddDays()

AddMonths()

AddYears()

AddHours()

AddMinute()

AddSeconds()

FmtNum()

FmtDate()


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

#17  

After a bit more searching in C# code, I have divined the Operations of the date and time functions. I have divided it up into 2 sections. The list of the functions with brief extras, and a NOTES section with more detail:

Date-Time Functions

Add Functions AddMonths(DateTimeType, Amount to Add) AddYears(DateTimeType, Amount to Add) AddHours(DateTimeType, Amount to Add) AddMinute(DateTimeType, Amount to Add) AddSeconds(DateTimeType, Amount to Add)

They are used in the form of: $Variable =Function(Value1, Value2)

Date and Time Units $Month - Returns the current month number of the year $Year - Returns the current year $Day - Returns the current day number of the month $DayName - Returns the current day name as a string $Hour - Returns the current hour number of the day $Minute - Returns the current minute number of the hour $Second - Returns the current seconds number of the minute $MonthName - Returns the current month name as a string $Time - Returns the current time as a string

They are used in the form of: $Variable =Function $TheSecond =$Second

Additional Date-Time Functions MinDate() = 1/1/0001 12:00:00 AM - Returns Min in Date-time range MaxDate() = 12/31/9999 11:59:59 PM - Returns Max in Date-time range MonthName(Number of Month) - Returns string with month full name Now() - Returns the current date-time as a string Today() - Returns the current date as a string but the time =12:00:00

Date-Time Conversion CDateTime("dd/mm/yyyy hr:min:sec" )

Used in the form of: $Variable =Function("dd/mm/yyyy hr:min:sec" ) $TheDateTime =CDateTime("1/11/2000 10:10:10" )

NOTES:

Add Functions To work with these functions the first value must be in a standard Date-Time number (Type = Double)

To convert a date-time string into that form you can use the CDateTime function. It works like this: $TheDateTime =CDateTime("dd/mm/yyyy hr:min:sec" )

Once in this form, the variable can be used in any of the "Add" functions. Example: $StartDateTime =CDateTime("1/1/2000 10:10:10" )

AddDays($StartDateTime,10) = 1/11/2000 10:10:10 AddYears($StartDateTime,10) = 1/1/2010 10:10:10 AddMonths($StartDateTime,10) = 11/1/2000 10:10:10 AddMinutes($StartDateTime,10) = 1/1/2000 10:20:10

They can also be used as intermidiate values in script statements. Example: $TheNewDateTime = AddDays(CDateTime("1/1/2000 10:10:10" ), 10)

Additional Date-Time Functions MinDate() = 1/1/0001 12:00:00 AM - Returns Min val in Date-time range MaxDate() = 12/31/9999 11:59:59 PM - Returns Max val in Date-time range MonthName(Number of Month) - Returns string with month full name $TheMonth =MonthName(10) ("October" )

Now() Returns the current date-time as a string $TheDateTime =Now()

Today() Returns the current date as a string but the time always =12:00:00 $TheDate =Today()

The Now() and Today() functions are good for getting the date and time together.

However, if you want only the time use the following instead: $Time - Returns only the time in a string
$TheTime =$Time

$Date Returns both the date and time. $TheDateTime =$Date

It is odd that $Date returns both the date and time, however you can get the date only with the following code:


 $TheDate = $Day+"/"+$Month+"/"+$Year

#18  

Hi WBS00001,

this is another really cool lesson!

Cool to have somebody how can explain this so good!

Boris

#19  

Awesome @WBS00001 Thank you for experimenting and documenting that! :)

#20  

This must have taken a lot of your time. Thanks for spending it on us. Excellent gift!

#21  

@rentaprinta Thank you. I'm glad that you have such a good grasp of English that it can be useful to you. Hopefully it will be to other non-native English speaking users as well.

If you ever find the time, it could be helpful to your fellow German speaking EZ-Robot users if you could translate some of it to German. The commands have to be in English so they will work in the scripts, but some parts of it can be in whatever language is appropriate, especially in the NOTES portion.

Thanks again for your kind words.

@JustinRatliff ,Dave Schulpius Thank you as well for your comments. It also helps me, to take the time to clean up my notes on these things and have something better laid out to refresh my memory from time to time. Win-win all around.

@AllReaders If anyone finds errors or has different ways of expressing the meaning behind these functions, by all means post it. Any critique or revision is more than welcome. Please feel free to add to it as well. Won't hurt my feelings a bit. :)

United Kingdom
#22  

I'm not sure where I saved it but I have a very extensive list of EZ-Script functions/commands and examples/descriptions I wrote some time back as part of a possible tutorial/e-book thingy. If I can find it I'll upload and post it.

PRO
USA
#23  

I would like to thank everyone that replied. There was a lot of good information that came from everyone. That includes

JustinRatliff Dave Shulpius Steve G. Robot-Doc thetechguru Andy Roid WBS00001 rentaprinta Rich

Thanks everyone.

PRO
USA
#24  

Just stumbled onto this. This is a fantastic thread and well overdue subject to execute. Short of taking basic programming in high school around 1980-1984, I have yet to undertake any kinda modern day coding lessons. I learn by example and deconstructing. The few scripts that Dave Cochran wrote for me is an excellent example of this. How things associate with one another. I know I would Benefit greatly by a function/script /example " programming for dummies tutorials" like Dave suggested. wiki or PDF or perhaps video tutorials ?