Have you checked the output of the select when performed from inside the I-type? My guess is that it is generating a big ugly error, which is why you are getting no records back. From my experience, performing external selects from within an I-type is more than just a bad idea, it's illegal.

The basic SELECT command works, as does the basic SELECTINDEX command. If you do either of these, you want to use a select variable so as to not interfere with any active select lists.

You can also do SQL selects using the BCI, but I'm not sure if it's a good idea. One gotcha to watch out for if you choose to do this: if you pass @ID as a parameter from your I-type to your subroutine, that parameter is now a reference to Universe's internal @ID variable which is updated every time a select is executed! This can cause some very puzzling results when your parameter value starts mysteriously changing on you! Sometimes I really wish UV had pass by value..... I'm also not sure what impact this changing of the @ID might have on other dictionaries in the same list statement. It seems like it could be bad, unless there is some type of stack employed for nested selects, which could be the case, but I don't know. Anyway, this is what I've discovered through a little experimentation. Use at your own risk. :-)



HENDERSON MIKE, MR wrote:

Folks,

We have had a puzzling situation where a particular subprogram works
differently when run from a test-harness from TCL, to when it is run as
an I-Type subroutine.

The sub-routine concerned is about three layers deep in the execution
sequence:-

Test-Harness does CALL A(<parameters>), A does CALL
PROBLEM(<parameters>)
I-Type says SUBR("X",<parameters>), and X does CALL A(<parameters>), A
does CALL PROBLEM(<parameters>)

When you LIST <file name> <I-Type name> the I-Type returns 'wrong'
answers


The programmer concerned eventually worked out that the problem was that, from the I-Type, a "PERFORM 'SELECT <filename> <with-condition>' " ALWAYS returned no records, whereas the same select works correctly from the test harness. No, the were no select lists active at the time!

The solution was to change the "PERFORM 'SELECT <filename>
<with-condition>' " to a Basic "SELECT <filename>" and weed out the
unwanted records in an internal loop.


It may well be that it has always been this way, the I-Type is new. UV 10.0, INformation flavour, Windows 2K3


Ideas, anyone?


Thanks


Mike
The information contained in this Internet Email message is intended
for the addressee only and may contain privileged information, but not
necessarily the official views or opinions of the New Zealand Defence Force.
If you are not the intended recipient you must not use, disclose, copy or distribute this message or the information in it.


If you have received this message in error, please Email or telephone
the sender immediately.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
[This E-mail scanned for viruses by Declude Virus]





---
[This E-mail scanned for viruses by Declude Virus]
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to