[futurebasic] Re: [FB] A-FB Any Utility for this..?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2002 : Group Archive : Group : All Groups

From: STAZ <staz@...>
Date: Tue, 30 Apr 2002 10:19:40 -0500
> // FILES$(_fsopen...
> // setresload(_false)  // dont load any resources unless requested
> // oldResRef = fn curresfile // different in carbon
> // resRef = fsopenresfile(...)
> // useresref(resRes)


this would be better as...

FILES$(_fsopen...
resRef = FN fsopenresfile(...)

LONG IF resRef > 0
  fcodH = FN GET1RESOURCE(_"FCOD",1000)
  fcodSz = FN GETHANDLESIZE(fcodH)
  startPtr = [fcodH]
  endPtr = (startPtr + fcodSz) - 10
  // 10 is number of bytes you are searching for
  FOR ptrLoc = startPtr TO endPtr STEP 2
    LONG IF ptrLoc.nil% = 0x4E71
      LONG IF ptrLoc.2% = 0x51C8
        LONG IF ptrLoc.4% = 0xFFFC
          LONG IF ptrLoc.6% = 0x4CDF
            LONG IF ptrLoc.8% = 0x0101
              // found you signature
              // do something
            END IF
          END IF
        END IF
      END IF
    END IF
  NEXT
  
  CLOSERESFILE(resRef)
END IF



i just corrected res thingies. i did not check other items in the file.