Groups | Search | Server Info | Login | Register


Groups > comp.databases.pick > #1887

Re: ITYPE and SUBR Call

From richtaylor0420@gmail.com
Newsgroups comp.databases.pick
Subject Re: ITYPE and SUBR Call
Date 2012-08-20 17:54 -0700
Organization http://groups.google.com
Message-ID <dc4e40bf-8110-4e68-929c-143aa0e71299@googlegroups.com> (permalink)
References <7809a416-8419-4502-b6ea-0871ea20c983@googlegroups.com>

Show all headers | View raw


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
On Saturday, July 28, 2012 5:10:51 PM UTC-4, Lance wrote:
> 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

Back to comp.databases.pick | Previous | NextPrevious in thread | Find similar


Thread

ITYPE and SUBR Call Lance <lance.jahnke@gmail.com> - 2012-07-28 14:10 -0700
  Re: ITYPE and SUBR Call Brian Speirs <bss59@yahoo.co.nz> - 2012-07-29 14:19 +1200
  Re: ITYPE and SUBR Call wjhonson <wjhonson@aol.com> - 2012-08-20 16:07 -0700
  Re: ITYPE and SUBR Call richtaylor0420@gmail.com - 2012-08-20 17:54 -0700

csiph-web