file_ini.prg

来自「vfp 源码,比较全面」· PRG 代码 · 共 83 行

PRG
83
字号
* file_ini.prg 文件初始化
locaL cNotFileList,nNotFile,isShutdown
cNotFileList=""
nNotFile=0
nTotalFiles=10 && 所需文件个数

dime mFileList(nTotalFiles,2)
mFileList(1,1)='Thisday.dbf'
mFileList(1,2)="当前帐目库"
mFileList(2,1)='Thisday.fpt'
mFileList(2,2)="当前帐目操作痕迹及备注"
mFileList(3,1)='History.dbf'
mFileList(3,2)="历史记录库"
mFileList(4,1)='History.fpt'
mFileList(4,2)='历史记录库备注'
mFileList(5,1)='Hs_log.dbf'
mFileList(5,2)='每日合计记录库'
mFileList(6,1)='Cashier.dbf'
mFileList(6,2)='操作员记录库'
mFileList(7,1)='Roomlist.dbf'
mFileList(7,2)='餐桌设置库'
mFileList(8,1)='Setup.dbf'
mFileList(8,2)='代码库'
mFileList(9,1)='Folio.dbf'
mFileList(9,2)='当前帐目明细库'
mFileList(10,1)='Hs_Folio.dbf'
mFileList(10,2)='历史帐目明细库'

FOR P=1 TO nTotalFiles
   if !file('&mFileList(p,1)')
      nNotFile=nNotFile+1
      cNotFileList=cNotFileList+allt(str(nNotFile))+"、"+"&mFileList(p,2)"+"文件:"+"&mFileList(p,1)"+chr(13)
      isShutdown=.t.
   endif
ENDFOR

if isShutdown=.t.
     n=messagebox("请检查下列文件:"+chr(13)+chr(13)+;
cNotFileList+chr(13)+"由于缺少以上文件,程序运行可能会出错!",2+16,"检查文件")
    if n=4  && 重试
       do file_ini
    endif
    if n=3  && 终止
       do shutdown
    endif
else
   if file('thisday.dbf')
      use thisday
      pack
      use
   endif      
   if file('folio.dbf')
      use folio
      pack
      use
   endif      
   
endif

oStartForm.msg.caption= "检查历史库及当前库编号的唯一性..."
do only_chk with "History","ID"
do only_chk with "Thisday","ID"

oStartForm.msg.caption="检查帐目库,获取最大帐目号..."
do get_max_id

oStartForm.msg.caption= "正在检查餐桌位置的唯一性..."
do only_chk with "RoomList","Position"
oStartForm.msg.caption= "正在检查餐桌名称的唯一性..."
do only_chk with "RoomList","RoomName"
oStartForm.msg.caption= "正在检查物品名称的唯一性... "
do only_chk with "WuPin","Id"
oStartForm.msg.caption= "正在检查累计数据日期的唯一性..."
do only_chk with "hs_log","date"

oStartForm.msg.caption="正在检查帐目正确及一致性..."
do check_folio

if file('&softname..hlp')
   set help to &softname..hlp
endif   
retu

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?