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



Oh ho!  I thought it took up five spaces in memory, not 2. 

It's easy to get it confused at least to you've confused it enough to
really get it beat into your head <grin>

As a refresher, if needed, and for the archives....

*INT2 = 2 bytes = can hold from -32,768 to 32,767 (ie. 5 digits) = 5i 0
*INT4 = 4 bytes = can hold from -2,147,483,648 to 2,147,483,647 (ie. 10
digits) = 10i 0

I hate the syntax RPG uses, that why I define a templates in my STDTYPES
copy source:
d t_Int1          s              3i 0 based( TEMPLATE ) 
d t_Int2          s              5i 0 based( TEMPLATE ) 
d t_Int4          s             10i 0 based( TEMPLATE ) 
d t_Int8          s             20i 0 based( TEMPLATE ) 
d t_Uint1         s              3u 0 based( TEMPLATE )
d t_Uint2         s              5u 0 based( TEMPLATE )
d t_Uint4         s             10u 0 based( TEMPLATE )
d t_Uint8         s             20u 0 based( TEMPLATE )


Then whenever I need a 2-byte signed integer, I just:
D Sides             DS                   Qualified               
D  Bread                           8a    
D  NumPcs                                like(t_Int2)
D  NumDrnks                              like(t_Int2)



Charles Wilt
--
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
  


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.