REUSE(dyn.array.expr)
Description
The UniBasic REUSE function affects the application of arithmetic operations on dynamic arrays.
When REUSE Is Not Used
When you execute an arithmetic operation on an array and you do not include the REUSE function, one of the following happens:
■Array and constant – When you apply an arithmetic operation to an array and a constant, the operation is executed against only the first element of the array. If you want the operation to execute on every element in the array, apply REUSE to the constant.
■Two arrays – When you execute an arithmetic operation on arrays of different lengths, the operation is performed on the number of elements in the shortest array only. The remaining elements are each filled with 1 or 0, depending on the operation performed:
■Division – 1.
■Addition, subtraction, and multiplication – 0.
If you apply REUSE to the shorter array, the last element in this array is used to perform the operation on the remaining elements in the longer array.
1-690 UniBasic Commands Reference
Examples
In the following example, the program segment multiplies the arrays without using the REUSE function:
VIEWERS = 100:@VM:200:@VM:300
COST = 40:@VM:1
VCOST = VIEWERS*COST
This results in:
VCOST = 4000:@VM:200:@VM:0
VCOST takes its length from VIEWERS, the longest of the two arrays, but multiplication is performed on only the first two elements of each array because the other array, COST, has only two elements. The final element in the result array (VCOST) is filled with 0. 0 is used to fill because the arithmetic operation is multiplication.
However, if you apply the REUSE function to the shorter array:
VCOST = VIEWERS*REUSE(COST)
This results in:
VCOST = 4000:@VM:200:@VM:300
The final element in COST (1) is used to multiply with the final element of VIEWERS and fill the final element of the result array, VCOST.
Wednesday, February 28, 2007
SUBR Function IN Unidata
SUBR Function
The SUBR function to calls a UniBasic subroutine from a virtual attribute. The UniBasic subroutine can be one you have written, or one of the UniData-supplied subroutines. The subroutine must be compiled and cataloged before being called from a virtual attribute. See Developing UniBasic Applications for information about compiling and cataloging UniBasic subroutines.
Attribute 2 of a virtual attribute calls a UniBasic subroutine using the following syntax:
SUBR(“subroutine”,argument1[,argumentN...])
where subroutine is the name of the UniBasic subroutine you are calling, and argument is the value you are passing to the subroutine. The SUBR function call must have the same number of arguments as the subroutine you are calling. The called subroutine returns one argument, which may be multivalued or multi-subvalued.
5-18
In the following example, the ZIP virtual attribute in the dictionary of the CLIENTS file calls the PSTLCODE_FMT subroutine:
:AE DICT CLIENTS ZIP
Top of "ZIP" in "DICT CLIENTS", 7 lines, 50 characters.
*--: P
001: V
002: SUBR("PSTLCODE_FMT",@RECORD)
003:
004: Postal Code
005: 10R
006: S
Bottom.
The SUBR function to calls a UniBasic subroutine from a virtual attribute. The UniBasic subroutine can be one you have written, or one of the UniData-supplied subroutines. The subroutine must be compiled and cataloged before being called from a virtual attribute. See Developing UniBasic Applications for information about compiling and cataloging UniBasic subroutines.
Attribute 2 of a virtual attribute calls a UniBasic subroutine using the following syntax:
SUBR(“subroutine”,argument1[,argumentN...])
where subroutine is the name of the UniBasic subroutine you are calling, and argument is the value you are passing to the subroutine. The SUBR function call must have the same number of arguments as the subroutine you are calling. The called subroutine returns one argument, which may be multivalued or multi-subvalued.
5-18
In the following example, the ZIP virtual attribute in the dictionary of the CLIENTS file calls the PSTLCODE_FMT subroutine:
:AE DICT CLIENTS ZIP
Top of "ZIP" in "DICT CLIENTS", 7 lines, 50 characters.
*--: P
001: V
002: SUBR("PSTLCODE_FMT",@RECORD)
003:
004: Postal Code
005: 10R
006: S
Bottom.
Tuesday, February 20, 2007
ODBC settting for UNIDATA
From OLDB.pdf
To access a remote database on a different platform, you must add an entry to the
configuration file. For example, if the remote system you want to access is named
hq1 and the account path is /usr/myacct, make up a data source name such as corp1
and add the data source definition to uci.config as follows:
DBMSTYPE = UNIDATA
NETWORK = TCP/IP
SERVICE = udserver
HOST = hq1
ACCOUNT = /usr/myacct
USERNAME = myloginname
The ACCOUNT parameter can be set to any one of the following:
1) The full path to a UniData or UniVerse account.
2) A valid UniVerse schema name.
3) A valid UniData database name.
A UniData database name is valid if it appears as an entry in the ud_database file. For
UNIX systems, this file is located in the /usr/udnn/include path, where nn is the
release of UniData you are running. For Windows platforms, it is located in
\udthome\include. For examples of database entries in the ud_database file, see
Chapter 3, “Accessing UniData Data.”
Note: If you modify uci.config by using a text editor, make sure you surround the
equal signs with spaces.
To access a remote database on a different platform, you must add an entry to the
configuration file. For example, if the remote system you want to access is named
hq1 and the account path is /usr/myacct, make up a data source name such as corp1
and add the data source definition to uci.config as follows:
DBMSTYPE = UNIDATA
NETWORK = TCP/IP
SERVICE = udserver
HOST = hq1
ACCOUNT = /usr/myacct
USERNAME = myloginname
The ACCOUNT parameter can be set to any one of the following:
1) The full path to a UniData or UniVerse account.
2) A valid UniVerse schema name.
3) A valid UniData database name.
A UniData database name is valid if it appears as an entry in the ud_database file. For
UNIX systems, this file is located in the /usr/udnn/include path, where nn is the
release of UniData you are running. For Windows platforms, it is located in
\udthome\include. For examples of database entries in the ud_database file, see
Chapter 3, “Accessing UniData Data.”
Note: If you modify uci.config by using a text editor, make sure you surround the
equal signs with spaces.
Monday, February 19, 2007
XDSD Report
From Benefactor Main Menu,
DEFINE REPORT CONTROL:BA-CTL-W01.XDSD
DEFINE REPORT FIELDS : BA-DEF-W01.XDSD
AE REPORTS W01.XDSD
AE REP.PGM PARMS.XDSD
There are several $INSERT used in PARMS.XDSD. The biggest one has more than 1 thousand records. Peter said it is created by a report tool. He recommands to learn XDR.
UT.INSERTS is a DIR type of record in VOC.
F.VOC is equated to SAF.VARS(3,2). But SAF.VARS(3,2) can't be found.
DEFINE REPORT CONTROL:BA-CTL-W01.XDSD
DEFINE REPORT FIELDS : BA-DEF-W01.XDSD
AE REPORTS W01.XDSD
AE REP.PGM PARMS.XDSD
There are several $INSERT used in PARMS.XDSD. The biggest one has more than 1 thousand records. Peter said it is created by a report tool. He recommands to learn XDR.
UT.INSERTS is a DIR type of record in VOC.
F.VOC is equated to SAF.VARS(3,2). But SAF.VARS(3,2) can't be found.
Create a folder and copy files in Unidata
It's a simple procedure, but take me 1 hour to do it.
I created a folder RL.PGM first in Unidata by SSH, and run
COPY FROM VOC TO RL.PGM W01.RL.01.
It is wrong.
Finally I found I have to create the folder using code
CREATE.FILE DIR RL.PGM .
This time everything is fine.
I created a folder RL.PGM first in Unidata by SSH, and run
COPY FROM VOC TO RL.PGM W01.RL.01.
It is wrong.
Finally I found I have to create the folder using code
CREATE.FILE DIR RL.PGM .
This time everything is fine.
Subscribe to:
Posts (Atom)
如何发掘出更多退休的钱?
如何发掘出更多退休的钱? http://bbs.wenxuecity.com/bbs/tzlc/1328415.html 按照常规的说法,退休的收入必须得有退休前的80%,或者是4% withdrawal rule,而且每年还得要加2-3%对付通胀,这是一个很大...
-
魏杰教授这篇演讲,深入浅出,把未来几年的经济形势讲的非常透彻。 魏杰:我和大家一起对未来一段时间做一个交流,可能在座的知道从2018年3月份开始,中国社会生活出现了六个很严重的现象。 第一个现象 ,大量的中小企业反映企业非常难做,压力很大。既有成本压力,也有资金...
-
如何发掘出更多退休的钱? http://bbs.wenxuecity.com/bbs/tzlc/1328415.html 按照常规的说法,退休的收入必须得有退休前的80%,或者是4% withdrawal rule,而且每年还得要加2-3%对付通胀,这是一个很大...
-
以下内容摘编自中文版《如何让孩子成年又成人》。 1. 另辟蹊径 我们都希望孩子在离家的时候,可以产生 “我觉得我可以,我觉得我行” 的心态。 这种心态的另一种表述是 “自我效能” 。它意味着相信自己有能力完成任务、实现目标及把把控局面。它意味着你相信自己做事情的能...