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


  • Subject: Re: Calling a program without knowing the parms
  • From: "Peter Dow" <pcdow@xxxxxxxxx>
  • Date: Wed, 4 Jul 2001 11:11:15 -0700

Hi Scott, John,

I haven't done any sockets programming yet, so I have no idea when/where the
ASCII-EBCDIC conversion takes place. Regardless, if the idea is for the RPG
program to be generic and know as little about the parameters as possible,
I'd say the VB program should be formatting the parameters as the PgmNameVar
wants them, in EBCDIC. Then send them without any conversion. Likewise on
the return trip -- let the VB program handle the conversion from
EBCDIC-ASCII. Then all the RPG program has to do is set the parameter
pointers pointing to the correct place in the buffer and call PgmNameVar.

And while I'm sure you can have an array of pointers (in order to loop), how
would you base a parameter on an entry in the pointer array?  Would this
work?

    d ptrParm        s            *    dim(255)

    d Parm           s           1a    dim(255) based(ptrParm)

    c                for      ix = 1 to %elem(Parm)
    c                eval     ptrParm(ix) = %addr([calculated PC buffer
position])
    c                endfor

    c                call    PgmNameVar
    c                parm                Parm(1)
    c                parm                Parm(2)
    ...
    c                parm                Parm(255)

Doesn't seem like it to me, but I haven't tried it.

Regards,
Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax


From: "Scott Klement" <klemscot@klements.com>
> > A routine will have to be added for packed fields? Because it will not
be
> > passed as packed because of the ASCII to EBCDIC translation. But some
RPG
> > programs will expect packed parameters. No ideal how to do this.
>
> Yeah, as part of the design you're going to have to make a decision about
> how to pass these.  Since the packed data type doesn't even exist in VB,
> you'll want the VB program to convert them to some neutral type for
> sending over the socket, and then have the RPG program convert them to
> packed (or whatever data type is appropriate)


> > We will have to set this up to handle 255 parmoffset (in a do loop I
hope)?
> >
> Or whatever max # of parms you decide to support :)  The only reason I
> suggest 255 is because I believe that's the max allowed by RPG.  I'm sure
> you'll be able to find a way to use a loop for at least part of it :)



> +---
> | 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
> +---


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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 ...

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.