From Clomosy Docs

Line 113: Line 113:


= String Operations =
= String Operations =
{| class="wikitable"
|+ General Operations
|-
! Type !! Name !! Summary
|-
| 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 || [[Chr]] || Convert an integer into a character
|-
| function || [[Copy]] || Create a copy of part of a string or an array
|-
| function || [[CompareStr]] || Compare two strings to see which is greater than the other
|-
| function || [[CompareText]] || Compare two strings for equality, ignoring case
|-
| procedure || [[Delete]] || Delete a section of characters from a string
|-
| procedure || [[Insert]] || Insert a string into another string
|-
| function || [[Length]] || Return the number of elements in an array or string
|-
| function || [[Ord]] || Provides the Ordinal value of an integer, character or enum
|-
| 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 || [[Assigned]] || Returns true if a reference is not nil
|-
| function || [[VarIsNull]] || Returns true if a reference is nil
|}


<div class="table-responsive">
<div class="table-responsive">

Revision as of 13:27, 4 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:

Type Conversions

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 Definitions

Date and Time Definitions
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

Message Box Definitions

Message Box Definitions
Type Name Summary
function InputQuery Display a dialog that asks for user text input
procedure ShowMessage Display a string in a simple dialog with an OK button
procedure InputAndCall Display a dialog that asks for user text input

Mathematical Operations

Math Operations
Type Name Summary
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

String Operations

Type Name Definition
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 Chr Convert an integer into a character
function Copy Create a copy of part of a string or an array
function CompareStr Compare two strings to see which is greater than the other
function CompareText Compare two strings for equality, ignoring case
procedure Delete Delete a section of characters from a string
procedure Insert Insert a string into another string
function Length Return the number of elements in an array or string
function Ord Provides the Ordinal value of an integer, character or enum
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 Assigned Returns true if a reference is not nil
function VarIsNull Returns true if a reference is nil
function QuotedStr QuotedStr takes a string and surrounds it with single quotes.