## Data transformation language

**Sqr(X)**

the Sqr function returns the square of the argument. X is a floating-point expression. The result, of the same type as X, is the square of X, or X*X.

**Sqrt(X)**

The result is the square root of X.

**Exp(X)**

Exp returns the value of e raised to the power of X, where e is the base of the natural logarithms

**Ln(X)**

Ln returns the natural logarithm (Ln(e) = 1) of the real-type expression X.

**Sin(X)**

Sin returns the sine of the angle X in radians.

**Cos(X)**

Cos returns the cosine of the angle X. X expression that represents an angle in radians

**Tan(X)**

Tan returns the tangent of X. Tan(X) = Sin(X) / Cos(X).

**ArcTan(X)**

ArcTan returns the arctangent of X. X is a real-type expression that gives an angle in radians**PI**

Represents the mathematical value pi, the ratio of a circle's circumference to its diameter. Pi is approximated as 3.1415926535897932385.**ArcCos(X)**

ArcCos returns the inverse cosine of X. X must be between -1 and 1. The return value is in the range [0..Pi], in radians.**ArcCosh(X)**

ArcCosh returns the inverse hyperbolic cosine of X. The value of X must be greater than or equal to 1.**ArcCot(X)**

ArcCot returns the inverse cotangent of X.**ArcCotH(X)**

ArcCot returns the inverse hyperbolic cotangent of X.**ArcCsc(X)**

ArcCsc returns the inverse cosecant of X.**ArcCscH(X)**

ArcCsc returns the inverse hyperbolic cosecant of X.**ArcSec(X)**

ArcSec returns the inverse secant of X.**ArcSecH(X)**

ArcSec returns the inverse hyperbolic secant of X.**ArcSin(X)**

ArcSin returns the inverse sine of X. X must be between -1 and 1. The return value will be in the range [-Pi/2..Pi/2], in radians.**ArcSinh(X)**

ArcSinh returns the inverse hyperbolic sine of X.**ArcTan(X)**

ArcTan returns the arctangent of X. X is a real-type expression that gives an angle in radians.**ArcTanh(X)**

ArcTanh returns the inverse hyperbolic tangent of X. The value of X must be between -1 and 1 (inclusive).**Cosecant(X)**

Use the Cosecant to calculate the cosecant of X, where X is an angle in radians. The cosecant is calculated as 1/ Sin(X).**Cosh(X)**** Use the Cosh to calculate the hyperbolic cosine of X.****Cot(X)**

Call Cot to obtain the cotangent of X. The cotangent is calculated using the formula 1 / Tan (X).**Cotan(X)**

Call Cotan to obtain the cotangent of X. The cotangent is calculated using the formula 1 / Tan (X)

Do not call Cotan with X = 0**CotH(X)**

Call CotH to obtain the hyperbolic cotangent of X, where X is an angle in Radians.**Csc(X)**

Use the Csc to calculate the cosecant of X, where X is an angle in radians.**CscH(X)**

Use the CscH to calculate the hyperbolic cosecant of X, where X is an angle in radians.**CycleToDeg(X)**

CycleToDeg converts angles measured in cycles into degrees, where degrees = cycles * 360.**CycleToGrad(X)**

CycleToGrad converts angles measured in cycles into grads.**CycleToRad(X)**

CycleToRad converts angles measured in cycles into radians, where radians = 2pi * cycles.**DegToCycle(X)**

Use DegToCycle to convert angles expressed in degrees to the corresponding value in cycles.**DegToGrad(X)**

Use DegToGrad to convert angles expressed in degrees to the corresponding value in grads.**DegToRad(X)**

Use DegToRad to convert angles expressed in degrees to the corresponding value in radians, where radians = degrees(pi/180).**GradToCycle(X)**

GradToCycle converts angles measured in grads into cycles.**GradToDeg(X)**

GradToDeg converts angles measured in grads into degrees.**GradToRad(X)**

GradToRad converts angles measured in grads into radians, where radians = grads(pi/200).**Hypot(X,Y)**

Hypot returns the length of the hypotenuse of a right triangle. Specify the lengths of the sides adjacent to the right angle in X and Y. Hypot uses the formula Sqrt(X**2 + Y**2)**IntPower(Base,Exponent)**

IntPower raises Base to the power specified by Exponent.**Ldexp(X)**

Ldexp returns X times (2 to the power of P).**LnXP1(X)**

LnXP1 returns the natural logarithm of (X+1). Use LnXP1 when X is a value near 0.**Log10(X)**

Log10 returns the log base 10 of X.**Log2(X)**

Log2 returns the log base 2 of X.**LogN(Base,X)**

LogN returns the log base Base of X.**Power(Base,Exponent)**

Power raises Base to any power. For fractional exponents or exponents greater than MaxInt, Base must be greater than 0.**RadToCycle(X)**

Use RadToCycle to convert angles measured in radians into cycles, where cycles = radians/(2pi).**RadToDeg(X)**

Use RadToDeg to convert angles measured in radians to degrees, where degrees = radians(180/pi).**RadToGrad(X)**

Use RadToGrad to convert angles measured in radians to grads, where grads = radians(200/pi).**RandG(Mean,StdDev)**

RandG produces random numbers with Gaussian distribution about the Mean. This is useful for simulating data with sampling errors and expected deviations from the Mean.**Sec(X)**

Call Sec to obtain the secant of X, where X is an angle in radians. The secant is calculated using the formula 1 / Cos(X).**SecH(X)**

Call SecH to obtain the hyperbolic secant of X, where X is an angle in Radians.**Sinh(X)**

Sinh calculates the hyperbolic sine of X.**Tan(X)**

Tan returns the tangent of X. Tan(X) = Sin(X) / Cos(X).**Tanh(X)**

Tanh calculates the hyperbolic tangent of X.

**Abort**

Use Abort to escape from an execution path without reporting an error.**Beep**

Beep generates a conventional message beep.**Break**

The Break procedure forces a jump out of the set of statements within a loop**Continue**

The Continue procedure forces a jump past the remaining statements within a loop, back to the next loop iteration**Exit**

The Exit procedure abruptly terminates the current function or procedure.

#### Next Math functions

**Iif(expr1=expr2;expr3;expr4)**

Iif function returns expr3 or expr4 depending on expr1=expr2**GetSystemVariable(VariableName)**

GetSystemVariable returns value of 'VARIABLENAME'.

Possible values for 'VARIABLENAME' are:

COMPUTERNAME

OSUSERNAME

DBUSERNAME

BLOCKNUMBER

LINENUMBER

RECORDNUMBER

SYSTEM_DATE

SOURCE_FILE_NAME

SOURCE_TABLE_NAME**GetSystemDate(Format)**

Returns Current system date/time in format specified

GetSystemDate('MMDDYYYY')**Pos(Substr,S)**

Pos searches for Substr within String and returns an integer value that is the index of the first character of Substr within String. Pos is case-sensitive. If Substr is not found, Pos returns zero.**AnsiPos(Substr,S)**

Call AnsiPos to obtain the byte offset of the Substr parameter, as it appears in the string S. For example, if Substr is the string "AB", and S is the string "ABCDE", AnsiPos returns 1. If Substr does not appear in S, AnsiPos returns 0.**Chr(X)**

Returns the character for a specified ASCII value.**Length(X)**

Returns the number of characters in a string or elements in an array.**Pos(Substr,Str)**

Pos searches for Substr within S and returns an integer value that is the index of the first character of Substr within S. Pos is case-sensitive. If Substr is not found, Pos returns zero**SetLength(S,Length)**

Set Length of dynamic array or string**High(X)**

Call High to obtain the upper limit of an Array**Low(X)**

Call Low to obtain the lowest value or first element of an Array.

#### Next Procedures

**Round(Float,Integer)**

Use Round to round Value to a specified power of ten.

The following examples illustrate the use of Round:

Expression Value

Round(1234567, 3) 1234000

Round(1.234, -2) 1.23

Round(1.235, -2) 1.24

Round(1.245, -2) 1.24**Sign(I) **

Use Sign to test the sign of a numeric value.

Sign returns

0 if AValue is zero.

1 if AValue is greater than zero.

-1 if AValue is less than zero.**Abs(X)**

Returns an absolute value.**Trunc(X)**

Truncates a real number to an integer.**Ceil(X)**

Call Ceil to obtain the lowest integer greater than or equal to X. The absolute value of X must be less than MaxInt. For example: Ceil(-2.8) = -2 Ceil(2.8) = 3 Ceil(-1.0) = -1**Floor(X)**

Call Floor to obtain the highest integer less than or equal to X. For example: Floor(-2.8) = -3 Floor(2.8) = 2 Floor(-1.0) = -1**RandomRange(AFrom,ATo)**

RandomRange returns a random integer from the range that extends between AFrom and ATo (non-inclusive). RandomRange can handle negative ranges (where AFrom is greater than ATo). To initialize the random number generator, add a single call Randomize or assign a value to the RandSeed variable before making any calls to RandomRange.**Max(A,B)**

Call Max to compare two numeric values. Max returns the greater value of the two.

Min(A,B)

Call Min to compare two numeric values in Delphi. Min returns the smaller value of the two.

#### Next Miscellaneous Functions

**Day(Date,Format) **

Use Day to get the day part of a date value.

Day('01012003','DDMMYYYY')**Hour(Date,Format)**

