Reference Guide > System Variables > !XDR_LONG
  

!XDR_LONG
This system variable controls the number of bytes for LONG data types written to an XDR file. !XDR_LONG applies to the SAVE/RESTORE routines and to the OPEN procedures (OPENR, OPENU, and OPENW) that have the /XDR keyword set.
 
note
If large LONG integers are hard-coded into a routine, the COMPILE command will fail even if !XDR_LONG is set to 64, i.e., .cpr files cannot contain hard-coded LONG integers greater than 231–1. The reason for this restriction is to ensure that any .cpr file runs correctly on 32-bit and 64-bit platforms.
Usage
!XDR_LONG=<bit_size>
The possible <bit_size> is:
*32—PV-WAVE outputs LONG integers as 4-byte, 32-bit values. This setting is valid for both 32-bit or 64-bit platforms when creating and writing to an XDR-formatted file.
*64—PV-WAVE outputs LONG integers as 8-byte, 64-bit values. This setting is only valid on 64-bit platforms. NOTE: XRD-formatted files created with the 64 setting are unreadable on 32-bit machines and 64-bit machines with !XDR_LONG set to 32.
The default value is 32.
 
note
You can set !XDR_LONG to any value, but when it applies to SAVE or OPEN* procedures, valid values are 32 and 64.
OPEN* Procedures
!XDR_LONG applies to the OPEN* procedures that have the /XDR keyword set. Changes to the !XDR_LONG system variable do not affect open files. In order to change the size of LONG and output to a file, you would have to close the file and then open it again.
SAVE Procedure
On the 32-bit version of PV-WAVE, the only valid value of !XDR_LONG is 32. If !XDR_LONG is set to 64, an error message is issued and execution is stopped.
RESTORE Procedure
The system variable !XDR_LONG has no impact relative to the RESTORE command. !XDR_LONG is only considered during output operations (SAVE and WRITEU). Calling the RESTORE procedure does not change the !XDR_LONG value.
If you restore a 64-bit file on a 32-bit platform, an error message is issued and execution is stopped.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.