Intrinsic Conversions
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    v BEE Variables
       > BEE Variable Name
       o BEE Variable Value
       v BEE Conversions
          o Intrinsic Conversions
          o User-defined Conversions
          o To string or not to string
    > BEE Syntax
    > BEE Commands
    > Database Operation
    > Content Management
    > Objects and Classes
    > Interface with others
    o Glossary
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> Reference >> BEE Variables >> BEE Conversions >> Intrinsic Conversions <=  =>      <  1  2  3  4  5  6  >  
r to s Conversions built into BEE

Conversion

Input Type

Output Type

Description

regexp

String

String

Return a regular expression that the underlying database platform can understand, from the "common" regular expression contained in the input string.  e.g. Common regular expression "a*b" will be converted to "^a.*b$".

repeat

String

String

Concatenate the input string to itself a number of times as specified in the argument string and return the result.

replace

String

String

Take the argument string as a comma-delimited list of two arguments, then find all occurrences of the first argument in the input string and replace them with the second argument.

replacere

String

String

Take the argument string as a comma-delimited list of two arguments, then find from the input string all matches of the regular expression contained in the first argument and replace them with the second argument.

If the regular expression contains small brackets, $num in the second argument will be replaced by the matching content of the "num"th brackets in the regular expression.

reverse

Array

Array

Returns an array in reverse order of the input array (both the value and the key.)  That is the last element would become the first and the first would become the last.

round

String

String

Round the input string as a floating point number to the precision (number of digits after the decimal point) specified in the argument string.

search

Array

String

Search the input array for an element having the same value as the argument string and return the key of that element.  If not found, return the second argument, or null if none is specified.

sectohms

String

String

Convert a duration from the number of seconds to the H:M:S format.  e.g. 9296 to 2:34:56

setkeys

Array

Array

Take the argument string as an array specification and use them to replace the keys in the input array, the return the result array.

If there're duplicated keys in the argument array, all elements assigned with that key will be overwritten by the last one, but it will take the position of the first one.

If there're more keys than are required, the excessive keys in the argument array will be ignored.

If there're less keys than are required, the excessive elements in the input array will all have the blank key, and the last blank-keyed element will prevail taking the position of the first blank-keyed element.

setvalue

Array

Array

Set all the elements in the input array to the argument string and return the result array.

shift

Array

String

Take the first element of the input array away, and return that element.

This input array is passed by reference.  It must be either a variable as in:

var a conv=shift;

or a value casted as a variable as in:

var a = "(var)arr" conv=shift;

shuffle

Array

Array

Randomise the position of the input array, and return the result array.

If the argument string is "key" or "keys", only the keys are randomised.  If "value" or "values", only the values are randomised.  If "all" or "both", the keys and the values are both randomised.

slice

Array

Array

The argument string is taken as a comma-delimited list of two arguments: offset and length.  The input array is then "stripped" starting from the offset position (first element is 0) until the number of elements specified by "length" is collected, or the end of the input array if "length" is not specified, or "length" elements before the end if "length" is negative.

sort

Array

Array

Sort the input array then return the sorted array as the result.

The argument string is taken as a comma-delimited list of arguments, which has the following effects:

value (default): keep key-value association

valueonly: sort values only ignoring all keys

key: sort the keys (only if "valueonly" is not set)

reverse (or rev): sort in reverse order

numeric: sort in numeric order

string: sort in string order (only if "numeric" is not set)

split

String

Array

Take the input string as a space-delimited list and split the list into an array of its elements in the same order.  If a argument string is specified, it will be used as the delimiter instead of space.

strtotime

String

String

Convert a date-time string in the input string into timestamp format (number of seconds since 1 Jan, 1970 GMT).  Common language like yesterday, next friday, last week, 3 months, -2 years, etc.

stringtoarray

String

Array

Convert the input string into an array of which each element contains a character of the corresponding position in the input string.  (Element 0 is the first character.)

strtoarr

String

String

Same as "stringtoarray"

strftime

String

String

Convert a timestamp (number of seconds since 1 Jan, 1970) in the input string into the format specified in the argument string, according to the standard of the Unix "date" command.  (Default argument is "%c".)

strlen

String

String

The length of the input string.  (This is useful to avoid the ambiguity of the sizeof operator ('#') which may be applied to an array, as "strlen" work on string only.)

strpos

String

String

Search the input string for the argument string and return the position if found (0 is the first character).  If not found, return -1.

You can optionally specify the second argument, which is the position in the input string where the search starts.

substr

String

String

Return a sub-string of the input string starting from the position indicated by the number in the argument string.  The first character is position 0.  The argument string may contain the maximum sub-string length in the optional second argument separated from the first one by a comma.  If the length is not specified, the sub-string will extend to the end of the input string.

substring

String

String

Same as "substr"

succeed

String

String

Return the input string appended with the argument string if the input string is not null.  Otherwise, return null.

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd