当前位置: 首页 > 工具软件 > DeNSo DB > 使用案例 >

denso BHT-8048DB程序

弘思聪
2023-12-01

        Rem $INCLUDE: 'BHTDEF.INC'
        Rem $INCLUDE: 'FUNC.TXT'

        REM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        REM    START:
        REM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

START:
         'KEY 4, CHR$(27)
         'KEY 5, CHR$(20)
         'KEY 6, CHR$(21)
               
  KEY 10,CHR$(13)
  KEY 1, CHR$(18) 'F1
  KEY 2, CHR$(24)
  KEY 3, CHR$(19)
  KEY 4, CHR$(27)
  KEY 5, CHR$(20)
  KEY 6, CHR$(21)
  KEY 7, CHR$(22) 'F7
  KEY 8, CHR$(23) 'F8
 'KEY 8, "BL40"  ' bei4guang1


        M$ = "0"
        ON ERROR GOTO ERR01
        'var
        DEFREG S0%,S1%,S2%,S3%,S4% ,PO%, PO1%     
        DEFREG I%=0
        DEFREG SL%=0
 
       
        '-------------------------盎代腹--------------------------------------------       
               PARA%=.syPrdctNo
              
               CALL "SYSTEM.FN3" .fcSysSGet PARA%,DATA$
               T10$=MID$(DATA$,13,4)
               'If DATA$<>"4963102800400887" Then
               'K$=FNSETCODE$
               If FNGETCODE$="0" Then
               While 1
                  OUT &H6080,1
                  ER% = FNDISPTXT(1, 1, 1, "  盘点机系统",20)
                  ER% = FNDISPTXT(1, 1, 3, "深圳天成软件制作",20)
                  ER% = FNDISPTXT(1, 1, 5, "  13923795875",20)
                  K$=FNWAITKEY$
               Wend
               End If
 '----------------------------------------------------------------------------------  

        OUT &H6080,1  'SMALL SIZE 
        OUT &H60B0,1 
        POWER 180
       
        
        S0%=0
        While 1              
  '-----------------------------------------------------------------------------------
   S11% = 1
   While S0%=0  
  While S11% = 1
         CLS
  S11% = 10
                  ER% = FNDISPTXT(1, 1, 2, "  盘点机系统",20)
                  ER% = FNDISPTXT(1, 1, 5, "深圳天成软件制作",20)
                  ER% = FNDISPTXT(1, 1, 7, "  13923795875",20)
  TIMEB = 20
  WAIT 0, &H21
  Wend 'S11% = 1
        Cls
       
        ER% = FNDISPTXT(1, 1, 1," [1]仓库盘点", 0)
 ER% = FNDISPTXT(1, 1, 3," [2]下载物料表", 0)
 ER% = FNDISPTXT(1, 1, 5," [3]上传", 0)
 ER% = FNDISPTXT(1, 1, 7," [4]删除资料", 0)
 ER% = FNDISPTXT(1, 1, 9," [5]盘点资料", 0)

 K$=FNWAITKEY$
 Select K$
  Case "1" '================仓库盘点=
  S0%=1
  S1%=1
  Close
  Open "DATA.TXT" AS #1 RECORD 25000    '玻珇戈
  FIELD #1,16 AS TM$,30 AS MCH$,10 AS ShuLiang$,10 AS FL$ '虫HAO
  TM$=""
  TM1$=""
  MCH$=""
  FL$=""
  ShuLiang$=""
  Case "2" '================下载物料表=
             S0%=1
             S1%=2
         Case "3" '================上传盘点明细=
              Cls 
       ER% = FNDISPTXT(1, 1, 3," [1]上传盘点明细", 0)
       ER% = FNDISPTXT(1, 1, 5," [2]上传盘点", 0)
               K1$=FNWAITKEY$
             Select K1$
       Case "1" '================上传盘点明细=
                S0%=1
                S1%=3
              Case "2" '================上传盘点=
               S0%=1
               S1%=6
      Case CHR$(27)
        S0%=0
             Case Else
             End Select
  Case "4" '================删除资料=


              Cls 
       ER% = FNDISPTXT(1, 1, 3," [1]删除盘点明细", 0)
       ER% = FNDISPTXT(1, 1, 5," [2]删除盘点", 0)
               K1$=FNWAITKEY$
             Select K1$
       Case "1" '================上传盘点明细=
                S0%=1
                S1%=4
              Case "2" '================上传盘点=
               S0%=1
               S1%=7
      Case CHR$(27)
        S0%=0
             Case Else
             End Select
  Case "5" '================盘点资料=
  S0%=1
  S1%=5
  Close
  Open "pandian.TXT" AS #2 RECORD 25000    '玻珇戈
  FIELD #2,9 AS PD$
  PD$ = ""
  Case CHR$(27)
      S0%=0
         Case Else
         End Select
  '================絃翴穨===================================================
 While S1%=5 ' ================盘点资料=
    Cls
    Locate 1,1
    Print "条码:"+PD$
           K1$ = FNBARKEY$(9,"A",9,CHR$(27), 6, 1,PD$ )
    IF K1$ = CHR$(27)  THEN
  S0%=0
  S1%=0
    ELSE 
  PD$=K1$
  IF  Len(K1$)<> 9 THEN
   Cls
   ER% = FNDISPTXT(1, 1, 2,"条码长度错误", 0)
   BEEP 1, 2, 3, 523
   TIMEB = 20
   WAIT 0, &H21    
  ELSE
     PR1%=SEARCH(#2,PD$,K1$,1)
     If PR1%<>0 Then
   Cls
   ER% = FNDISPTXT(1, 1, 2,"条码重复", 0)
   BEEP 1, 2, 3, 523
   TIMEB = 20
   WAIT 0, &H21
      ELSE
   PUT #2
                    END IF
  END IF
           END IF
   
 Wend ' ================盘点资料=


  While S1%=1
    Cls
  Locate 1,1
  Print "条码:"+TM$
  Locate 1,3
  Print  "名称:"+MCH$    
  Locate 1,5
  Print  "数量:"+ShuLiang$
  Locate 1,7
  Print  "发料:"+FL$
           K1$ = FNBARKEY$(9,"A",16,CHR$(27), 6, 1,TM1$)
    IF K1$ = CHR$(27)  THEN
  S0%=0
  S1%=0
    ELSE      
    IF  Len(K1$)> 2 THEN
                   TM1$=K1$
     PR1%=SEARCH(#1,TM$,K1$,1)
     If PR1%<>0 Then
         Get #1,PR1%
   Cls
   'ER% = FNDISPTXT(1, 1, 2,"仓库盘点作业", 0)
       ER% = FNDISPTXT(1, 1, 1,"条码:"+TM$, 0)         
        
       ER% = FNDISPTXT(1, 1, 3,"名称:"+MCH$, 0)
       ER% = FNDISPTXT(1, 1, 5,"数量:"+ShuLiang$, 0)
              Locate 1,7
              Print  "发料:"+FL$
      ' K2$ = FNBARKEY$(9,"A",10,CHR$(27), 6, 3,ShuLiang1$)
       K2$ =FNKEYINB$(10,CHR$(27),6, 7)
       'K2$ = FNBAR$(9,"A",10,CHR$(27), 6, 3,ShuLiang$)
      ' K2$ = FNBARKEY$(9,"A",10,CHR$(27), 6, 3,ShuLiang$)
      IF K2$ = CHR$(27) THEN
          TM$=""
          ShuLiang$=""
                               MCH$=""
          FL$=""
      ELSE
    TM$=TM1$
    MCH$=MCH$
    ShuLiang$ = ShuLiang$
    IF K2$ = CHR$(13) THEN
    FL$ = FL$
    ELSE
    FL$ = K2$
    END IF
    PR1%=SEARCH(#1,TM$,K1$,1)
    PUT #1 ,PR1%
    BEEP
      END IF

     else
   Cls
   ER% = FNDISPTXT(1, 1, 2,"无此条码", 0)
   BEEP 1, 2, 3, 523
   TIMEB = 20
   WAIT 0, &H21
     End If
    END IF
          END IF
        Wend  'S1%=1'================絃翴穨===================================================
     
      While S1%=6  '================下载物料表=
  Close
  Open "pandian.TXT" AS #2 RECORD 25000    '玻珇戈
  FIELD #2,9 AS PD$ '虫HAO
  L% = 0
  Close
  Cls
                
             ER% = FNDISPTXT(1, 6, 1,"【上传盘点】",20)
             ER% = FNDISPTXT(1,  1, 3,  "  盘点资料传输中...", 0)
             ER% = FNDISPTXT(1,  1, 5,  "  上传 pandian.TXT" , 0)
             ER% = FNDISPTXT(1,  1, 9,  " 请按【C】键取消 ", 0)
             Locate 1,7
             Print "  00000/";RIGHT$("00000"+MID$(STR$(L%),2),5);
             Locate 3,7
             FAL%=0
             Open "COM:38400,N,8,1"  AS #2
             XFILE "pandian.TXT",  "SPM"  '"RSM"
             Close #2
             TIMEB = 50
             WAIT 0, &H21
             If FAL%=0 Then
               Cls
               ER% = FNDISPTXT(1, 6, 1,"【上传作业】",20)
               ER% = FNDISPTXT(1, 1, 3, "  传送完毕!!  ", 16)
               ER% = FNDISPTXT(1, 1, 7, "  请按任何键回主功能", 0)
               BEEP 1, 2, 3, 523
               TIMEB = 10
               WAIT 0, &H21
               K$=FNWAITKEY$
             Else
               Cls
               ER% = FNDISPTXT(1, 6, 1,"【上传作业】",20)
               ER% = FNDISPTXT(1, 1, 3, "    传送失败!!", 1)
               ER% = FNDISPTXT(1, 1, 7, "    请按任何键", 0)
               BEEP 1, 2, 3, 523
               TIMEB = 10
               WAIT 0, &H21
               K$=FNWAITKEY$
             End If
  S0%=0
  S1%=0 
       
      Wend '  S1%=6'================下载物料表=


      While S1%=2 '================上传盘点明细=
  Close
  Open "DATA.TXT" AS #1 RECORD 25000    '玻珇戈
  FIELD #1,16 AS TM$,30 AS MCH$,10 AS ShuLiang$,10 AS FL$ '虫HAO
  L% = LOF(#1)
  Close
  Cls
              
             ER% = FNDISPTXT(1, 6, 1,"【下载作业】",20)
             ER% = FNDISPTXT(1,  1, 3,  "  盘点资料传输中...", 0)
             ER% = FNDISPTXT(1,  1, 5,  "  下载 DATA.TXT" , 0)
             ER% = FNDISPTXT(1,  1, 9,  " 请按【C】键取消 ", 0)
             Locate 1,7
             Print "  00000/";RIGHT$("00000"+MID$(STR$(L%),2),5);
             Locate 3,7
             FAL%=0
      TIMEB = 50
             WAIT 0, &H21
             Open "COM:38400,N,8,1"  AS #1
             XFILE "DATA.TXT", "RSM" '"SPM"
             Close #1
             TIMEB = 50
             WAIT 0, &H21
             If FAL%=0 Then
               Cls
               ER% = FNDISPTXT(1, 6, 1,"【下载作业】",20)
               ER% = FNDISPTXT(1, 1, 3, "  传送完毕!!  ", 16)
               ER% = FNDISPTXT(1, 1, 7, "  请按任何键回主功能", 0)
               BEEP 1, 2, 3, 523
               TIMEB = 10
               WAIT 0, &H21
               K$=FNWAITKEY$
             Else
               Cls
               ER% = FNDISPTXT(1, 6, 1,"【下载作业】",20)
               ER% = FNDISPTXT(1, 1, 3, "    传送失败!!", 1)
               ER% = FNDISPTXT(1, 1, 7, "    请按任何键", 0)
               BEEP 1, 2, 3, 523
               TIMEB = 10
               WAIT 0, &H21
               K$=FNWAITKEY$
             End If
  S0%=0
  S1%=0 
      Wend  ' S1%=3  ===============上传盘点明细=
    
      While S1%=3 '================上传盘点明细=
  Close
  Open "DATA.TXT" AS #1 RECORD 25000    '玻珇戈
  FIELD #1,16 AS TM$,30 AS MCH$,10 AS ShuLiang$,10 AS FL$ '虫HAO
  L% = LOF(#1)
  Close
  Cls
              
             ER% = FNDISPTXT(1, 6, 1,"【上传作业】",20)
             ER% = FNDISPTXT(1,  1, 3,  "  盘点资料传输中...", 0)
             ER% = FNDISPTXT(1,  1, 5,  "  上传 DATA.TXT" , 0)
             ER% = FNDISPTXT(1,  1, 9,  " 请按【C】键取消 ", 0)
             Locate 1,7
             Print "  00000/";RIGHT$("00000"+MID$(STR$(L%),2),5);
             Locate 3,7
             FAL%=0
      TIMEB = 50
             WAIT 0, &H21
             Open "COM:38400,N,8,1"  AS #1
             XFILE "DATA.TXT", "SPM"
             Close #1
             TIMEB = 50
             WAIT 0, &H21
             If FAL%=0 Then
               Cls
               ER% = FNDISPTXT(1, 6, 1,"【上传作业】",20)
               ER% = FNDISPTXT(1, 1, 3, "  传送完毕!!  ", 16)
               ER% = FNDISPTXT(1, 1, 7, "  请按任何键回主功能", 0)
               BEEP 1, 2, 3, 523
               TIMEB = 10
               WAIT 0, &H21
               K$=FNWAITKEY$
             Else
               Cls
               ER% = FNDISPTXT(1, 6, 1,"【上传作业】",20)
               ER% = FNDISPTXT(1, 1, 3, "    传送失败!!", 1)
               ER% = FNDISPTXT(1, 1, 7, "    请按任何键", 0)
               BEEP 1, 2, 3, 523
               TIMEB = 10
               WAIT 0, &H21
               K$=FNWAITKEY$
             End If
  S0%=0
  S1%=0 
      Wend  ' S1%=3  ===============上传盘点明细=

      While S1%=4 '删除       
       Cls
             ER% = FNDISPTXT(1, 6, 1,"【删除作业】",20)
             ER% = FNDISPTXT(1, 1, 3,"1.删除资料",16)
             ER% = FNDISPTXT(1, 1, 5,"其它任意键放弃",16)
             ER% = FNDISPTXT(1, 1, 7,"选择:",16)

        K1$=FNWAITKEY$
             Select K1$
             Case "1"
  Close
  Open "DATA.TXT" AS #1 RECORD 25000    '玻珇戈
  FIELD #1,16 AS TM$,30 AS MCH$,10 AS ShuLiang$,10 AS FL$ '虫HAO
  Close  
               Kill "DATA.TXT"
              
               Cls
               ER% = FNDISPTXT(1, 6, 1,"【删除作业】",20)
               ER% = FNDISPTXT(1, 1, 5, "  删除完毕!!", 1)
               BEEP 1, 2, 3, 523
               TIMEB = 10
               WAIT 0, &H21
               S0%=0
               S1%=0 
             Case Else
        S0%=0
               S1%=0
             End Select

      Wend  ' S1%=4

      While S1%=7 '删除       
       Cls
             ER% = FNDISPTXT(1, 6, 1,"【删除作业】",20)
             ER% = FNDISPTXT(1, 1, 3,"1.删除资料",16)
             ER% = FNDISPTXT(1, 1, 5,"其它任意键放弃",16)
             ER% = FNDISPTXT(1, 1, 7,"选择:",16)

        K1$=FNWAITKEY$
             Select K1$
             Case "1"
  Close
  Open "pandian.TXT" AS #2 RECORD 25000    '玻珇戈
  FIELD #2,9 AS PD$
  Close  
               Kill "pandian.TXT"
              
               Cls
               ER% = FNDISPTXT(1, 6, 1,"【删除作业】",20)
               ER% = FNDISPTXT(1, 1, 5, "  删除完毕!!", 1)
               BEEP 1, 2, 3, 523
               TIMEB = 10
               WAIT 0, &H21
               S0%=0
               S1%=0 
             Case Else
        S0%=0
               S1%=0
             End Select

      Wend  ' S1%=4

 

 

   Wend 'S0%=0

        
   '----------------------------------------------------------------------------------------
        Wend ' 1         
        
   '========================================================================================
   '========================================================================================


ERR01:
        Select ERR
        Case 70
          ER% = FNDISPTXT(1, 1, 9, "传输时间过长", 0)
          Beep 1, 2, 3, 523
          TIMEB = 10
          WAIT 0, &H21
          FAL%=1
          ER% = FNDISPTXT(1, 1, 9, "             ", 0)
        Case 71
          ER% = FNDISPTXT(1, 1, 4, "   传送中断        ", 0)
          Beep 1, 2, 3, 523
          TIMEB = 10
          WAIT 0, &H21
          FAL%=1
          ER% = FNDISPTXT(1, 1, 4, "             ", 0)
        'Case 53
          'ER% = FNDISPTXT(1, 1, 3, "   已清除", 0)
          'TIMEB = 30
          'WAIT 0, &H21
          'ER% = FNDISPTXT(1, 1, 3, "             ", 0)

        Case Else
          ER% = FNDISPTXT(1, 1, 3, "ERR"+STR$(ERR), 0)
          ER% = FNDISPTXT(1, 1, 5, "E:"+ERRR$, 0)
          WAIT 0,&H3
          K$=INKEY$
          FAL%=1
        End Select
       
        FAL%=1
       
        Resume Next

 类似资料: