MODULE WIERD	! Wierd bug test case, Aron (ELSIE::) Insinga, 08-Jan-84
(
    MAIN = MAIN,
    ADDRESSING_MODE(EXTERNAL = GENERAL, NONEXTERNAL = LONG_RELATIVE)
) =
BEGIN

! This program is a short test case to track down a wierd bug.
! (When you set a watch in DEBUG32, the resultant file spec is trashed.)
! The program opens a file (WIERD.TXT) and writes the resultant file spec
! into the file.

LIBRARY 'BLI:XPORT';

GLOBAL ROUTINE MAIN: NOVALUE =
    BEGIN

    OWN
	STATUS,
	FILE_IOB : $XPO_IOB(),
	DUMMY;

    $XPO_IOB_INIT (IOB = FILE_IOB);

    STATUS = $XPO_OPEN (
	IOB = FILE_IOB,
	FILE_SPEC = 'WIERD.TXT',
	OPTIONS = OUTPUT,
	ATTRIBUTES = RECORD);

    IF NOT .STATUS THEN RETURN .STATUS;

    STATUS = $XPO_PUT (IOB = FILE_IOB,
	STRING = FILE_IOB[IOB$T_RESULTANT]);

    IF NOT .STATUS THEN RETURN .STATUS;

    RETURN $XPO_CLOSE (IOB = FILE_IOB)
    END;

END
ELUDOM
