Re: Calling SUB from ITYPE

159 views
Skip to first unread message

Steve Douglas

unread,
Jul 29, 2012, 12:14:44 PM7/29/12
to mvd...@googlegroups.com
Lance,
 
I don't know if there's a way to actually retrieve the value in the subroutine.  But you can pass the value into the subroutine along with your actual data (at least in D3).  An example that we use in D3 is below.  I don't know how elegant that solution is but it works for us.
 
001 A
002 13
003 AMT PAID
...
007 MR2,
008 F;0R;'~';:;NV;:]CALL AMT.PAID.EXTRACT
009 R
010 14
 
Hope that helps.
Steve
 

On Sunday, July 29, 2012 9:57:42 AM UTC-4, Lance wrote:
I am calling a subroutine from an ITYPE (multi-value field) in UniVerse 11.1.9 - In my SUB I would like to know the current value-mark being processed.
Example: ITEM = @RECORD<25, @CNT>

I looked at "@" variables, SYSTEM() calls and other documentation and nothing seems obvious. Thoughts?

Thanks

chandru murthi

unread,
Jul 29, 2012, 3:22:32 PM7/29/12
to mvd...@googlegroups.com
@MV or @NV should do it.

Chandru

chandru murthi

unread,
Jul 29, 2012, 6:05:37 PM7/29/12
to mvd...@googlegroups.com
Lance, you're right. I can't get the sub to be called more than once even if I do something like  F6;SUBR('MVSUB') where F6 is mv-ed and the reference should cause the call to repeat. This makes no sense. I don't use Itypes much so have never noticed this.

Anyone know how to force the Call once for every mv?

Martin Phillips

unread,
Jul 30, 2012, 3:57:23 AM7/30/12
to mvd...@googlegroups.com

Hi,

 

Ø  Lance, you're right. I can't get the sub to be called more than once even if I do something like  F6;SUBR('MVSUB') where F6 is mv-ed and the reference should cause the call to repeat. This makes no sense. I don't use Itypes much so have never noticed this.

Ø  Anyone know how to force the Call once for every mv?

 

This is a fundamental difference between Pick style systems and the Information style from which I-types came.

 

In Pick systems, the expression is evaluated for each value in the data. In Information style systems, the expression is evaluated just once for the entire set of values and can use the very powerful (but at first confusing) multivalue functions to do the whole job in one go.

 

 

 

Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

 

 

Steve Douglas

unread,
Jul 30, 2012, 10:21:56 AM7/30/12
to mvd...@googlegroups.com
Chandru,
 
I should have mentioned that the example I gave earlier that we use will ony work if an exploded select is active.  That's how we get around it.  Again that is with D3 and I know the original post was for Universe.
 
Steve

Scott Ballinger

unread,
Jul 30, 2012, 8:37:22 PM7/30/12
to mvd...@googlegroups.com


On Monday, July 30, 2012 12:57:23 AM UTC-7, Martin Phillips wrote:

In Pick systems, the expression is evaluated for each value in the data. In Information style systems, the expression is evaluated just once for the entire set of values and can use the very powerful (but at first confusing) multivalue functions to do the whole job in one go


Yes, this works because of another huge difference between UV and D3: in UV you can pass value or sub-value delimited data back from an ITYPE subroutine (I have never been able to do that in D3 and I believe it is not possible- would LOVE to be proved wrong!). So in UV you manipulate/format/whatever the entire multi-value result string and then return it, whereas in D3 you are working with each value in turn.

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006
 

Tony Gravagno

unread,
Jul 30, 2012, 8:58:47 PM7/30/12
to mvd...@googlegroups.com

You're right, Scott. I've maintained for years that the ability to process delimited data like that is the most popular D3 request of all time. It doesn't work with BASIC or translates.

T

Ed Clark

unread,
Jul 30, 2012, 9:24:25 PM7/30/12
to mvd...@googlegroups.com
mvbase has the B processing code which calls subroutines. There are 2 forms: b:subname and b;subname. One calls the subroutine for each value/subvalue, and the other calls the subroutine just once. I think mvEnterprise also supported it. Too bad it wasn't added to D3.
> --
> You received this message because you are subscribed to
> the "Pick and MultiValue Databases" group.
> To post, email to: mvd...@googlegroups.com
> To unsubscribe, email to: mvdbms+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms

Reply all
Reply to author
Forward
0 new messages