Misc. functions

Top  Previous  Next

Function name:

Usage:


AllMatch

AllMatch(Value...)

Takes any number of parameters.  Returns true if they all match the first parameter.  Otherwise, it returns false


AllTrue

AllTrue(Expression...)

Takes any number of conditional expressions.  Returns true if all the expressions are true.  Otherwise it returns false.


AnyMatch

AnyMatch(Value...)

Takes any number of parameters.  Returns true if any of the values match the first parameter.  Otherwise, it returns false.


AnyTrue

AnyTrue(Expression...)

Takes any number of conditional expressions.  Returns true if any of the expressions are true.  Otherwise, it returns false.


BinaryFileContent

BinaryFileContent( FilePathAlias, FileName )

Returns the string of a binary file Base64 encoded. The FilePathAlias is defined in the Default .options of the .shared user.

Example:

BinaryFileContent("SampleImages",  "IMAGE_1581.jpg")


DataCount

DataCount ( any ... )

Takes any number of any kind of parameter and returns the number of parameters that have data (ie not null).


GetProfileNum

GetProfileNum (FileName, SectionName, Keyword)

Returns a number from .INI styled file, it will return 'entry not found' if FileName, SectionName or Keyword not found.


GetProfileStr

GetProfileStr (FileName, SectionName, Keyword)

Returns string from .INI styled file, it will return 'entry not found' if FileName, SectionName or Keyword not found.


If

If( Condition, Value1, Value2 )

If the Condition is true, this function returns Value1, otherwise it returns Value2.  This function can be nested as well:  If( Condition1, Value1, If( Condition2, Value2, Value3 ))


NoMatch

NoMatch( Value...)

Takes any number of parameters.  Returns true if no values match the first parameter.  Otherwise, it returns false.


NotNul

NotNul (Value…)

Takes any number of parameters > 1.  Returns breakline if all parameters are Not NULL.


NotZeroCount

NotZeroCount (num…)

Takes a list of numbers and returns the count of how many are not equal to zero.


SetMatch

SetMatch( Value, [...], Compare, [...])

Takes an even number of values.  Splits the list into two parts.  Checks to see if there is one and only one match for each value in the list.

Examples:

(1,2,1,2)=true

(1,2,2,1)=true

(1,1,2,1)=false

(1,1,1,1)=true

(1,2,3,1,1,1)=false

(1,2,3,3,1,2)=true


Case

Takes one parameter and a list of values. Returns the value that matches the parameter. If the parameter is not matched the default value is returned.

The format is Case(<Parameter>,<Check>,<Return>,[<Check>,<Return>,][...]<Default>)

Example:

Case(parmeter, 1, "One", 2,"Two", 3, "Three", "Default - No Match")

 

If parameter = 1 then "One" is returned

If parameter = 2 then "Two" is returned

If parameter = 3 then "Three" is returned

If the parameter does not match any value from the statement then "Default - No Match" is returned.


impRowNodeText

impRowNodeText( aXPath, [ ,[default=""][, changes=""]]

 

Used to specify an XML element field to import. This function imports data from the name of the XML element specified.

 

aXPath: XPath for desired node. In most cases, this will simply be the node name for the value

default: If the node doesn't exist, this value will be returned. (typically an empty string so that a null value will be imported)

changes: A comma-delimited list of from=to values. For example, "255=,x=12,0=" would result in values of 255 being changed to null, x to 12 and 0 to null.

 

Example:

impRowNodeText( "Veh1Dir" )

In this example data from the XML node Veh1Dir is imported. If the node doesn't exist, the value "" (a blank string)  will be returned.

 

Example:

impRowNodeText( "Veh1Dir", "17"  )

In this example data from the XML node Veh1Dir is imported. If the node doesn't exist, the value "17" will be returned.

 

Example:

impRowNodeText( "Veh1Dir", "", "255=,00=0,-=0" )

In this example data from the XML node Veh1Dir is imported. If the node doesn't exist, the value "" (a blank string)  will be returned.  Also, if the value of the node is 255, a blank string will be returned.  And, if the value is "00", a single "0" will be returned.  Finally, if the value is a dash "-", a "0" will be returned.