Answered my own question:
I was just thinking... Would it be easier on the computer to take a two dimension array?
ie (DIM activeDatafile$(indexnum,amountofcoordinates)
If so, how would I reference data? All programming I've done before I've always used one dimension, or just steered away from them.
EDIT:
Ok, so I came up with some working code! Still doesn't work in the main loop, but I think it's going to be easier to work with.
Dim activeDatafile$(106,3000)
load_Data$="../CresisXPtScanOut.txt"
Open to Read 1, load_Data$
`Dimension 1
For index = 0 to 106
` Check for the end of the file and leave the FOR/NEXT loop
if file end(1) then exit
`Dimension 2
For coordinate = 0 to 2926
` Check for the end of the file and leave the FOR/NEXT loop
if file end(1) then exit
`Read AS string
read string 1, ycord$
`Check for end of index
if left$(ycord$,1) = "#"
read string 1,a$
read string 1,a$
exit
Else
`Verify data
if left$(ycord$,1) <> ""
activeDatafile$(index,coordinate) = ycord$
endif
EndIf
`Show the data is being saved
print "activeDataFile$("+str$(index)+","+str$(coordinate)+") = "+activeDatafile$(index,coordinate)
Next coordinate
Next Index
Close file 1
Wait Key
Actual program (other then DLLS (BBB Gui and IanM's I believe) no external media):
// Plotter //
set display mode 1024,768,32
windows set font 7,"Arial",0,0,0,0
//GUI Controls!
start bbb gui
dbpro_w=get dbpro window() : set main window dbpro_w
OpenLoadDialog=make button(20,20,100,20,"Open",dbpro_w)
Plot = make button(140,20,100,20,"Plot",dbpro_w)
CloseApp = make button(400,20,100,20,"Close",dbpro_w)
IndexSelector=make combobox(20,50,50,100,CBS_DROPDOWN||WS_VSCROLL,dbpro_w)
For index = 0 to 106
Combobox insert string IndexSelector, str$(index), index
next index
//GRAPHING REGION CONSTANTS
plotxstart = 100
plotxend = 1000
plotyend = 150
plotystart = 748
// X and Y Axis
ink RGB(255,0,0),0
line plotxstart,plotystart,plotxend,plotystart
line plotxstart,plotystart,plotxstart,plotyend
ink RGB(255,255,255),0
//Array
Dim activeDatafile$(106,3000)
// LOOP
sync on: sync rate 0
Do
// I don't like the escapekey
Disable Escapekey
//Close button routine
if button clicked(CloseApp)
end bbb gui:End
EndIf
//Open button routine
if button clicked(OpenLoadDialog)
load_Data$ = Open File Dialog ("Select Document to Load", "Text Document (*.txt)")
If file exist(load_Data$) = 1
gosub Read_File
Else
load_Data$ = ""
errorbox=make message box("File not found, please select a different file.", "Error!", 0)
EndIf
EndIf
//Comment to myself. Let's me know what I'm working from
If load_Data$ <> "" then text 0,0, load_Data$
//Plot button routine
if button clicked(Plot)
If load_Data$ <> ""
gosub drawlogplot
Endif
EndIf
//Graph Controls Go Here, but not made yet
//BBB GUI stuff that I have no clue how it works, but it does, so I leave it alone
repeat
get event
h=event get handle()
m=event get message()
if h=get main window()
if m=WM_CLOSE
a=make message box("Are you sure you want to quit?","BBB Gui plugin",MB_YESNO)
if a=IDYES then end bbb gui : end
endif
endif
until m=0
//End of loop
Sync
Loop
//Freak accident?
End
//For open dialog
Read_File:
`2 Dimension array... expanding my horizions :D
Open to Read 1, load_Data$
`Dimension 1
For index = 0 to 106
` Check for the end of the file and leave the FOR/NEXT loop
if file end(1) then exit
`Dimension 2
For coordinate = 0 to 2926
` Check for the end of the file and leave the FOR/NEXT loop
if file end(1) then exit
`Read AS string
read string 1, ycord$
`Check for end of index
if left$(ycord$,1) = "#"
read string 1,a$
read string 1,a$
exit
Else
`Verify data
if left$(ycord$,1) <> ""
activeDatafile$(index,coordinate) = ycord$
endif
EndIf
`Show the data is being saved
print "activeDataFile$("+str$(index)+","+str$(coordinate)+") = "+activeDatafile$(index,coordinate)
wait 1
Next coordinate
Next Index
Close file 1
Wait Key
Return
//Sudo code for Index 0 will produce a nice log plot.
drawlogplot:
remstart
for cord = 0 to 2926
xcord# = (((plotxend-plotxstart)/2926.0000) * cord) + plotxstart
ycord# = activeIndex(cord)
//ycord# = -35*log(ycord#)+ (.5*(plotystart+plotyend))
if cord > 0 then line oldxcord#, oldycord#,xcord#,ycord#
oldxcord# = xcord#
oldycord# = ycord#
next cord
remend
return
If at first you dont succeed, LOWER YOUR STANDARDS.