[futurebasic] Handles

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

From: "Aaron" <aln@...>
Date: Sun, 22 Nov 1998 12:59:30 -0600
I want to read data from a file, and then create a resource from the inputed
data.  Before that, I wanted to "patch" the handle at a specific byte
location before making it into a resource...

 OPEN "I",1,"ccl",1,SYSTEM(_aplVol)
  cclH&=FN NEWHANDLE (942)
  LONG IF cclH&
    READ FILE #1, [cclH&],942
    
    POKE @cclH&+242, ASC ("A")

    CALL ADDRESOURCE (cclH&,_"ccha",128,"")
    CALL WRITERESOURCE (cclH&)
  XELSE
    BEEP
  END IF
If I comment out the POKE statement, it makes a resource. When the POKE
statement is used, it doesn't work.  I've also found that if I merely copy
the handle to another file (with the POKE) the change takes place. Does
anyone know how
modify a handle *and* make it a resource?