OPEN - LINKED, Internal

More advanced topics discussed.

Moderators: Susan Smith, admin, Gabriel

Post Reply
GomezL
Posts: 239
Joined: Wed Apr 29, 2009 5:51 am
Contact:

OPEN - LINKED, Internal

Post by GomezL »

I know that LINKED files have been supported by BR for a long time, but I finally found a reason for me to use them.

This sample program writes a line of data to a "TEMP" file, reads it back, and there deletes it from the temp file.
  • Two interesting things:

    1. The program never slows down even after 10's of thousands of entries.
    2. The [Temp]TempLink.[Session] file never grows beyond 1K (Roughly 1 record)

Code: Select all


00001   PRINT Newpage
00005   DIM Buff$*9999
00010   OPEN #1: "name=[Temp]TempLink.[Session],LINKED,recl=830,kps=9,KLN=8,replace",INTERNAL,OUTIN,RELATIVE 
00020   LET Start_Time=Timer
00100   WRITE #1,USING 110: ""
00101   LET Counter+=1
00110   FORM Pos 1,C 830
00121   READ #1,USING 110,First: Buff$
00130   DELETE #1: 
00131   LET End_Time=Timer !:
        LET Tot_Time=End_Time-Start_Time
00140   IF Time$<>Last_Time$ THEN !:
          PRINT FIELDS "1,70,n 10;2,65,n 14.8": Counter,Tot_Time/Counter
00150   GOTO 100

Post Reply