× 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: U1-8 Switches: Similar to *LDA ?
  • From: Jim Langston <jimlangston@xxxxxxxxxxxxxxxx>
  • Date: Thu, 12 Apr 2001 10:33:42 -0700
  • Organization: Pacer International

It would be rather simple to write a function to return the value of the
switches as a byte value (0 to 255) and use that when you needed to see
a total value.  Not that I am recommending this, I don't like U* switches
at all myself.

D ReturnVal       S          3P 0  Inz(*Zero)

C           If     *INU8
C           Eval   ReturnVal = 1
C           EndIf
C           If     *INU7
C           Eval   ReturnVal = ReturnVal + 2
C           EndIf
...

For simplicity sake, I might even use the indicators as indicators

C   U8      Eval  ReturnVal = 1
C   U7      Eval  ReturnVal = ReturnVal + 2
C   U6      Eval  ReturnVal = ReturnVal + 4
C   U5      Eval  ReturnVal = ReturnVal + 8

etc...

Then, in your program you could do

C           Eval  Switches = SwitchToByte
C           If    Switches = 7 
yadda, yadda, yadda...

I have written this type of code in languages that didn't have bit
manipulation.

Regards,

Jim Langston

Buck Calabro wrote:
> 
> JMoore wrote:
> 
> >What are the performance implications of
> >passing large physical sized parameters?
> 
> Hi J.!  I haven't seen any performance ramifications; probably because the
> parameters aren't "passed" or moved from program to program.  The caller is
> the only place the variable is stored.  The called program refers to the
> parameter there, in the caller's storage.  This presumes passing by
> reference, of course, but this is the default behaviour.
> 
> Then again, this thread was about 8 characters worth of UPSI.  You can't
> readily pass more than 256 bytes of "parameter data" with switches anyway,
> and decoding THAT would be a chore!
> nU1 nU2 nU3 nU4 nU5 nU6 nU7 nU8 = choice 0
> nU1 nU2 nU3 nU4 nU5 nU6 nU7  U8  = choice 1
> nU1 nU2 nU3 nU4 nU5 nU6  U7 nU8  = choice 2
> etc...
> 
> Buck Calabro
> Commsoft; Albany, NY
> "Nothing is so firmly believed as
>  that which we least know" -- Michel Montaigne
> Visit the Midrange archives at http://www.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 ...

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.