Thanks for the response.
I finally got it to recognize the file but get the following:
Initializing full parser ..
Found command dfscreate at line 16
Compiling DarkBasic Professional executable..
Error: Could not understand command at line 29.
Error: Resolving source library..
Error: Attempted use a command from dependency list Lib-P_DarkKFS.gde but the library was not found.
; **** added the below 6 lines to get the PureGDK pre-compiler to load and run
GWidth=1024 ; origianlly was DesktopWidth(0)-250
GHeight=768 ; originally was DesktopHeight(0)-250
MWidth=800 ; originally was GWidth*0.8
MHeight=600 ; originally was GHeight*0.75
mainwinID=OpenWindow(#PB_Any,100,100,GWidth,GHeight,"DarkData Test", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)
hDBWnd=OpenDBWnd(WindowID(mainwinID),0,0,MWidth,MHeight)
;**** STOP ADDED LINES ******
datafile=1
index=2
; Create a file called "solsys.dat"
;
;*** NO ERRORS HERE WITH THESE CALLS
;
DFSCreate(1, "solsys.dat",0)
DFSAddField(datafile, "String 8 As Name")
DFSAddField(datafile, "Integer As Radius")
DFSAddField(datafile, "Byte as Position")
DFSFinish(datafile)
; Create an index For it
KFSCreate(index, "solsys.kfs", 8, 0, 0)
For i = 1 To 8
Read.s planet$
Read.l radius
Read.l position
;*** ERROR HERE (although other DarkData Functions have been called above)
recnum = DFSAdd(datafile)
DFSPutStr(datafile, "name", planet$)
DFSPut(datafile, "radius", radius)
DFSPut(datafile, "position", position)
DFSSave(datafile, recnum)
KFSAdd(index, planet$, recnum)
Next i
KFSReset(datafile)
For i = 1 To KFSCount(index)
recnum = KFSNext(index)
DFSLoad(datafile, recnum)
planet$ = DFSGetStr(datafile, "name")
radius = DFSGet(datafile, "radius")
position = DFSGet(datafile, "position")
Debug Str(recnum)+" "+ planet$ + Space(10 - Len(planet$))+ Str(radius)
Next i
OpenConsole()
Repeat
Print("Planet Name ? ")
planet$=Input()
If UCase(planet$) <> "QUIT"
recnum = KFSFind(index, planet$)
If recnum > 0
Debug "Found"
DFSLoad(datafile, recnum)
planet$ = DFSGetStr(datafile, "name")
radius = DFSGet(datafile, "radius")
Debug planet$ + Space(10 - Len(planet$))+ Str(radius)
Else
Debug planet$+" - Not found"
EndIf
EndIf
Until UCase(planet$) = "QUIT"
DFSClose(datafile)
KFSClose(index)
End
DataSection
Data.s "Earth"
Data.l 12756, 3
Data.s "Mars"
Data.l 6788, 4
Data.s "Mercury"
Data.l 4880, 1
Data .s"Venus"
Data.l 12104, 2
Data.s "Jupiter"
Data.l 142740, 5
Data.s "Saturn"
Data.l 120034, 6
Data.s "Uranus"
Data.l 51152, 7
Data.s "Neptune"
Data.l 51152, 8
EndDataSection
I dragged my Lib-P_DarkKFS.gdt to the GDKLib Builder.exe in the PureGDK\Plugin-sdk folder which created Dependencies and Sources Folders. I copied the Lib-P_DarkKFS.gde file to the PureBasic\PureGDK\Commands Folder
I then loaded the Lib-P_DarkKFS.pb into PureBasic and ran Tailbite.
I wrote my code (above) and it would never start the PureGDK pre-compiler. I inserted calls to open a "DarkBasic Window" (first 6 lines) and the pre-compiler loaded and gave the above error.
Thanks for any input.
Slyvnr
Slyvnr