Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DAY 037: FREEFILE
#3
I store data in files with similar Names, I just tag on a number at the end to separate them. I then use a routine which will open multiple files. For example, 

FileName$ = "DataDAY"
For FNum = 1 To 31
    FN$ = Str$(FNum)
    Print FileName$ + LTrim$(FN$) ' NOTE: Using "Print" here to show the actual File Name generated
    'open FileName$+LTrim$(FN$) as #FNum
Next FNum
Sleep
 I get DataDay1, DataDay2, DataDay3 ...DataDay31

However using FreeFile like this'

For FNum = 1 To 31
    FN = FreeFile
    FN$ = Str$(FN) 'Str$(FNum)???
    Print FileName$ + LTrim$(FN$)
    'open FileName$+LTrim$(FN$) as ???
Next FNum


I get DataDay1, DataDay1, DataDay1...DataDay1

To open multiple files with FreeFile, I tried this method


Day1 = FreeFile
Day1$ = Str$(Day1)
Print FileName$ + LTrim$(Day1$)

DataDay2 = FreeFile
Day2$ = Str$(Day2)
Print FileName$ + LTrim$(Day2$)


DataDay3 = FreeFile
Day3$ = Str$(Day3)
Print FileName$ + LTrim$(Day3$)


This gives me   DataDay1, DataDay0, DataDay0

Opening multiple files using FreeFile is alluding me.
Reply


Messages In This Thread
DAY 037: FREEFILE - by Pete - 12-17-2022, 12:30 PM
RE: DAY 037: FREEFILE - by mnrvovrfc - 12-17-2022, 01:21 PM
RE: DAY 037: FREEFILE - by Dimster - 12-17-2022, 07:15 PM
RE: DAY 037: FREEFILE - by mnrvovrfc - 12-17-2022, 11:54 PM
RE: DAY 037: FREEFILE - by SMcNeill - 12-18-2022, 12:08 AM
RE: DAY 037: FREEFILE - by Dimster - 12-18-2022, 03:58 PM
RE: DAY 037: FREEFILE - by Pete - 12-18-2022, 04:30 PM
RE: DAY 037: FREEFILE - by Dimster - 12-18-2022, 05:08 PM
RE: DAY 037: FREEFILE - by Pete - 12-18-2022, 05:20 PM



Users browsing this thread: 1 Guest(s)