Child pages
  • Utils

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryReturn the byte array representation of the Base64 valueReturn the String representation of the Base64 valueReturn the Base64 value representation of the byteArrayReturn the string conversion of the byteArrayFormat a date object to a text representation.Returns a string containing the character for the unicode number.Returns true if the (related)foundset exists and has records.Returns true if the Format a date object to a text representation using the format and timezone given.Format a date object to a text representation.Format a date object to a text representation using the format, timezone, language and country given.Returns a string containing the character for the unicode number.Returns true if the (related)foundset exists and has records.Returns true if the (related)foundset exists and has records.Returns true when Monday is the first day of the week for your current locale setting.Format a number to have a defined fraction.Format a number to have a defined fraction.Format a number to specification.Format a number to specification.Parse a string to a date object.Returns the escaped markup text Parse a string to a date object.Parse a string to a date object.Parse a string to a date object.Returns the escaped markup text (HTML/XML).Returns the escaped markup text (HTML/XML).Returns the escaped markup text (HTML/XML).Formats a string according to format specifiers and arguments.Format a string using mask.Replaces a portion of a string with replacement text from a specified index.Returns all words starting with capital chars.Returns a string with the requested number of characters, starting from the left.Returns the number of words, starting from the left.Returns the md5 hash (encoded as base16) for specified text.Returns the md5 hash (encoded as base64) for specified text.Returns a substring from the original string.Returns a substring from the original string.Returns the PBKDF2 hash for specified text.Returns the PBKDF2 hash for specified text.Returns the number of times searchString appears in textString.Returns the position of the string to search for, from a certain start position and occurrence.Replaces a portion of a string with replacement text.Returns the text with %%tags%% replaced, based on provided record or foundset or form.Returns a string with the requested number of characters, starting from the right.Returns the number of words, starting from the right.Return the Base64 representation of the stringReturn the byte array representation of the stringFilters characters out of from a string and leaves digits, returns the number.Filters characters out of from a string and leaves digits, returns the number.Returns the string without leading or trailing spaces.Returns the number of words in the text string.Returns a datestamp from the timestamp (sets hours,minutes,seconds and milliseconds to 0).Validates the given password against the given hash.

functionservoy sDetail2100%height:30px2Methods DetailsdateFormatbase64ToBytesname

