HP OpenVMS Systemsask the wizard |
The Question is:
Using Compaq Basic how can I pass an array defined as part of a record statment
to an external subroutine. When I try, I get argument mismatch errors, or
other similar errors.
The goal is to create a array sort in which an
array name is passed as a parameter.
Example:
RECORD X
VARIANT
CASE
STRING E.DATE$ = 8%
STRING N.V$ = 1%
STRING P.V$ = 1%
CASE
STRING RECORD.$ = 10%
END VARIANT
END RECORD
DECLARE X TEST(20%)
CALL QSRT( TEST(), MAX%, 1%, 9%, STATUS%)
.
.
.
SUB QSRT(STRING ARRAY$(), LONG ITEM.COUNT%, LONG KEY.START%, &
LONG KEY.LEN%, LONG RET.VALUE%)
OPTION TYPE = EXPLICIT
ON ERROR GOTO ERROR_TRAP
.
.
.
Thanks,
Dan Harmon
The Answer is : You will want to become more familiar with the calling standard and with the debugger, and you will also need to become familiar with what argument-passing directives are available in BASIC. (You might end up creating a set of jacket routines.) As a starting point, get the call to the QSRT subroutine working using an existing example or other resources. Then use the debugger to examine the parameter passing and particularly descriptor(s) used. In conjunction with the calling standard, determine how to create and pass the necessary descriptors.
|