UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Examples In the following example, the program segment begins with an array of two values, each with two subvalues. The SUM function sums the subvalues and returns a string with two numeric values. 1-890 UniBasic Commands Reference NUM.ARRAY = 12:@SM:10:@VM:15:@SM:15 VAL1 = SUM(NUM.ARRAY) This results in: VAL1 = 22:@VM:30 In the next example, the program statement sums VAL1 and returns the numeric value 52 with no dynamic array delimiters: VAL1 = SUM(VAL1)
SWAP Syntax SWAP str.expr1 WITH str.expr2 IN var Description The UniBasic SWAP command replaces all occurrences of one substring with a second substring. The search string does not have to be the same length as the replacement string. SWAP supports mulitbyte languages. Tip: CONVERT compares and replaces substrings on a character-by-character basis. CONVERT cannot exchange strings of different lengths. Parameters The following table describes each parameter of the syntax. Parameter Description str.expr1 Specifies the string expression to replace with str.expr2. str.expr2 Specifies the string expression with which to replace str.expr1. IN var Specifies the variable in which to replace str.expr1 with str.expr2. SWAP Parameters Examples In the following example, the program segment replaces all occurrences of the string “AB” with the string “AZ” in the variable VAR. The new string assigned to VAR is “THE TAZ WAS GRAZBED”. VAR = "THE TAB WAS GRABBED" SWAP "AB" WITH "AZ" IN VAR SWAP 1-891
- Page 882 and 883: Example This example shows how you
- Page 884 and 885: ODBC Data Sources If you execute a
- Page 886 and 887: SQLRowCount Syntax status = SQLRowC
- Page 888 and 889: SQLSetConnectOption Syntax status =
- Page 890 and 891: Return Values The following table d
- Page 892 and 893: SQLSetParam SQLSetParam is a synony
- Page 894 and 895: For complete details about the SQLS
- Page 896 and 897: 1-854 UniBasic Commands Reference C
- Page 898 and 899: Parameter Description tablename Nam
- Page 900 and 901: TYPE Smallint Not null 1-858 UniBas
- Page 902 and 903: SQLTables Syntax status = SQLTables
- Page 904 and 905: Return Values The following table d
- Page 906 and 907: Parameters The following table desc
- Page 908 and 909: SQRT Syntax SQRT(num.expr) Descript
- Page 910 and 911: SSUB Syntax SSUB(x, y) Description
- Page 912 and 913: STOP Syntax STOP [expr] Description
- Page 914 and 915: STR Syntax STR(str.expr, num.expr)
- Page 916 and 917: STRS Syntax STRS(dyn.array, expr) D
- Page 918 and 919: If the response status indicates th
- Page 920 and 921: SUBROUTINE Syntax SUBROUTINE sub.na
- Page 922 and 923: SUBROUTINE (Update Trigger) Syntax
- Page 924 and 925: Tip: The UniBasic STATUS function r
- Page 926 and 927: SUBROUTINE (Delete Trigger) Syntax
- Page 928 and 929: Tip: The UniBasic STATUS function r
- Page 930 and 931: Related Commands UniBasic DEL, INSE
- Page 934 and 935: In the next example, SWAP does not
- Page 936 and 937: Parameter Description 1-894 UniBasi
- Page 938 and 939: Parameter Description 1-896 UniBasi
- Page 940 and 941: TAN Syntax TAN(num.expr) Descriptio
- Page 942 and 943: TIMEDATE Syntax TIMEDATE( ) Descrip
- Page 944 and 945: Example In the following example, t
- Page 946 and 947: Parameters The following table desc
- Page 948 and 949: TRANSACTION START Syntax TRANSACTIO
- Page 950 and 951: TRIM Syntax TRIM(str.expr[,char[,ty
- Page 952 and 953: Related Commands UniBasic TRIMB, TR
- Page 954 and 955: TRIMF Syntax TRIMF(str.expr) Descri
- Page 956 and 957: Example In the following example, t
- Page 958 and 959: Parameters The following table desc
- Page 960 and 961: UNLOCK Syntax UNLOCK [num.expr] Des
- Page 962 and 963: UPCASE Syntax UPCASE(string.expr) D
- Page 964 and 965: Related Commands UniBasic PAUSE Uni
- Page 966 and 967: STATUS Function Return Values After
- Page 968 and 969: Related Commands UniBasic CLOSESEQ,
- Page 970 and 971: 1-903 UniBasic Commands Reference
- Page 972 and 973: Related Commands UniBasic CLOSE, DE
- Page 974 and 975: UniData SQL SELECT - For informatio
- Page 976 and 977: Parameter Description Example In th
- Page 978 and 979: Parameter Description Example In th
- Page 980 and 981: The following table describes the r
Examples<br />
In the following example, the program segment begins with an array of two values,<br />
each with two subvalues. The SUM function sums the subvalues and returns a string<br />
with two numeric values.<br />
1-890 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />
NUM.ARRAY = 12:@SM:10:@VM:15:@SM:15<br />
VAL1 = SUM(NUM.ARRAY)<br />
This results in:<br />
VAL1 = 22:@VM:30<br />
In the next example, the program statement sums VAL1 and returns the numeric<br />
value 52 with no dynamic array delimiters:<br />
VAL1 = SUM(VAL1)