Discussion:
ITYPE and SUBR Call
(too old to reply)
Lance
2012-07-28 21:10:51 UTC
Permalink
I am calling a BASIC sub from a multi-value ITYPE in UniVerse 11.9.x on Linux.
Within my BASIC subroutine, how can I find out the current multi-value being processed?

Example: if there are 5 values on a field, how do I know what value I am currently on? e.g. THIS.VALUE = @RECORD<25,@CNT>

Thanks
Brian Speirs
2012-07-29 02:19:31 UTC
Permalink
Try asking this question on the U2 Users group (on LinkedIn) or on the
Pick and Multivalue Databases google group
(https://groups.google.com/forum/?hl=en&fromgroups#!forum/mvdbms).

Cheers,

Brian
Post by Lance
I am calling a BASIC sub from a multi-value ITYPE in UniVerse 11.9.x on Linux.
Within my BASIC subroutine, how can I find out the current multi-value being processed?
Thanks
wjhonson
2012-08-20 23:07:36 UTC
Permalink
Post by Lance
I am calling a BASIC sub from a multi-value ITYPE in UniVerse 11.9.x on Linux.
Within my BASIC subroutine, how can I find out the current multi-value being processed?
Thanks
Try @MV
r***@gmail.com
2012-08-21 00:54:09 UTC
Permalink
Lance,
When you are dealing with I Types and subroutines you need to realize that you have to work on the entire MV array and return the entire MV field results (that is if you are returning an MV result). Hence you don't know what value you are on because the I-descriptors don't really work that way.

For example if you have a MV field that is QUANTITY and an MV field that is PRICE and want a subroutine that correctly returns the extended amount for each row you would need a piece of code like:

Results = ""
for idx = 1 to dcount(Order<10>,@VM)
price = oconv(Order<11,idx>,"MR2")
qty = Order<10,idx>
amount = iconv(price*qty,"MR2")
Results<1,idx> = amount
next idx

Results would be the return value of the subroutine.

Rich Taylor
Post by Lance
I am calling a BASIC sub from a multi-value ITYPE in UniVerse 11.9.x on Linux.
Within my BASIC subroutine, how can I find out the current multi-value being processed?
Thanks
Loading...