Cheetah Works then does not Work
Posted: Wed Jun 27, 2007 10:24 pm
I have written a couple of small programs using Cheetah2.dll with the CheetaInc.pb (PureBasicStarter.zip wrapper written by Bob Houle).
Here is the simplest program
Works fine. Close things down for the night and the next day I come in and the program will not work. No Error Messages, nothing. Just no .dbf files created like the day before. Started from scratch and copied "chunks" from original and it worked. Today again, not working, well sort-of. It "creates" .dbf files but they are empty, i.e. 0 kb, no structure, no header, nothing. Tried starting a new program and copying the chunks again and it does not work.
Seems really strange. Any ideas as to this behavior? Thought maybe hardware problem, shutdown and reboot, no help. Have tried on other computer with same results.
Sly'vnr
Here is the simplest program
Code: Select all
Dim field$(50)
XIncludeFile "C:\Program Files\Purebasic\Includes\CheetahInc.pb"
xdbUseDLL()
dat_directory$=GetCurrentDirectory()
dat_directory$=dat_directory$+"\"
CustomerDB$=dat_directory$+"Customer.dbf"
;
F_CustID$="CustID,N,10,0"
F_CustName$="CustName,C,30,0"
F_CustAdd$="CustAddr,C,50,0"
F_CustCSZ$="CustCSZ,C,75,0"
F_CustPhone$="CustPhone,C,13,0"
F_CustFax$="CustFax,C,13,0"
dbFields$=F_CustID$+";"+F_CustName$+";"+F_CustAdd$+";"+F_CustCSZ$+";"
dbFields$=dbFields$+F_CustPhone$+";"+F_CustFax$
xdbCreate(CustomerDB$,dbFields$)
AnyErrors()
JobsDB$=dat_directory$+"Jobs.dbf"
F_JobID$="JobID, N, 10, 0"
field$(0)="JobDesc1, C, 50,0"
field$(1)="JobDesc2, C, 50,0"
field$(2)="JobDesc3, C, 50,0"
field$(3)="Bidtype, N, 2,0"
field$(4)="Pitches, C, 80, 0"
field$(5)="Stories, C, 80,0"
field$(6)="Removal, C, 80, 0"
field$(7)="Deck, C, 80,0"
field$(8)="DryinSqFt, C, 12, 0"
field$(9)="DryinMat, C, 30,0"
field$(10)="RoofSqFt, C, 12, 0"
field$(11)="Roofguage, C, 4,0"
field$(12)="RoofDesc,C,80,0"
field$(13)="RoofType,N,2,0"
field$(14)="SSRoofHgt,C,3,0"
field$(15)="SSRoofWid,C,3,0"
field$(16)="VentRidge,C,12,0"
field$(17)="Hips,C,12,0"
field$(18)="Valley,C,12,0"
field$(19)="Sidewall,C,12,0"
field$(20)="SWtoWood,C,12,0"
field$(21)="SWtoRock,C,12,0"
field$(22)="EndWall,C,12,0"
field$(23)="EWtoWood,C,12,0"
field$(24)="EWtoRock,C,12,0"
field$(25)="Fireplace,C,12,0"
field$(26)="FPtoWood,C,12,0"
field$(27)="FPtoRock,C,12,0"
field$(28)="HDE,C,12,0"
field$(29)="HDEE,C,12,0"
field$(30)="HDEG,C,12,0"
field$(31)="FlashGauge,C,4,0"
field$(32)="FlashMat,C,30,0"
field$(33)="Days,C,4,0"
field$(34)="MatWar,C,30,0"
field$(35)="WorkWar,C,30,0"
field$(36)="BidPrice,C,16,0"
field$(37)="Option1,C,150,0"
field$(38)="Option1P,C,16,0"
field$(39)="Option2,C,150,0"
field$(40)="Option2P,C,16,0"
field$(41)="Option3,C,150,0"
field$(42)="Option3P,C,16,0"
field$(43)="Option4,C,150,0"
field$(44)="Option4P,C,16,0"
field$(45)="JiPDraw,C,16,0"
field$(46)="Extra1,C,30,0"
field$(47)="Extra2,C,30,0"
AllFields$=F_CustID$+";"+F_JobID$
For i=0 To 47
AllFields$=";"+AllFields$+field$(i)
Next i
xdbCreate(JobsDB$,AllFields$)
AnyErrors()
AllFields$=""
DefaultsDB$=dat_directory$+"Settings.dbf"
AllFields$="FType,C,20,0;FSeq,N,10,0;FText,C,100,0;FFont,C,40,0;FSize,C,3,0;FType,C,120,0"
xdbCreate(DefaultsDB$,AllFields$)
AnyErrors()
;PureZIP_Archive_Create(dat_directory$+"TOPMRoof.Bid",#APPEND_STATUS_CREATE)
;PureZIP_Archive_Compress(dat_directory$+"Customer.dbf",#False)
;PureZIP_Archive_Compress(dat_directory$+"Jobs.dbf", #False)
;PureZIP_Archive_Compress(dat_directory$+"Settings.dbf",#False)
;PureZIP_Archive_Close()
;DeleteFile(dat_directory$+"Customer.dbf")
;DeleteFile(dat_directory$+"Jobs.dbf")
;DeleteFile(dat_directory$+"Defaults.dbf")
xdbFreeDLL()
Seems really strange. Any ideas as to this behavior? Thought maybe hardware problem, shutdown and reboot, no help. Have tried on other computer with same results.
Sly'vnr