From Clomosy Docs

No edit summary
 
(52 intermediate revisions by 3 users not shown)
Line 1: Line 1:
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.<br>
<div class="alert alert-success" role="alert" data-bs-theme="light" style="border: 1px solid #ddd; padding: 16px; background-color: #e8f5e9; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
<ul>
<li>
<div class="green-learn-more">
[[#String_Functions|String Functions:]]
</div>
Allows searching, merging, and editing text. String functions simplify text manipulation in your application.
</li>
<li>
<div class="green-learn-more">
[[#Math_Functions|Math Functions:]]
</div>
Performs basic operations like addition, subtraction, multiplication, and more complex calculations.
</li>
<li>
<div class="green-learn-more">
[[#Input-Output_Functions|
Input-Output Functions: ]]
</div>Functions for managing input-output operations with message windows.</li>
<li>
<div class="green-learn-more">
[[#Date_and_Time_Functions|Date and Time Functions:]]
</div>
Provides functions to retrieve the current date and time, format dates, and manage time-related operations.
</li>
<li>
<div class="green-learn-more">
[[#Type_Conversion_Functions|Type Conversion Functions:]]
</div>
Type Converts data types, such as converting a number to a string.
</li>
<li>
<div class="green-learn-more">
[[#Boolean_Functions|Boolean Functions:]]
</div>
Manages logical operations and conditions. Checks if an object is assigned or not.
</li>
<li>
<div class="green-learn-more">
[[#System_Procedures|System Procedures:]]
</div>
Enables interaction with the system, such as issuing a beep sound.
</li>
<li><div class="green-learn-more">
[[#Cl_Utilities_Functions|CL Utilities Functions:]]
</div>
Provides system-level utilities for managing objects and strings, helping keep your code organized and optimized</li>
</ul>
</div>
<br>
<br>


'''Functions added by SystemLibrary'''<br>
<h2>String Functions</h2>
See pages for description of each function:<br>


= Type Conversions =
<div class="table-responsive">
 
{| class="wikitable" style="border: 2px solid #c3d7e0"
{| class="wikitable"
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|Definition
|+ Type Conversions
|-
| 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.
|-
|-
! Type !! Name !! Summary
| function || [[QuotedStr]] || QuotedStr takes a string and surrounds it with single quotes.
|-
|-
| function || [[DateTimeToStr]] || Converts TclDateTime date and time values to a string
| function || [[Length]] || Return the number of elements in an array or string.
|-
|-
| function || [[DateToStr]] || Converts TclDateTime date values to a string
| function || [[Pos]] || The Pos function allows you to find the position of a specific substring within another string.
|-
|-
| function || [[FloatToStr]] || Convert a floating point value to a string
| function || [[Trim]] || Removes leading and trailing blanks from a string.
|-
|-
| function || [[FormatDateTime]] || Rich formatting of a TclDateTime variable into a string
| function || [[AnsiCompareStr]] || Compare two strings for equality.
|-
|-
| function || [[IntToHex]] || Convert a integer point value to a hexadecimal string
| function || [[AnsiCompareText]] || Compare two strings for equality, ignoring case.
|-
| function  || [[IntToStr]] || Convert an integer into a string
|-
|-
| function || [[StrToDate]] || Converts a date string into a TclDateTime value
| function || [[UpperCase]] || Change lower case characters in a string to upper case.
|-
|-
| function || [[StrToDateTime]] || Converts a date+time string into a TclDateTime value
| function || [[LowerCase]] || Change upper case characters in a string to lower case.
|-
|-
| function || [[StrToFloat]] || Convert a number string into a floating point value
| function || [[CompareStr]] || Compare two strings to see which is greater than the other.
|-
|-
| function || [[StrToInt]] || Convert a number string into a integer value
| function || [[CompareText]] || Compare two strings for equality, ignoring case.
|-
|-
| function || [[StrToIntDef]] || Convert a string into an Integer value with default
| function || [[AnsiLowerCase]] || Returns a string that is a copy of the given string converted to lowercase.
|-
|-
| function || [[StrToTime]] || Converts a time string into a TclDateTime value
| function || [[AnsiUpperCase]] || Creates a copy of String with all letters converted to upper case.
|-
|-
| function || [[TimeToStr]] || Converts a TclDateTime time value to a string
| function || [[Chr]] || Convert an integer into a character.
|}
|}
</div>


= Date and Time Definitions =
<h2>Math Functions</h2>


{| class="wikitable"
<div class="table-responsive">
|+ Date and Time Definitions
{| class="wikitable" style="border: 2px solid #c3d7e0"
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|Definition
|-
|-
! Type !! Name !! Summary
| function  || [[Abs]] || Gives the absolute value of a number (-(minus) sign is removed)
|-
|-
| function  || [[DayOfWeek]] || Gives day of week index for a TclDateTime value
| function  || [[ArcTan]] || The Arc Tangent of a number, returned in radians
|-
| function  || [[Cos]] || The Cosine of a number
|-
| function || [[Sin]] || The Sine of a number
|-
| function  || [[Ln]] || Gives the natural logarithm of a number
|-
| function || [[Sqr]] || Gives the square of a number
|-
| function || [[SQRT]] || Gives the square root of a number
|-
| function || [[Random]] || Generate a random floating point or integer number
|-
| function || [[Round]] || Rounds a floating point number to an integer
|-
| keyword || [[Mod]] || Performs integer division, returning the remainder
|-
| keyword || [[Div]] || The Div keyword gives the whole number result of dividing the Dividend by the Divisor.
|-
| procedure || [[Dec]] || Decrement an ordinal variable
|-
| procedure || [[Inc]] || Increment an ordinal variable
|-
|-
| procedure || [[DecodeDate]] || Extracts the year, month, day values from a TclDateTime var.
| function  || [[Frac]] || The fractional part of a floating point number
|-
|-
| procedure || [[DecodeTime]] || Break a TclDateTime value into individual time values
| function || [[Trunc]] || The integer part of a floating point number
|-
|-
| function || [[EncodeDate]] || Build a TclDateTime value from year, month and day values
| function || [[Odd]] || Tests if an integer is an odd number
|-
|-
| function || [[EncodeTime]] || Build a TclDateTime value from hour, min, sec and msec values
| function || [[Ord]] || Provides the Ordinal value of an integer, character or enum
|-
|-
| function || [[IncMonth]] || Increments a TclDateTime variable by a number of months
|function || [[Low]] || Returns the first index of the array.
|-
|-
| function || [[Now]] || Gives the current date and time
|function || [[High]] || Returns the last index of the array.
|}
|}
</div>


= Message Box Definitions =
<h2>Input-Output Functions</h2>
 
<div class="table-responsive">
{| class="wikitable"
{| class="wikitable" style="border: 2px solid #c3d7e0"
|+ Message Box Definitions
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|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.
|-
|-
! Type !! Name !! Summary
| procedure || [[InputAndCall]] || Display a dialog that asks for user text input.
|-
|-
| function  || [[InputQuery]] || 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.
|-
|-
| procedure || [[ShowMessage]] || Display a string in a simple dialog with an OK button
| 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 || [[InputAndCall]] || Display a dialog that asks for user text input
| procedure || [[Console Applications]] || Console applications are 32-bit programs that run in a console window without a graphical interface.
|}
|}
</div>


= Mathematical Operations =
<h2> Date and Time Functions </h2>
 
<div class="table-responsive">
{| class="wikitable"
{| class="wikitable" style="border: 2px solid #c3d7e0"
|+ Math Operations
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|Definition
|-
| function  || [[Date]] || Returns the current date.
|-
| function  || [[Time]] || Returns the current time.
|-
| function  || [[Now]] || Gives the current date and time
|-
| function  || [[DayOfWeek]] || Gives day of week index for a TclDateTime value
|-
| procedure || [[DecodeDate]] || Extracts the year, month, day values from a TclDateTime var.
|-
|-
! Type !! Name !! Summary
| procedure || [[DecodeTime]] || Break a TclDateTime value into individual time values
|-
|-
| function  || [[Abs]] || Gives the absolute value of a number (-(minus) sign is removed)
| function  || [[EncodeDate]] || Build a TclDateTime value from year, month and day values
|-
|-
| function  || [[ArcTan]] || The Arc Tangent of a number, returned in radians
| function  || [[EncodeTime]] || Build a TclDateTime value from hour, min, sec and msec values
|-
|-
| function  || [[Cos]] || The Cosine of a number
| function  || [[FormatDateTime]] || It is a function used to return date and time values as a string in a specified format.
|-
|-
| procedure || [[Dec]] || Decrement an ordinal variable
| function  || [[IncMonth]] || Increments a TclDateTime variable by a number of months
|}
</div>
 
<h2> Type Conversion Functions </h2>
<div class="table-responsive">
{| class="wikitable" style="border: 2px solid #c3d7e0"
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|Definition
|-
|-
| function  || [[Frac]] || The fractional part of a floating point number
| function  || [[DateTimeToStr]] || Converts TclDateTime date and time values to a string
|-
|-
| procedure || [[Inc]] || Increment an ordinal variable
| function  || [[DateToStr]] || Converts TclDateTime date values to a string
|-
|-
| function  || [[Ln]] || Gives the natural logarithm of a number
| function  || [[FloatToStr]] || Convert a floating point value to a string
|-
|-
| keyword || [[Mod]] || Performs integer division, returning the remainder
| function  || [[IntToHex]] || Convert a integer point value to a hexadecimal string
|-
| function  || [[IntToStr]] || Convert an integer into a string
|-
|-
| function || [[Odd]] || Tests if an integer is an odd number
| function || [[StrToDate]] || Converts a date string into a TclDateTime value
|-
|-
| function || [[Random]] || Generate a random floating point or integer number
| function || [[StrToDateTime]] || Converts a date+time string into a TclDateTime value
|-
|-
| function || [[Round]] || Rounds a floating point number to an integer
| function || [[StrToFloat]] || Convert a number string into a floating point value
|-
|-
| function || [[Sin]] || The Sine of a number
| function || [[StrToInt]] || Convert a number string into a integer value
|-
|-
| function || [[Sqr]] || Gives the square of a number
| function || [[StrToIntDef]] || Convert a string into an Integer value with default
|-
|-
| function || [[SQRT]] || Gives the square root of a number
| function || [[StrToTime]] || Converts a time string into a TclDateTime value
|-
|-
| function || [[Trunc]] || The integer part of a floating point number
| function || [[TimeToStr]] || Converts a TclDateTime time value to a string
|-
|-
| function || [[Ord]] || Provides the Ordinal value of an integer, character or enum
| function || [[FormatFloat]] || Converts a floating-point value to a string using a specified pattern
|}
|}
</div>


= String Operations =
<h2> Boolean Functions </h2>
<div class="table-responsive">
{| class="wikitable" style="border: 2px solid #c3d7e0"
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|Definition
|-
| function || [[Assigned]] || The assigned function checks if a reference is null.
|-
| function || [[VarIsNull]] || Indicates whether the specified variant is Null.
|}
</div>


<h2> System Procedures </h2>
<div class="table-responsive">
<div class="table-responsive">
{| class="wikitable" style="border: 2px solid #c3d7e0"
{| class="wikitable" style="border: 2px solid #c3d7e0"
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|Definition  
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|Definition  
|-
|-
| function || [[AnsiCompareStr]] || Compare two strings for equality
| procedure || [[Beep]] || The Beep procedure creates a very short and quiet sound through the internal speaker of your PC.
|-
| procedure || [[GetCurrentLocation]] ||
In mobile applications, a function is used to obtain the current location of the device.
|}
</div>
 
<h2> Cl Utilities Functions </h2>
 
<div class="table-responsive">
{| class="wikitable" style="border: 2px solid #c3d7e0"
! style="background-color: #c3d7e0"| Usage Context
!! style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"| Definition 
|-
|Component ||[[CLRTMethod|CLRTMethod]]||It allows you to determine whether a component is in front of or behind another.
|-
|-
| function || [[AnsiCompareText]] || Compare two strings for equality, ignoring case
|Component ||[[ClRTGetProperty|ClRTGetProperty]]||This function returns the value of a specific property of a component at runtime.
|-
|-
| function || [[UpperCase]] || Change lower case characters in a string to upper case
|Component ||[[ClRTSetProperty|ClRTSetProperty]]||This function allows you to assign a value to a specific property of a component at runtime.
|-
|-
| function || [[LowerCase]] || Change upper case characters in a string to lower case
|Component ||[[ClDoClick |ClDoClick]]||It allows you to programmatically click on a component or object.
|-
|-
| function || [[Copy]] || Create a copy of part of a string or an array
|Component ||[[ClSender | ClSender]]||When an event is triggered, the object associated with that event is referenced via the ClSender property.
|-
|-
| function || [[CompareStr]] || Compare two strings to see which is greater than the other
|Integer ||[[ClSenderKeyChar| ClSenderKeyChar]]|| In Clomosy, clSenderKeyChar contains a value representing the component that triggered the keyboard event when the event is processed (typically, a keyboard event is tied to a form or a button).
|-
|-
| function || [[CompareText]] || Compare two strings for equality, ignoring case
|Component ||[[ClAnimateFloat|ClAnimateFloat]]||It allows the properties of a component to smoothly transition from one value to another over a specific period of time.
|-
|-
| procedure || [[Delete]] || Delete a section of characters from a string
|Component ||[[ClAnimateFloatWait|ClAnimateFloatWait]]||It allows you to apply animation to the properties of a component or object over a specified duration.
|-
|-
| procedure || [[Insert]] || Insert a string into another string
|Component ||[[ClAnimateFloatDelay|ClAnimateFloatDelay]]||This function allows you to animate a specific property of a component or object over a specified duration.
|-
|-
| function || [[Length]] || Return the number of elements in an array or string
|Component ||[[ClFindComponent | ClFindComponent]]||To find another component under a component or form is used.
|-
|-
| function || [[Pos]] || The Pos function allows you to find the position of a specific substring within another string.
|String ||[[ClGetStringReplace |ClGetStringReplace]]||It is used to replace a character or substring in the text with another character or substring.
|-
|String ||[[ClGetStringTo |ClGetStringTo]]||It is used to retrieve a character in the text or the text that precedes the characters.
|-
|String ||[[ClGetStringAfter |ClGetStringAfter]]||It is used to retrieve a character in the text or the text after the characters.
|-
|String ||[[ClStrToLan |ClStrToLan]]||It performs different operations based on the device's language settings (Language support: Turkish and English).
|-
|Integer ||[[ClMath|ClMath]]||Performs a specific mathematical or numerical operation.
|-
|Integer ||[[ClSenderKey| ClSenderKey]]|| The clSenderKey feature captures the codes of keys on the keyboard that have special functions, excluding standard character keys (a-z, 0-9, etc.), and performs specific actions based on them.
|-
|Integer ||[[clTagInt | clTagInt]]||It is used to store integer value of any object.
|-
|String ||[[clTagStr | clTagStr]]||It is used to store String value of any object.
|-
|-
| function || [[Trim]] || Removes leading and trailing blanks from a string
|function || [[ClFileExists]] || Checks whether a file exists at the specified file path.
|-
|-
| function || [[QuotedStr]] || QuotedStr takes a string and surrounds it with single quotes.
|function || [[ClPathCombine]] || This function returns a string data by concatenating the file path and file name.
|-
|-
| || [[AnsiLowerCase]] ||  
|function || [[ClSaveToFile]] || It performs the operation of saving a file to the specified file path.
|-
|-
| || [[AnsiUpperCase]] ||  
|function || [[ClLoadFromFile]] || This function is used to read text or data from a file.
|-
|-
| function || [[Chr]] || Convert an integer into a character
|procedure || [[ClShowMessage]] || It is a message window created to warn or inform the user, specific to the Clomosy platform.
|}
|}
</div>
</div>
<h2> See Also </h2>
* [[TRObject_Language | TRObject_Language]]
{{#seo:|title=Clomosy System Library - Clomosy Docs}
{{#seo:|description=Understand the System Library in Clomosy. Leverage pre-built resources to enhance application functionality and optimize your development workflow.}}

Latest revision as of 12:37, 17 October 2025



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
function Sin The Sine of a number
function Ln Gives the natural logarithm of a number
function Sqr Gives the square of a number
function SQRT Gives the square root of a number
function Random Generate a random floating point or integer number
function Round Rounds a floating point number to an integer
keyword Mod Performs integer division, returning the remainder
keyword Div The Div keyword gives the whole number result of dividing the Dividend by the Divisor.
procedure Dec Decrement an ordinal variable
procedure Inc Increment an ordinal variable
function Frac The fractional part of a floating point number
function Trunc The integer part of a floating point number
function Odd Tests if an integer is an odd number
function Ord Provides the Ordinal value of an integer, character or enum
function Low Returns the first index of the array.
function High Returns the last index of the array.

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.

Date and Time Functions

Type Name Definition
function Date Returns the current date.
function Time Returns the current time.
function Now Gives the current date and time
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 FormatDateTime It is a function used to return date and time values as a string in a specified format.
function IncMonth Increments a TclDateTime variable by a number of months

Type Conversion Functions

Type Name Definition
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 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
function FormatFloat Converts a floating-point value to a string using a specified pattern

Boolean Functions

Type Name Definition
function Assigned The assigned function checks if a reference is null.
function VarIsNull Indicates whether the specified variant is Null.

System Procedures

Type Name Definition
procedure Beep The Beep procedure creates a very short and quiet sound through the internal speaker of your PC.
procedure GetCurrentLocation

In mobile applications, a function is used to obtain the current location of the device.

Cl Utilities Functions

Usage Context Name Definition
Component CLRTMethod It allows you to determine whether a component is in front of or behind another.
Component ClRTGetProperty This function returns the value of a specific property of a component at runtime.
Component ClRTSetProperty This function allows you to assign a value to a specific property of a component at runtime.
Component ClDoClick It allows you to programmatically click on a component or object.
Component ClSender When an event is triggered, the object associated with that event is referenced via the ClSender property.
Integer ClSenderKeyChar In Clomosy, clSenderKeyChar contains a value representing the component that triggered the keyboard event when the event is processed (typically, a keyboard event is tied to a form or a button).
Component ClAnimateFloat It allows the properties of a component to smoothly transition from one value to another over a specific period of time.
Component ClAnimateFloatWait It allows you to apply animation to the properties of a component or object over a specified duration.
Component ClAnimateFloatDelay This function allows you to animate a specific property of a component or object over a specified duration.
Component ClFindComponent To find another component under a component or form is used.
String ClGetStringReplace It is used to replace a character or substring in the text with another character or substring.
String ClGetStringTo It is used to retrieve a character in the text or the text that precedes the characters.
String ClGetStringAfter It is used to retrieve a character in the text or the text after the characters.
String ClStrToLan It performs different operations based on the device's language settings (Language support: Turkish and English).
Integer ClMath Performs a specific mathematical or numerical operation.
Integer ClSenderKey The clSenderKey feature captures the codes of keys on the keyboard that have special functions, excluding standard character keys (a-z, 0-9, etc.), and performs specific actions based on them.
Integer clTagInt It is used to store integer value of any object.
String clTagStr It is used to store String value of any object.
function ClFileExists Checks whether a file exists at the specified file path.
function ClPathCombine This function returns a string data by concatenating the file path and file name.
function ClSaveToFile It performs the operation of saving a file to the specified file path.
function ClLoadFromFile This function is used to read text or data from a file.
procedure ClShowMessage It is a message window created to warn or inform the user, specific to the Clomosy platform.

See Also

{{#seo:|title=Clomosy System Library - Clomosy Docs}