[futurebasic] pGreplaceXRes trouble...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1998 : Group Archive : Group : All Groups

From: tatewake@... (TJ Grant)
Date: Fri, 27 Nov 1998 00:17:13 -0400
Maybe it's just me, but does anyone see anything wrong with this routine?
It's supposed to make a 3 byte resource in an external file.
The resource is called "fred"(for lack of a better name)

What actually ends up happening is a 512 byte resource being created with
garbage in it.

What really gets me is that this appears to work in another function
perfectly; can anyone see anything wrong? Can anyone make it work?

CLEAR LOCAL
LOCAL FN writeTrans
  DIM tmphdl&
  DIM lRFnum%,OsErr%

  'DEFSTR LONG

  tmphdl& = FN NEWHANDLE _clear(3)
  LONG IF tmphdl&

    lRFnum% = FN HOPENRESFILE(gOurFileVref%, 0, gOurFileName$, _fsRdWrPerm)
    LONG IF lRFnum% <> -1
      CALL USERESFILE(lRFnum%)
      FN pGreplaceXRes(tmphdl&,_"fred",128," ",lRFnum%)
      OsErr% = FN DISPOSHANDLE(tmphdl&)
    END IF
    CALL USERESFILE(gResRef)
    CALL CLOSERESFILE(lRFnum%)
  END IF
END FN


-- TJ Grant (tatewake@...)
Inspired Communications. http://inspired.netstreet.net/
Phone: 407-728-7563