Bit Manipulation Functions:
Note: The bit manipulation functions are not needed for radio card manipulation. They are only included for convenience.
Using the supplied bit manipulation functions makes it convenient to do bit operations in REXX and from looking at the code below, it appears that it will execute much faster as well. Not so. The call to the DLL puts quite an overhead on to the program and can take up to 20 times longer than using several of the built-in REXX functions to do the same operation. The native REXX function example below will execute much faster than the call to rxRTCtrl using RTBitClear. Both samples achieve the same result.
/* Native REXX Functions D2C and BITAND - MUCH FASTER */
BitVal = D2C('255')
BitResult = BITAND(BitVal, '1'x)
/* Call to rxRTCtrl - SLOWER */
BitVal = '255'
BitResult = RTBitClear(BitVal, '0')
If your program executes the bit manipulation routines many times in a loop, you may consider using native REXX functions to perform this operation.
Time Delay RTDelay:
The RTDelay function is included for convenience and provides delays for a fraction of a second, something the SysSleep function of REXXUTIL.DLL is not able to do. If you are using Vispro/REXX to write your program, I suggest to use the Timer events of these programs whenever possible. This will make your programs more responsive, especially if time delays are fairly long. RTDelay will essentially wait for the delay to time-out and your program will not respond during that time. Using the Timer events of the visual REXX programs will consume less CPU cycles and it will allow you to terminate the delay through a dedicated button for example.