dateFormat(date, formatprs

Parameters

sIndentdatethe dateformatthe format to output

base64ToBytes(base64String:)

dessIndent
Format a date object to a text representation.
Return the byte array representation of the Base64 value
prs

Parameters

sIndentbase64String:the Base64 encoded string to convert to byte array
ret

Returns

sIndent byteArray representation of the base64 string using UTF-8 charset for conversion
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
,MobileClientgetUnicodeCharactersam

Sample

sIdentjavascript
lastDetailRow
 base64ToStringname

getUnicodeCharacter

base64ToString(

unicodeCharacterNumber

base64String:)

dessIndent
Returns a string containing the character for the unicode number.
Return the String representation of the Base64 value
prs

Parameters

sIndent
unicodeCharacterNumberthe number indicating the unicode characterhasRecordsbase64String:the Base64 value to convert to Stringret

Returns

sIndent String decoded representation of the Base64 value using UTF-8 charset for conversion
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 bytesToBase64name

hasRecords

bytesToBase64(

foundset

byteArray:)

dessIndent
Returns true if the (related)foundset exists and has records. Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
Return the Base64 value representation of the byteArray
prs

Parameters

sIndent
foundsetthe foundset to be testedbyteArray:the byte array to convert to Base64 valueret

Returns

sIndent Base64 representation of the byte array using UTF-8 charset for conversion
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
,MobileClienthasRecordssam

Sample

sIdentjavascript
lastDetailRow
 bytesToHexname

hasRecords

bytesToHex(

record, relationStringprs

Parameters

sIndentrecordA JSRecord to test.relationStringThe relation name.

bytearray)

dessIndent
Returns true if the (related)foundset exists and has records. Another use is, to pass a record and qualified relations string to test multiple relations/foundset at onceprs

Parameters

sIndentbytearraythe byte array to convert to hex encoded string
ret

Returns

sIndent returns hex encoded string from bytearray
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
,MobileClientisMondayFirstDayOfWeeksam

Sample

sIdentjavascript
lastDetailRow
 bytesToStringname

isMondayFirstDayOfWeek

bytesToString(byteArray:)

dessIndent
Returns true when Monday is the first day of the week for your current locale setting.numberFormat
Return the string conversion of the byteArray
prs

Parameters

sIndentbyteArray:the byte array to convert to
ret

Returns

sIndent string representation of the byte array using UTF-8 charset for conversion
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 dateFormatname

numberFormat

dateFormat(

number

date,

digits

format)

dessIndent
Format a
number to have a defined fraction.prs

Parameters

sIndentnumberthe number to formatdigitsnr of digitsret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascriptlastDetailRow numberFormatname

numberFormat(number, format)

dessIndentFormat a number to specification.prs

Parameters

sIndentnumberthe number to formatformatthe formatret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascriptlastDetailRow parseDatename

parseDate(date, format)

dessIndentParse a string to a date object.prs

Parameters

sIndentdatethe date as textformatthe format to parse the to dateret

Returns

sIndentstringEscapeMarkup
 date object to a text representation.
This will format with the system timezone for the webclient
For NGClient it will use the timezone of the client, the same goes for the Smartclient (but that is the system timezone)
see #dateFormat(Date,String,String) for using the actual clients timezone.

Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'.
Symbols meaning is:
 G        era designator
 y        year
 Y        week year
 M        month in year
 d        day in month
 h        hour in am/pm (1~12)
 H        hour in day (0~23)
 m        minute in hour
 s        second in minute
 S        millisecond
 E        day in week
 D        day in year
 F        day of week in month
 w        week in year
 W        week in month
 a        am/pm marker
 z        time zone
 k        hour in day (1~24)
 K        hour in am/pm (0~11)
prs

Parameters

sIndentdatethe dateformatthe format to output
ret

Returns

sIndent the date as text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
dateFormatname

dateFormat(date, format, timezone)

dessIndent
Format a date object to a text representation using the format and timezone given.
If the timezone is not given the timezone of the client itself will be used.
see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.

Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
Symbols meaning is:
 G        era designator
 y        year
 Y        week year
 M        month in year
 d        day in month
 h        hour in am/pm (1~12)
 H        hour in day (0~23)
 m        minute in hour
 s        second in minute
 S        millisecond
 E        day in week
 D        day in year
 F        day of week in month
 w        week in year
 W        week in month
 a        am/pm marker
 z        time zone
 k        hour in day (1~24)
 K        hour in am/pm (0~11)
prs

Parameters

sIndentdatethe dateformatthe format to outputtimezoneThe timezone string to use to parse the date (like GMT+3), if null then the timezone of the current client is used.
ret

Returns

sIndent the date as text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
dateFormatname

dateFormat(date, format, language, country)

dessIndent
Format a date object to a text representation.
This will format with the system timezone for the webclient
With language and/or country the locale will be created.
For NGClient it will use the timezone of the client, the same goes for the Smartclient (but that is the system timezone)
see #dateFormat(Date,String,String) for using the actual clients timezone.

Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'.
Symbols meaning is:
 G        era designator
 y        year
 Y        week year
 M        month in year
 d        day in month
 h        hour in am/pm (1~12)
 H        hour in day (0~23)
 m        minute in hour
 s        second in minute
 S        millisecond
 E        day in week
 D        day in year
 F        day of week in month
 w        week in year
 W        week in month
 a        am/pm marker
 z        time zone
 k        hour in day (1~24)
 K        hour in am/pm (0~11)
prs

Parameters

sIndentdatethe dateformatthe format to outputlanguagelanguage used to create localecountrycountry used along side language to create the locale
ret

Returns

sIndent the date as text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
dateFormatname

dateFormat(date, format, timezone, language, country)

dessIndent
Format a date object to a text representation using the format, timezone, language and country given.
With the language and country given, the locale will be created.
If the timezone is not given the timezone of the client itself will be used.
see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.

Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
Symbols meaning is:
 G        era designator
 y        year
 Y        week year
 M        month in year
 d        day in month
 h        hour in am/pm (1~12)
 H        hour in day (0~23)
 m        minute in hour
 s        second in minute
 S        millisecond
 E        day in week
 D        day in year
 F        day of week in month
 w        week in year
 W        week in month
 a        am/pm marker
 z        time zone
 k        hour in day (1~24)
 K        hour in am/pm (0~11)
prs

Parameters

sIndentdatethe dateformatthe format to outputtimezonethe timezone to use the format, if null then current client timezone is used.languagelanguage used to create localecountrycountry used along side language to create the locale
ret

Returns

sIndent the date as text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getUnicodeCharactername

getUnicodeCharacter(unicodeCharacterNumber)

dessIndent
Returns a string containing the character for the unicode number.
prs

Parameters

sIndentunicodeCharacterNumberthe number indicating the unicode character
ret

Returns

sIndent a string containing the unicode character
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
hasRecordsname

hasRecords(foundset)

dessIndent
Returns true if the (related)foundset exists and has records.
Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
prs

Parameters

sIndentfoundsetthe foundset to be tested
ret

Returns

sIndent true if exists
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
hasRecordsname

hasRecords(record, relationString)

dessIndent
Returns true if the (related)foundset exists and has records.
Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
prs

Parameters

sIndentrecordA JSRecord to test.relationStringThe relation name.
ret

Returns

sIndent true if the foundset/relation has records.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
hexToBytesname

hexToBytes(hex)

dessIndentprs

Parameters

sIndenthexhex encoded string to be decoded into a byte array.
ret

Returns

sIndent a byte array from hex encoded string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
hexToStringname

hexToString(hex)

dessIndentprs

Parameters

sIndenthex ;
ret

Returns

sIndent returns decoded string from hex
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isMondayFirstDayOfWeekname

isMondayFirstDayOfWeek()

dessIndent
Returns true when Monday is the first day of the week for your current locale setting.
ret

Returns

sIndent true if Monday is first day of the week in current locale
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
numberFormatname

numberFormat(number, digits)

dessIndent
Format a number to have a defined fraction.
prs

Parameters

sIndentnumberthe number to formatdigitsnr of digits
ret

Returns

sIndent the resulting number in text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
numberFormatname

numberFormat(number, digits, language, country)

dessIndent
Format a number to have a defined fraction.
prs

Parameters

sIndentnumberthe number to formatdigitsnr of digitslanguagelanguage used to create localecountrycountry used along side language to create the locale
ret

Returns

sIndent the resulting number in text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
numberFormatname

numberFormat(number, format)

dessIndent
Format a number to specification.
prs

Parameters

sIndentnumberthe number to formatformatthe format
ret

Returns

sIndent the resulting number in text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
numberFormatname

numberFormat(number, format, language, country)

dessIndent
Format a number to specification.
prs

Parameters

sIndentnumberthe number to formatformatthe formatlanguagelanguage used to create localecountrycountry used along side language to create the locale
ret

Returns

sIndent the resulting number in text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
parseDatename

parseDate(date, format)

dessIndent
Parse a string to a date object. This parses the date using the TimeZone of the server
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
prs

Parameters

sIndentdatethe date as textformatthe format to parse the date
ret

Returns

sIndent the date as date object
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
parseDatename

parseDate(date, format, timezone)

dessIndent
Parse a string to a date object. Using the timezone that is given, if null then it formats it with the clients timezone.

see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.

Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
prs

Parameters

sIndentdatethe date as textformatthe format to parse the datetimezoneThe timezone string to use to parse the date (like GMT+3)
ret

Returns

sIndent the date as date object
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
parseDatename

parseDate(date, format, language, country)

dessIndent
Parse a string to a date object. Using language and country that are given,
if null then it formats it with the locale of the client

Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
prs

Parameters

sIndentdatethe date as textformatthe format to parse the datelanguagelanguage used to create localecountrycountry used along side language to create the locale
ret

Returns

sIndent the date as date object
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
parseDatename

parseDate(date, format, timezone, language, country)

dessIndent
Parse a string to a date object. Using the timezone, language and country that are given,
if null then it formats it with the timezone and locale of the client

see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.

Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
prs

Parameters

sIndentdatethe date as textformatthe format to parse the datetimezoneThe timezone string to use to parse the date (like GMT+3)languagelanguage used to create localecountrycountry used along side language to create the locale
ret

Returns

sIndent the date as date object
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
stringEscapeMarkupname

stringEscapeMarkup(textString)

dessIndent
Returns the escaped markup text (HTML/XML).
prs

Parameters

sIndenttextStringthe text to process
ret

Returns

sIndent the escaped text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
stringEscapeMarkupname

stringEscapeMarkup(textString, escapeSpaces)

dessIndent
Returns the escaped markup text (HTML/XML).
prs

Parameters

sIndenttextStringthe text to processescapeSpacesindicating to escape spaces
ret

Returns

sIndent the escaped text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
stringEscapeMarkupname

stringEscapeMarkup(textString, escapeSpaces, convertToHtmlUnicodeEscapes)

dessIndent
Returns the escaped markup text (HTML/XML).
prs

Parameters

sIndenttextStringthe text to processescapeSpacesindicating to escape spacesconvertToHtmlUnicodeEscapesindicating to use unicode escapes
ret

Returns

sIndent the escaped text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
stringFormatname

stringFormat(text_to_format, parameters)

dessIndent
Formats a string according to format specifiers and arguments.
prs

Parameters

sIndenttext_to_formatthe text to formatparametersthe array with parameters
ret

Returns

sIndent the formatted text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
stringFormatname

stringFormat(text, format)

dessIndent
Format a string using mask.
prs

Parameters

sIndenttextthe string to formatformatthe format
ret

Returns

sIndent the resulting text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow lastDetailRowstringIndexReplacename

stringEscapeMarkup(textStringprs

Parameters

sIndenttextStringthe text to process

stringIndexReplace(text, i_start, i_size, replacement_text)

dessIndent
Returns the escaped markup text (HTML/XML).stringEscapeMarkup
Replaces a portion of a string with replacement text from a specified index.
prs

Parameters

sIndenttextthe text to processi_startthe start index to work fromi_sizethe size of the text to replacereplacement_textthe replacement text
ret

Returns

sIndent the changed text string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringInitCapname

stringEscapeMarkup

stringInitCap(

textString, escapeSpaces

text)

dessIndent
Returns the escaped markup text (HTML/XML).
Returns all words starting with capital chars.
prs

Parameters

sIndent
textStringtextthe text to processescapeSpacesindicating to escape spacesstringEscapeMarkupret

Returns

sIndent the changed text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringLeftname

stringEscapeMarkup

stringLeft(

textString, escapeSpaces, convertToHtmlUnicodeEscapes

text, i_size)

dessIndent
Returns
the escaped markup text (HTML/XML).
 a string with the requested number of characters, starting from the left.
prs

Parameters

sIndent
textStringtextthe text to processescapeSpacesindicating to escape spacesconvertToHtmlUnicodeEscapesindicating to use unicode escapesstringFormati_sizethe size of the text to returnret

Returns

sIndent the result text string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringLeftWordsname

stringFormat

stringLeftWords(text

_to_format, parameters

, numberof_words)

dessIndent
Formats a string according to format specifiers and arguments.
Returns the number of words, starting from the left.
prs

Parameters

sIndenttext
_to processnumberof_formatthe text to formatparametersthe array with parametersstringIndexReplacename

stringIndexReplace(text, i_start, i_size, replacement_text)

dessIndentReplaces a portion of a string with replacement text from a specified index.wordsto returnret

Returns

sIndent the string with number of words form the left
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringMD5HashBase16name

stringMD5HashBase16(textString)

dessIndent
Returns the md5 hash (encoded as base16) for specified text.

NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5
prs

Parameters

sIndent
texttextStringthe text to processi_startthe start index to work fromi_sizethe size of the text to replacereplacement_textthe replacement textstringInitCapname

stringInitCap(text)

dessIndentReturns all words starting with capital chars.ret

Returns

sIndent the resulting hashString
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringMD5HashBase64name

stringMD5HashBase64(textString)

dessIndent
Returns the md5 hash (encoded as base64) for specified text.

NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5
prs

Parameters

sIndent
textstringLefttextStringthe text to processret

Returns

sIndent the resulting hashString
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringMiddlename

stringLeft

stringMiddle(text, i_start, i_size)

dessIndent
Returns
a string with the requested number of characters, starting from the left.stringLeftWords
 a substring from the original string.
prs

Parameters

sIndenttextthe text to processi_startthe start index to work fromi_sizethe size of the text to return
ret

Returns

sIndent the result text string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringMiddleWordsname

stringLeftWords

stringMiddleWords(text, i_start, numberof_words)

dessIndent
Returns the number of words, starting from the left.stringMD5HashBase16
Returns a substring from the original string.
prs

Parameters

sIndenttextto processi_startstart word indexnumberof_wordsthe word count to return
ret

Returns

sIndent the string with number of words form the left and
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringPBKDF2Hashname

stringMD5HashBase16

stringPBKDF2Hash(textString)

dessIndent
Returns
the md5 hash (encoded as base16) for specified text. NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5prs

Parameters

sIndenttextStringthe text to processret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRow stringMD5HashBase64name

stringMD5HashBase64(textString)

dessIndentReturns the md5 hash (encoded as base64) for specified text. NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5prs

Parameters

sIndenttextStringthe text to processret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRow stringMiddlename

stringMiddle(text, i_start, i_size)

dessIndentReturns a substring from the original string.prs

Parameters

sIndenttextthe text to processi_startthe start index to work fromi_sizethe size of the text to returnret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRow stringMiddleWordsname

stringMiddleWords(text, i_start, numberof_words)

dessIndentReturns a substring from the original string.prs

Parameters

sIndenttextto processi_startstart word indexnumberof_wordsthe word count to returnret

Returns

sIndent
 the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security.
It uses a default of 9999 iterations. The string that is returned can only be used in the utils.validatePBKDF2Hash(password,thisReturnValue)
to check if this hash is a result of that password.
This will always be false: utils.stringPBKDF2Hash("test") == utils.stringPBKDF2Hash("test"). Because for the same string in multiply calls it will not generate the same hash.
So you can only check it like this: utils.validatePBKDF2Hash("test",utils.stringPBKDF2Hash("test"))

NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2
prs

Parameters

sIndenttextStringthe text to process
ret

Returns

sIndent the resulting hashString
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringPBKDF2Hashname

stringPBKDF2Hash(textString, iterations)

dessIndent
Returns the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security
. It uses a default of 9999 iterations. The string that is returned can only be used in the utils.validatePBKDF2Hash(password,thisReturnValue) to check if this hash is a result of that password. This will always be false: utils.stringPBKDF2Hash("test") == utils.stringPBKDF2Hash("test"). Because for the same string in multiply calls it will not generate the same hash. So you can only check it like this: utils.validatePBKDF2Hash("test",utils.stringPBKDF2Hash("test")) NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2prs

Parameters

sIndenttextStringthe text to processret

Returns

sIndentstringPBKDF2Hash
.

NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2
prs

Parameters

sIndenttextStringthe text to processiterationshow many hash iterations should be done, minimum should be 1000 or higher.
ret

Returns

sIndent the resulting hashString
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
stringPatternCountname

stringPatternCount(text, toSearchFor)

dessIndent
Returns the number of times searchString appears in textString.
prs

Parameters

sIndenttextthe text to processtoSearchForthe string to search for
ret

Returns

sIndent the occurrenceCount that the search string is found in the text
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
stringPositionname

stringPosition(textString, toSearchFor, i_start, i_occurrence)

dessIndent
Returns the position of the string to search for, from a certain start position and occurrence.
prs

Parameters

sIndenttextStringthe text to processtoSearchForthe string to searchi_startthe start index to search fromi_occurrencethe occurrence
ret

Returns

sIndent the position
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringReplacename

stringPBKDF2Hash(textString, iterations)dessIndentReturns the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security. NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2

stringReplace(text, search_text, replacement_text)

dessIndent
Replaces a portion of a string with replacement text.
prs

Parameters

sIndent
textStringtextthe text to processiterationshow many hash iterations should be done, minimum should be 1000 or higher.stringPatternCountsearch_textthe string to searchreplacement_textthe replacement textret

Returns

sIndent the changed text string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringReplaceTagsname

stringPatternCount

stringReplaceTags(text,

toSearchFor

scriptable)

dessIndent
Returns
the number of times searchString appears in textString.
 the text with %%tags%% replaced, based on provided record or foundset or form.
prs

Parameters

sIndenttextthe text tags to
processtoSearchForthe string to search forstringPositionwork withscriptablethe javascript object or foundset,record,form to be used to fill in the tagsret

Returns

sIndentthe text with replaced tags
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringRightname

stringPosition

stringRight(

textString, toSearchFor

text, i_

start, i_occurrence

size)

dessIndent
Returns
the position of the string to search for, from a certain start position and occurrence.
 a string with the requested number of characters, starting from the right.
prs

Parameters

sIndent
textStringtextthe text to processtoSearchForthe string to searchi_startthe start index to search fromi_occurrencethe occurrencestringReplacesizethe size of the text to returnret

Returns

sIndent the result text string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringRightWordsname

stringReplace

stringRightWords(text,

search_text, replacement_text

numberof_words)

dessIndent
Replaces a portion of a string with replacement text.the
Returns the number of words, starting from the right.
prs

Parameters

sIndent
texttextto processsearchnumberof_textthe string to searchreplacement_textthe replacement textstringReplaceTagswordsto returnret

Returns

sIndent the string with number of words form the right
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringToBase64name

stringReplaceTags(text, scriptable

stringToBase64(string:)

dessIndent
Returns the text with %%tags%% replaced, based on provided record or foundset or form.
Return the Base64 representation of the string
prs

Parameters

sIndent
textstring:the text tags to work withscriptablethe javascript object or foundset,record,form to be used to fill in the tagsret

Returns

sIndentstringRightstring to convert to Base64ret

Returns

sIndent Base64 encoded representation of the string using UTF-8 charset for conversion
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringToBytesname

stringRight(text, i_size

stringToBytes(string:)

dessIndent
Returns a string with the requested number of characters, starting from the right.i_sizethe size of the text to returnret

Returns

sIndent
Return the byte array representation of the string
prs

Parameters

sIndent
textthe text to processstringRightWordsstring:the string to convert to bytesret

Returns

sIndent byte array representation of the string using UTF-8 charset for conversion
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringToHexname

stringRightWords(text, numberof_words

stringToHex(string)

dessIndent
Returns the number of words, starting from the right.numberof_wordsto returnprs

Parameters

sIndent
textto processstringString to be encoded into hexret

Returns

sIndent returns hex encoded string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringToNumbername

stringToNumber(textString)

dessIndent
Filters characters out of from a string and leaves digits, returns the number. Uses locale decimal separator.
prs

Parameters

sIndenttextStringthe text to process
ret

Returns

sIndent the resulting number
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringToNumbername

stringToNumber(textString, decimalSeparator)

dessIndent
Filters characters out of from a string and leaves digits, returns the number. Decimal separator is specified as parameter.
prs

Parameters

sIndenttextStringthe text to processdecimalSeparatordecimal separator
ret

Returns

sIndent the resulting number
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringTrimname

stringTrim(textString)

dessIndent
Returns the string without leading or trailing spaces.
prs

Parameters

sIndenttextStringthe text to process
ret

Returns

sIndent the resulting trimmed string
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 stringWordCountname

stringWordCount(text)

dessIndent
Returns the number of words in the text string.
prs

Parameters

sIndenttextthe text to process
ret

Returns

sIndent the word count
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 timestampToDatename

timestampToDate(date)

dessIndent
Returns a datestamp from the timestamp (sets hours,minutes,seconds and milliseconds to 0).
prs

Parameters

sIndentdateobject to be stripped from its time elements
ret

Returns

sIndent the stripped date object
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
 validatePBKDF2Hashname

validatePBKDF2Hash(password, hash)

dessIndent
Validates the given password against the given hash. The hash should be generated by one of the stringPBKDF2Hash(password [,iteration]) functions. If hash is null or empty string the method will return false.

NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2
prs

Parameters

sIndentpasswordthe password to test againsthashthe hash the password needs to validate to.
ret

Returns

sIndent true if his hash is valid for that password
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow