From Clomosy Docs

No edit summary
No edit summary
Line 162: Line 162:
|}
|}
</div>
</div>


<h2> Type Conversion Functions </h2>
<h2> Type Conversion Functions </h2>
 
<div class="table-responsive">
{| class="wikitable"
{| class="wikitable" style="border: 2px solid #c3d7e0"
|+ Conversion Functions(Type Conversions)
! style="background-color: #c3d7e0"| Type !!style="background-color: #c3d7e0"| Name !!style="background-color: #c3d7e0"|Definition
|-
! Type !! Name !! Summary
|-
|-
| function  || [[DateTimeToStr]] || Converts TclDateTime date and time values to a string
| function  || [[DateTimeToStr]] || Converts TclDateTime date and time values to a string
Line 200: Line 194:
| function  || [[TimeToStr]] || Converts a TclDateTime time value to a string
| function  || [[TimeToStr]] || Converts a TclDateTime time value to a string
|}
|}
</div>

Revision as of 08:54, 8 October 2024

  • Allows searching, merging, and editing text. String functions simplify text manipulation in your application.

  • Performs basic operations like addition, subtraction, multiplication, and more complex calculations.

  • Functions for managing input-output operations with message windows.
  • Provides functions to retrieve the current date and time, format dates, and manage time-related operations.

  • Type Converts data types, such as converting a number to a string.



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

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 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