wilson
2011-02-18 12:24:01 UTC
http://mvcommunitymap.com/openqm/index.html?qmb_trans.htm
says:
"Examples
TOTAL.VALUE = QTY * TRANS('STOCK', PART.NO, 'PRICE', 'X')
The above statement reads from the STOCK file a record (or list of
records) whose id(s) can be found in the PART.NO variable. The X error
code causes the TRANS() function to return a null value for any record
that cannot be found.
X = TRANS(DICT 'ORDERS', 'DISCOUNT', 'X')
X = TRANS('DICT ORDERS', 'DISCOUNT', 'X')
Both of the above statements perform the same action. Either might be
used, for example, to retrieve an I-type item named DISCOUNT from the
dictionary of the ORDERS file."
I set up orders with demo dict item TEST
1: C
2: @ANS = "1234"
3:
4: ORDERS
5: 5R
6: S
LIST ORDERS TEST
returns "1234" OK
a program:
PRINT TRANS(DICT "ORDERS",1,"TEST","X")
END
formatted as the manual above states - returned is a null value (where
there is an item "1") in ORDERS
I thought the above isn't correct
PRINT TRANS("ORDERS",1,"TEST","X") would be more correct?
with that you get (hex address):Invalid I-type at line number of PROGNAME
Can anyone tell me why this doesn't work per example on website above -
or supply an example ...
would like to use TRANS/XLATE -- or even an OCONV to access the value of
an I type dictionary item with passed
tried setting @ID in the program -- still no luck
says:
"Examples
TOTAL.VALUE = QTY * TRANS('STOCK', PART.NO, 'PRICE', 'X')
The above statement reads from the STOCK file a record (or list of
records) whose id(s) can be found in the PART.NO variable. The X error
code causes the TRANS() function to return a null value for any record
that cannot be found.
X = TRANS(DICT 'ORDERS', 'DISCOUNT', 'X')
X = TRANS('DICT ORDERS', 'DISCOUNT', 'X')
Both of the above statements perform the same action. Either might be
used, for example, to retrieve an I-type item named DISCOUNT from the
dictionary of the ORDERS file."
I set up orders with demo dict item TEST
1: C
2: @ANS = "1234"
3:
4: ORDERS
5: 5R
6: S
LIST ORDERS TEST
returns "1234" OK
a program:
PRINT TRANS(DICT "ORDERS",1,"TEST","X")
END
formatted as the manual above states - returned is a null value (where
there is an item "1") in ORDERS
I thought the above isn't correct
PRINT TRANS("ORDERS",1,"TEST","X") would be more correct?
with that you get (hex address):Invalid I-type at line number of PROGNAME
Can anyone tell me why this doesn't work per example on website above -
or supply an example ...
would like to use TRANS/XLATE -- or even an OCONV to access the value of
an I type dictionary item with passed
tried setting @ID in the program -- still no luck