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



Thanks for kicking my brain into gear.  The magic phrase here is "command
line".  If, on a command line, you type:

call x parm(a b)

then the command analyzer will

allocate two 32-byte fields - lets call them p1 and p2,
create a space pointer to p1 and a space pointer to p2 - lets call them @p1
and @p2
the copy the value a into p1 and the value b into p2,
then call program x passing @p1 and @p2

If you type

call x parm('a' and 'b')

Then everything is the same except the field allocation.  In this instance,
the fields will be one byte long.

If you type:

call x parm(1 2)

then the allocations will be for a packed number 15 digits with 5 decimals.
I never discovered a way to change the allocation for numbers.

If you type:

call x parm('a                                        ')

(that should be the letter a followed by 40 blanks enclosed in single
quotes) the command analyzer will allocate a field of 41 bytes, copy the
letter a into the first position, then call program X passing a space
pointer to the first character of the 41 byte field.

In other words, the default length for a character value when calling from
the command line is 32 bytes.  You can make the actual length shorter by
using a shorter quoted character string.  You can make it longer by using a
longer quoted character string or by passing a longer unquoted string if
that string contains no blanks or stop characters (such as a single quote or
double quote).  If you use a command, the command analyzer can be instructed
to tell the called program the length of the parameter value.

When calling from program to program, the parameters are usually passed as
space pointers to the first byte in the parameter.  It is up to the programs
to agree on the type and length of the parameters, data type semantics and
so forth.  A good development process using prototypes can assist the
programs to use the same type and length but it is not a guarantee - an
unruly program can still do the wrong thing and break something.

I haven't had to face this problem for some time so this explanation might
be obsolete.

Richard Jackson
mailto:richardjackson@richardjackson.net
www.richardjacksonltd.com
Voice: 1 (303) 808-8058
Fax:   1 (303) 663-4325

-----Original Message-----
From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On
Behalf Of Marcin Sagan
Sent: Thursday, July 13, 2000 1:36 AM
To: RPG400-L@midrange.com
Subject: Odp: RE: RPG/400 pgm strange behaviour


Danny

I couldn't repeat this bug when program to program was called no mater what
kind of program or call I used but maybe I missed something.
It looks like command line parameter passing problem.
So you don't need to worry about calling from program.

Best regards


Marcin Sagan

!
   !

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.