[futurebasic] READ?WRITE RECORDs

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

From: Warren Furman <wfurman@...>
Date: Tue, 28 Sep 1999 17:20:43 -0700
Hi all. I managed to do this sort of thing a few years back, but guess I'm
getting dumber with age. Can someone tell me what I'm doing wrong?

Thanks,
-Warren

'READ/WRITE TEST
WINDOW 1

GLOBALS
DIM RECORD appointmentsRec
  DIM  6 dayt$
  DIM  6 tyme$
  DIM  4 ampm$
  DIM 30 who$
DIM END RECORD.appointmentsRec
END GLOBALS

LOCAL FN WriteRecord(recNum)
  volRefNum = SYSTEM(_aplVol)
  DEF OPEN "TEXT"
  OPEN "R",1,"appointments",_appointmentsRec,volRefNum
  RECORD #1, recNum
  WRITE  #1, appointmentsRec
  CLOSE 1
END FN

LOCAL FN ReadRecord(recNum)
  volRefNum = SYSTEM(_aplVol)
  DEF OPEN "TEXT"
  OPEN "R",1,"appointments",_appointmentsRec,volRefNum
  RECORD #1,recNum
  READ   #1, appointmentsRec
  CLOSE 1
END FN


DO
  SELECT INKEY$

    CASE "r"
      recNum = 1
      FN ReadRecord(recNum)
      PRINT dayt$,tyme$,ampm$,who$

    CASE "w"
      recNum = 1
      dayt$ = "mm/dd"
      tyme$ = "00:00"
      ampm$ = "am"
      who$ = "Who?"
      FN WriteRecord(recNum)
      dayt$ = ""
      tyme$ = ""
      ampm$ = ""
      who$ = ""

  END SELECT
UNTIL FN BUTTON


Best wishes,
-Warren Furman

********************************************************************************
Music and Art: http://members.xoom.com/_XOOM/maci_us/index.html
Software: colorWiz/Alphie: http://wrf-digitals.hypermart.net/
More music: http://mp3.com/artists/25/warren_furman.html
********************************************************************************