Use Hour to get the hour part of a date value.

Hour('01012003','DDMMYYYY')**Minute(Date,Format) **

Use Minute to get the minute part of a date value.

Minute('01012003','DDMMYYYY')**Month(Date,Format) **

Use Month to get the month part of a date value.

Month('01012003','DDMMYYYY')**Second(Date,Format) **

Use Second to get the second part of a date value.

Second('01012003','DDMMYYYY')**Year(Date,Format) **

Use Year to get the year part of a date value.

Year('01012003','DDMMYYYY')**DayS(Date,Format) **

Use DayS to get the day part of a date value as string.

DayS('01012003','DDMMYYYY')**HourS(Date,Format) **

Use HourS to get the hour part of a date value as string.

HourS('01012003','DDMMYYYY')

**MinuteS(Date,Format) **

Use MinuteS to get the minute part of a date value as string.

MinuteS('01012003','DDMMYYYY')**MonthS(Date,Format) **

Use MonthS to get the month part of a date value as string.

MonthS('01012003','DDMMYYYY')**SecondS(Date,Format) **

Use SecondS to get the second part of a date value as string.

SecondS('01012003','DDMMYYYY')**YearS(Date,Format) **

Use YearS to get the year part of a date value as string.

YearS('01012003','DDMMYYYY')**IncDateS (Date,Format,ChangeType,Increment)**

ChangeType: YEAR,MONTH,WEEK,DAY,HOUR,MINUTE,SECOND

Use IncDateS to Increase ChangeType part of a date value by an Increment.

IncDateS ('01012003','DDMMYYYY', 'YEAR',1)**DecDateS(Date,Format,ChangeType,Decrement) **

ChangeType: YEAR,MONTH,WEEK,DAY,HOUR,MINUTE,SECOND

Use DecDateS to Decrease ChangeType part of a date value by an Decrement.

DecDateS ('01012003','DDMMYYYY', 'YEAR',1)**EncodeDate(Year,Month,Day)**

EncodeDate returns a TDateTime value from the values specified as the Year, Month, and Day parameters. The year must be between 1 and 9999. Valid Month values are 1 through 12. Valid Day values are 1 through 28, 29, 30, or 31, depending on the Month value. For example, the possible Day values for month 2 (February) are 1 through 28 or 1 through 29, depending on whether or not the Year value specifies a leap year.**EncodeTime(Hour,Min,Sec,MSec)**

EncodeTime encodes the given hour, minute, second, and millisecond into a TDateTime value. Valid Hour values are 0 through 23. Valid Min and Sec values are 0 through 59. Valid MSec values are 0 through 999. If the specified values are not within range, EncodeTime raises an EConvertError exception. The resulting value is a number between 0 and 1 (inclusive) that indicates the fractional part of a day given by the specified time or (if 1.0) midnight on the following day. The value 0 corresponds to midnight, 0.5 corresponds to noon, 0.75 corresponds to 6:00 pm, and so on.**DayOfWeek(D)**

DayOfWeek returns the day of the week of the specified date as an integer between 1 and 7, where Sunday is the first day of the week and Saturday is the seventh.**Date**

Use Date to obtain the current local date as a TDateTime value. The time portion of the value is 0 (midnight).**Time**

Use Time to return the current time as a TDateTime value. The two functions are completely equivalent.**Now**

Returns the current date and time.**IncMonth(D)**

IncMonth returns the value of the Date parameter, incremented by NumberOfMonths months. NumberOfMonths can be negative, to return a date N months previous. If the input day of month is greater than the last day of the resulting month, the day is set to the last day of the resulting month. The time of day specified by the Date parameter is copied to the result.**IsLeapYear(D)**

Call IsLeapYear to determine whether the year specified by the Year parameter is a leap year. Year specifies the calendar year. Use YearOf to obtain the value of Year for IsLeapYear from a TDateTime value.**DateToStr(D)**

Use DateToStr to obtain a string representation of a date value that can be used for display purposes.**TimeToStr(D)**

TimeToStr converts the Time parameter, a TDateTime value, to a string.

DateTimeToStr(D)

Converts a TDateTime value to a string.**StrToDate(S)**

Call StrToDate to parse a string that specifies a date. If S does not contain a valid date, StrToDate raises an exception.**StrToTime(S)**

Call StrToTime to parse a string that specifies a time value. If S does not contain a valid time, StrToTime raises an exception.**StrToDateTime(S)**

Call StrToDateTime to parse a string that specifies a date and time value. If S does not contain a valid date, StrToDateTime raises an exception.**FormatDateTime(Format,DateTime)**

FormatDateTime formats the TDateTime value given by DateTime using the format given by Format. See the table below for information about the supported format strings.

We have 208 guests and no members online