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

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

From: Bill Sanford <bill@...>
Date: Tue, 30 Apr 2002 10:35:00 -0500
on 4/30/02 10:19 AM, STAZ at staz@... wrote:

> 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.

Should the resource be locked before we start to examine the contents?

I usually do HLOCK before I do anything with a resource and HUNLOCK after
I'm done.

Is this necessary or am I adding unnecessary steps?

Bill Sanford
General Manager
Director of Engineering
bsanford@...
218-751-3407 ext. 115
Lakeland Public Television
http://www.lakelandptv.org

Watch Lakeland News at 10 on our web site!
http://www.lakelandptv.org/pages/lakeland_news/lakelandnewscasts.html