× 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.



That would explain why I got mixed results ;-)  Now I am dumb founded on how
it worked some of the time ???  I don't even want to know. . .

The documentation doesn't really relay what you are saying very well.  It
states that VARYING is just a keyword for character, graphic, and UCS-2.
Which doesn't translate into "new data type" for me, but I see what you are
coming from. 

It would be great if as you were passing VARYING fields around that it would
only send the content and not the first two characters as well.  Or rather,
it would only send the two characters if the receiver was capable of
handling it.

I guess I put too many assumptions on ILE, or think it is more like the .NET
(CLR) environment than it really is.

Oh well. . .

Aaron Bartell

-----Original Message-----
From: Scott Klement [mailto:klemscot@xxxxxxxxxxxx]
Sent: Friday, August 08, 2003 11:17 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Value vs. Const



> Based on my last comment, has anybody else run into problems with mixing
> fixed length character variables and VARYING when sending parms to a sub
> proc?  Or problems when using VARYING variables with C API's?

There are no C APIs that use VARYING!   VARYING isn't even available to C
programmers, unless they wanted to implement it manually with a data
structure or something like that.

Therefore, never pass VARYING to a function from the ILE C runtime.  Use
options(*string) instead.

I know that you define a VARYING field by putting a "A" in col 40 of your
D-spec.   However, despite this, it's a completely different data type
than your typical fixed-length alphanumeric field.  Just as packed and
zoned aren't the same, varying is also different from alphanumeric.
You can't just combine the two! (unless of course you're passing a
parameter by CONST or VALUE, and then -- just like numeric fields -- the
system will do conversions for you.)



_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.