Perhaps you could modify your routine to use BSCAN instead of SELECTINDEX,
something along the lines of:
BSCAN found.key, record.keys FROM operators.file.var,
operator.number.to.find USING 'index.name' BY 'A' THEN
IF STATUS() = 1 THEN ;* Desired operator number actually found
FORMLIST record.keys TO 8
ELSE
* Operator number not found.
END
ELSE
* Operator number not found
END
If you don't really need to put the record.keys into a SELECT list, then you
could just do a LOOP REMOVE to get each key from the record.keys variable.
Hopefully this would avoid the problem you're running into.
Mark
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 10, 2004 3:04 AM
To: [EMAIL PROTECTED]
Subject: RE: [U2] [UV] SELECTINDEX inside a user conversion subroutine
is corrupting the record count
Ray,
Thanks for the suggestion - but no luck.
Setting @SYSTEM.RETURN.CODE makes no difference. I checked again and
@SELECTED does get set by the SELECTINDEX. I tried storing and resetting
@SELECTED (which does seem to be writable), and again no difference.
The only way around the problem seems to be creating a new file keyed on
operator number - just so I can do a direct read instead of a SELECTINDEX.
AdrianW
-----Original Message-----
From: Ray Wurlod [mailto:[EMAIL PROTECTED]
Sent: Thursday, 10 June 2004 15:18
To: [EMAIL PROTECTED]
Subject: Re: [U2] [UV] SELECTINDEX inside a user conversion subroutine
iscorruptin g the record count
I expect that @SELECTED and @SYSTEM.RETURN.CODE are affected in the caller
(UV query engine) rather than in the called subroutine.
@SYSTEM.RETURN.CODE is writable (despite documentation to the contrary).
Why not try intercepting it on entry to your subroutine and resetting it
before exit?
----- Original Message -----
From: [EMAIL PROTECTED]
Date: Thu, 10 Jun 2004 09:49:20 +0800
To: [EMAIL PROTECTED]
Subject: [U2] [UV] SELECTINDEX inside a user conversion subroutine
iscorruptin g the record count
> We have a user conversion code (named UOPNN) which we use in the
conversion
> field of dictionaries to convert an operator number into an operator name.
>
> Our "operators" (ie. users) control file is keyed on name with an AK on
> number. The UOPNN routine uses SELECTINDEX on the operator file using the
> number to obtain the name.
>
> The SELECTINDEX statement is selecting to list 8, therefore not affecting
> the default list (0).
>
> If I list a file with the SAMPLE keyword, displaying a field which uses
the
> conversion code - then 10 records will be listed, BUT the final line
> displayed is "Sample of 1 records listed." instead of "Sample of 10
records
> listed."
>
> The number displayed (ie. 1) is dependant on the number of records that
the
> final SELECTINDEX returns, which, to me, indicates that SELECTINDEX is
> overwriting some internal counter variable.
>
> I added a CRT of @SELECTED and @SYSTEM.RETURN.CODE to the conversion
routine
> and neither of these are altered by the SELECTINDEX.
>
> This looks like it may be a bug in Universe as I'm pretty sure we didn't
> have this problem under PI/Open.
>
> Does anyone have any suggestions of a way around this problem?
>
> (We're on UV 10.0.19)
> ----------------------------------
> Adrian Womack
> RAC Group of WA
> Perth WA
> Australia
Disclaimer. This e-mail is private and confidential. If you are not the
intended recipient, please advise us by return e-mail immediately, and
delete the e-mail and any attachments without using or disclosing the
contents in any way. The views expressed in this e-mail are those of the
author, and do not represent those of this company unless this is clearly
indicated. You should scan this e-mail and any attachments for viruses. This
company accepts no liability for any direct or indirect damage or loss
resulting from the use of any attachments to this e-mail.
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/