× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Aaron,

If you don't initialize a "varying" field, I think it's length is set to zero 
so the error makes since. A better check for empty would probably be "If 
%len(error.description) > 0". Other languages that I've dealt with that have 
varying length fields (most recently Java) have similar issues. I don't think 
they get an out of range error but the test fails since there's a difference 
between nothing and a space.

Matt

-----Original Message-----
From: Bartell, Aaron L. (TC) [mailto:ALBartell@xxxxxxxxxxxxxx]
Sent: Friday, August 15, 2003 10:39 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: Varying - Inz mandatory?


I have a couple VARYING questions.

Question #1.

D error           DS                  Qualified
D  code                         10A
D  description                 256A   Varying
 /Free

  If error.description <> ' ';
    error.code = '0';
  EndIf;
  *InLR = *On;

 /End-Free  

I get a 'Length of varying length variable is out of range.' error message
if I don't Inz the error DS or the description subfield.  This wouldn't be a
problem if in the documentation they said that you needed to Inz
DS's/subfields if they have VARYING fields.  At least I can't seem to find
where it might state that, and I have looked both in the WDSc docs and Info
Center. Do you have to Inz or occupy a field before you can check to see if
it contains a value?  I am on V5R1.  
<snip>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.