10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

THow Procedure Handles Work (ProcHandle Objects)The _StringParseKeyword ProcedureThe _StringParseKeyword procedure returns the value of the specified keywordin a specially formatted string. This string's format is:“keyword1=value1[;keyword2=value2]”The equal sign separates a keyword from its value. The semicolon must beused to separate the end of a value from the next keyword. There is no spaceallowed before or after the equal sign. Everything between the semicolon (orthe beginning of the string) and the equal sign is treated as part of thekeyword. The last value does not have to end with the semicolon. If a valuehas trailing white space, it will be trimmed. Leading and embedded whitespace is retained.The search for the keyword is not case sensitive. Trailing white space onkeyword is trimmed before the search begins. If the keyword is found, itsvalue is returned. If either the string or the keyword argument is empty, anempty string is returned.Example syntax for the _StringParseKeyword procedure is:varchar(2000) = _StringParseKeyword(string = varchar(2000),keyword = varchar(32);)The following is an example of how to use the _StringParseKeyword procedureto find the value of a keyword:str1 = 'Name=John Doe;Address=101 California, USA';value=_StringParseKeyword(string = str1,keyword = 'address');The _StringSub ProcedureThis example returns the string “101 California, USA”.This procedure substitutes values for parameters that are embedded in aspecially formatted string. It also substitutes “\t” with HC_TAB, and “\n” withHC_NEWLINE.The string must be a varchar string embedded with parameters in the formatof “%1”, “%2”, and so forth, up to “%9”, as well as “\t” and “\n”. A parametercan occur multiple times in the string.90 <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!