From Clomosy Docs

No edit summary
No edit summary
Line 20: Line 20:
<li>
<li>
<div class="green-learn-more">
<div class="green-learn-more">
[[#Date_and Time Definitions|Date and Time Functions:]]
[[#Date_and_Time_Functions|Date and Time Functions:]]
</div>
</div>
Provides functions to retrieve the current date and time, format dates, and manage time-related operations.
Provides functions to retrieve the current date and time, format dates, and manage time-related operations.
Line 178: Line 178:
|}
|}


= Date and Time Definitions =
= Date and Time Functions =


{| class="wikitable"
{| class="wikitable"
|+ Date and Time Definitions
|+ Date and Time Functions
|-
|-
! Type !! Name !! Summary
! Type !! Name !! Summary

Revision as of 15:03, 7 October 2024



There is a library that is included by default in all scripting components, this library is SystemLibrary. Adds frequently used procedures and functions such as ShowMessage and IntToStr to the script.

Functions added by SystemLibrary
See pages for description of each function:

String Functions

Type Name Definition
function Copy Create a copy of part of a string or an array.
procedure Delete Delete a section of characters from a string.
procedure Insert Insert a string into another string.
function QuotedStr QuotedStr takes a string and surrounds it with single quotes.
function Length Return the number of elements in an array or string.
function Pos The Pos function allows you to find the position of a specific substring within another string.
function Trim Removes leading and trailing blanks from a string.
function AnsiCompareStr Compare two strings for equality.
function AnsiCompareText Compare two strings for equality, ignoring case.
function UpperCase Change lower case characters in a string to upper case.
function LowerCase Change upper case characters in a string to lower case.
function CompareStr Compare two strings to see which is greater than the other.
function CompareText Compare two strings for equality, ignoring case.
function AnsiLowerCase Returns a string that is a copy of the given string converted to lowercase.
function AnsiUpperCase Creates a copy of String with all letters converted to upper case.
function Chr Convert an integer into a character.

Math Functions

Type Name Definition
function Abs Gives the absolute value of a number (-(minus) sign is removed)
function ArcTan The Arc Tangent of a number, returned in radians
function Cos The Cosine of a number
procedure Dec Decrement an ordinal variable
function Frac The fractional part of a floating point number
procedure Inc Increment an ordinal variable
function Ln Gives the natural logarithm of a number
keyword Mod Performs integer division, returning the remainder
function Odd Tests if an integer is an odd number
function Random Generate a random floating point or integer number
function Round Rounds a floating point number to an integer
function Sin The Sine of a number
function Sqr Gives the square of a number
function SQRT Gives the square root of a number
function Trunc The integer part of a floating point number
function Ord Provides the Ordinal value of an integer, character or enum
keyword Div The Div keyword gives the whole number result of dividing the Dividend by the Divisor.

Input-Output Functions

Type Name Definition
procedure ShowMessage Display a string in a simple dialog with an OK button.
function InputQuery Display a dialog that asks for user text input.
procedure InputAndCall Display a dialog that asks for user text input.
procedure AskAndCall The "AskAndCall" function is commonly used in Clomosy programming to display a dialog box where you can request user confirmation.
function Ask The "Ask" function is commonly used in Clomosy programming to display a dialog box where you can request user confirmation. (Only for Windows)
procedure Console Applications Console applications are 32-bit programs that run in a console window without a graphical interface.



Conversion Functions(Type Conversions)

Conversion Functions(Type Conversions)
Type Name Summary
function DateTimeToStr Converts TclDateTime date and time values to a string
function DateToStr Converts TclDateTime date values to a string
function FloatToStr Convert a floating point value to a string
function FormatDateTime Rich formatting of a TclDateTime variable into a string
function IntToHex Convert a integer point value to a hexadecimal string
function IntToStr Convert an integer into a string
function StrToDate Converts a date string into a TclDateTime value
function StrToDateTime Converts a date+time string into a TclDateTime value
function StrToFloat Convert a number string into a floating point value
function StrToInt Convert a number string into a integer value
function StrToIntDef Convert a string into an Integer value with default
function StrToTime Converts a time string into a TclDateTime value
function TimeToStr Converts a TclDateTime time value to a string

Date and Time Functions

Date and Time Functions
Type Name Summary
function DayOfWeek Gives day of week index for a TclDateTime value
procedure DecodeDate Extracts the year, month, day values from a TclDateTime var.
procedure DecodeTime Break a TclDateTime value into individual time values
function EncodeDate Build a TclDateTime value from year, month and day values
function EncodeTime Build a TclDateTime value from hour, min, sec and msec values
function IncMonth Increments a TclDateTime variable by a number of months
function Now Gives the current date and time