[futurebasic] Raw resources

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1999 : Group Archive : Group : All Groups

From: Sean -G3- <mclaughlin@...>
Date: Fri, 14 May 99 14:58:32 -0400
I'm trying to open a resource file as raw data, then read/write to/from 
it. I'm doing this for downloading & uploading in my communications 
program. I found out, from the people @ pixmix, how to do the opening 
part.

I now need to know how to read/write. Here is my routine for opening 
resource files:

--------------------------
'Format for opening *raw* resources
'osErr% = FN HOPENRF (pbPtr&)

CLEAR LOCAL
LOCAL FN GetParam$ (fsName$, fsVRefNum%)
  DIM 255 ParamBlock$
  DIM fsVRefNum%, 63 fsName$
  
  pbPtr& = @ParamBlock$
  
  pbPtr&.ioCompletion&   = 0'   NO IOCOMPLETION
  pbPtr&.ioNamePtr&      = @fsName$'   FILENAME TO READ
  pbPtr&.ioVRefNum%      = fsVRefNum%'   VOLUME TO READ
  pbPtr&.ioFDirIndex%    = 0'   DEFAULT DRIVE
  
  GET FILE INFO ParamBlock$
END FN = ParamBlock$

WINDOW 1
filename$=FILES$(_fOpen,,,volRef%)
param$ = FN GetParam$ (filename$,volRef%)
paramPointer& = @param$
err% = FN HOPENRF(paramPointer&)

DO
  HANDLEEVENTS
UNTIL gProgramEnds
--------------------------

Thanks, all.