|
And then all the logic is contained in a procedure instead of the calling program having to check an array of indicators. Thanks, Rory. Donald R. Fisher, III Project Manager Roomstore Furniture Company (804) 784-7600 extension 2124 DFisher@xxxxxxxxxxxxx <clip> If you want a one-step procedure, you could also/instead use this bitpattern() procedure, for instance if you want to check that ONLY bit 2 (the third bit) is on and all the other bits are off, you would use this: if bitpattern( '00100000' : MyField ); or if you don't care about the state of the other bits, you would use this: if bitpattern( 'xx1xxxxx' : MyField ); <clip> P bitpattern B Export D PI N D P_Pattern 8A Value D P_Char 1A Value *--------------------------------------------------------------------- D UnspecChar DS D CharArr 1A Dim(8) D Pattern DS D PattArr 1A Dim(8) D B S 10I 0 Inz *--------------------------------------------------------------------- * C Eval Pattern = P_Pattern C Eval UnspecChar = bitform( P_Char : 1 ) * C 1 Do 8 B C If ( PattArr(B) = '0' or C PattArr(B) = '1') and C PattArr(B) <> CharArr(B) C Return *Off C Endif C Enddo * C Return *On * C *PSSR Begsr C Return *Off C Endsr * P E <clip>
As an Amazon Associate we earn from qualifying purchases.
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.