| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 807 人关注过本帖
标题:请教任意输入字显示
取消只看楼主 加入收藏
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
结帖率:56.25%
收藏
已结贴  问题点数:20 回复次数:5 
请教任意输入字显示
请教问题
这句中: SELECT dspph,dcc,dpm,dgg,dsl,dkc,dkh,dfw,dhzh,dhth,drq,dxh,dlx FROM (path+"lys") WHERE &cxjgtj INTO CURSOR cxtmp

 " &cxjgtj " 现在只有输入全部才可以显示,怎样可以改为输入任意一个字都可以显示。
2014-03-05 23:55
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
PROCEDURE rckcx
 PARAMETER RCPOPUP
 PUBLIC CXFORM
 PUBLIC XRCPOPUP , QRQ , ZRQ , SPPH , KH , HZH , HTH , CXJGTJ , RKZL , CKZL , RKJS ,  ;
      CKJS
 PUSH KEY CLEAR
 ON KEY LABEL ESC DO getout IN rckcx
 SET SKIP OF MENU _MSYSMENU .T.
 XRCPOPUP = RCPOPUP
 CXJGTJ = ''
 STORE 0 TO RKZL , CKZL , RKJS , CKJS
 STORE SPACE(8) TO HTH
 STORE SPACE(7) TO HZH
 STORE SPACE(4) TO KH
 STORE SPACE(8) TO SPPH
 STORE {} TO QRQ , ZRQ
 CXFORM = CREATEOBJECT('cxform')
  CXFORM.SHOW
 READ EVENTS
ENDPROC
*------
PROCEDURE getout
 RELEASE CXFORM
 RETURN
ENDPROC
*------
PROCEDURE cxtj
 PARAMETER FN , FE , LE
 IF  .NOT. EMPTY(CXJGTJ)
    CKCXTJE = CXJGTJ + SPACE(1) + 'AND' + SPACE(1) + FN + LE + FE
 ELSE
    CKCXTJE = CXJGTJ + FN + LE + FE
 ENDIF
 RETURN CKCXTJE
ENDPROC
*------
DEFINE CLASS cxform AS Form
 TOP = 0
 LEFT = 0
 HEIGHT = 405
 WIDTH = 635
 BACKCOLOR = RGB(255,240,230)
 BORDERSTYLE = 2
 KEYPREVIEW = .T.
 ALWAYSONTOP = .F.
 CAPTION = '入出库查询'
 CLOSABLE = .F.
 CONTROLBOX = .T.
 MAXBUTTON = .F.
 MINBUTTON = .F.
 MOVABLE = .F.
 VISIBLE = .T.
 NAME = 'cxform'
 ADD OBJECT SPPHLABEL AS LABEL WITH TOP = 10 , LEFT = 10 , HEIGHT = 25 , WIDTH = 55 ,  ;
      CAPTION = '商品编号:' , BACKCOLOR = RGB(255,240,230) , NAME =  ;
      'spphlabel'
 ADD OBJECT SPPHTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 65 , HEIGHT = 22 , WIDTH = 70 ,  ;
      INPUTMASK = 'XXXXXXXX' , CONTROLSOURCE = 'spph' , NAME = 'spphtext'
 ADD OBJECT HTHLABEL AS LABEL WITH TOP = 10 , LEFT = 145 , HEIGHT = 22 , WIDTH = 45 ,  ;
      CAPTION = '合同号:' , BACKCOLOR = RGB(255,240,230) , NAME =  ;
      'hthlabel'
 ADD OBJECT HTHTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 190 , HEIGHT = 22 , WIDTH = 70 ,  ;
      INPUTMASK = 'XXXXXXXX' , CONTROLSOURCE = 'hth' , NAME = 'hthtext'
 ADD OBJECT HZHLABEL AS LABEL WITH TOP = 10 , LEFT = 270 , HEIGHT = 22 , WIDTH = 45 ,  ;
      CAPTION = '货主号:' , BACKCOLOR = RGB(255,240,230) , NAME =  ;
      'hzhlabel'
 ADD OBJECT HZHTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 315 , HEIGHT = 22 , WIDTH = 60 ,  ;
      INPUTMASK = 'XXXXXXX' , CONTROLSOURCE = 'hzh' , NAME = 'hzhtext'
 ADD OBJECT KHLABEL AS LABEL WITH TOP = 10 , LEFT = 385 , HEIGHT = 22 , WIDTH = 30 ,  ;
      CAPTION = '库号:' , BACKCOLOR = RGB(255,240,230) , NAME = 'khlabel'
 ADD OBJECT KHTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 415 , HEIGHT = 22 , WIDTH = 40 ,  ;
      INPUTMASK = 'XXXX' , CONTROLSOURCE = 'kh' , NAME = 'khtext'
 ADD OBJECT QRQLABEL AS LABEL WITH TOP = 10 , LEFT = 465 , HEIGHT = 22 , WIDTH = 45 ,  ;
      CAPTION = '起日期:' , BACKCOLOR = RGB(255,240,230) , NAME =  ;
      'qrqlabel'
 ADD OBJECT QRQTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 510 , HEIGHT = 22 , WIDTH = 75 ,  ;
      CONTROLSOURCE = 'qrq' , NAME = 'qrqtext'
 ADD OBJECT ZRQLABEL AS LABEL WITH TOP = 35 , LEFT = 465 , HEIGHT = 22 , WIDTH = 45 ,  ;
      CAPTION = '止日期:' , BACKCOLOR = RGB(255,240,230) , NAME =  ;
      'zrqlabel'
 ADD OBJECT ZRQTEXT AS TEXTBOX WITH TOP = 31 , LEFT = 510 , HEIGHT = 22 , WIDTH = 75 ,  ;
      CONTROLSOURCE = 'zrq' , NAME = 'zrqtext'
 ADD OBJECT CXGRID AS GRID WITH TOP = 60 , LEFT = 0 , WIDTH = 520 , HEIGHT = 310 ,  ;
      SCROLLBARS = 3 , COLUMNCOUNT = 13 , GRIDLINES = 2 , VISIBLE = .F. ,  ;
      DELETEMARK = .F. , RECORDMARK = .T. , HEADERHEIGHT = 30 , ROWHEIGHT = 22 ,  ;
      NAME = 'cxgrid'
 ADD OBJECT RKZLLABEL AS LABEL WITH TOP = 65 , LEFT = 550 , HEIGHT = 25 , WIDTH = 70 ,  ;
      FONTSIZE = 12 , FONTNAME = '宋体' , VISIBLE = .F. , CAPTION =  ;
      '入库吨:' , FORECOLOR = RGB(255,0,0) , BACKCOLOR = RGB(255,240,230) , NAME =  ;
      'rkzllabel'
 ADD OBJECT RKZLTEXT AS TEXTBOX WITH TOP = 85 , LEFT = 535 , HEIGHT = 25 , WIDTH = 95 ,  ;
      FONTSIZE = 12 , ENABLED = .F. , VISIBLE = .F. , CONTROLSOURCE =  ;
      'rkzl' , INPUTMASK = '99999.999' , DISABLEDBACKCOLOR = RGB(255,240,230) ,  ;
      DISABLEDFORECOLOR = RGB(0,0,255) , NAME = 'rkzltext'
 ADD OBJECT CKZLLABEL AS LABEL WITH TOP = 115 , LEFT = 550 , HEIGHT = 25 , WIDTH = 70 ,  ;
      FONTSIZE = 12 , FONTNAME = '宋体' , VISIBLE = .F. , CAPTION =  ;
      '出库吨:' , FORECOLOR = RGB(255,0,0) , BACKCOLOR = RGB(255,240,230) , NAME  ;
      = 'ckzllabel'
 ADD OBJECT CKZLTEXT AS TEXTBOX WITH TOP = 135 , LEFT = 535 , HEIGHT = 25 , WIDTH =  ;
      95 , FONTSIZE = 12 , ENABLED = .F. , VISIBLE = .F. , CONTROLSOURCE =  ;
      'ckzl' , INPUTMASK = '99999.999' , DISABLEDBACKCOLOR = RGB(255,240,230) ,  ;
      DISABLEDFORECOLOR = RGB(0,0,255) , NAME = 'ckzltext'
 ADD OBJECT RKJSLABEL AS LABEL WITH TOP = 165 , LEFT = 550 , HEIGHT = 25 , WIDTH = 70 ,  ;
      FONTSIZE = 12 , FONTNAME = '宋体' , VISIBLE = .F. , CAPTION =  ;
      '入库件数:' , FORECOLOR = RGB(255,0,0) , BACKCOLOR = RGB(255,240,230) ,  ;
      NAME = 'rkjslabel'
 ADD OBJECT RKJSTEXT AS TEXTBOX WITH TOP = 185 , LEFT = 535 , HEIGHT = 25 , WIDTH =  ;
      95 , FONTSIZE = 12 , ENABLED = .F. , VISIBLE = .F. , CONTROLSOURCE =  ;
      'rkjs' , INPUTMASK = '99999999' , DISABLEDBACKCOLOR = RGB(255,240,230) ,  ;
      DISABLEDFORECOLOR = RGB(0,0,255) , NAME = 'rkjstext'
 ADD OBJECT CKJSLABEL AS LABEL WITH TOP = 215 , LEFT = 550 , HEIGHT = 25 , WIDTH = 70 ,  ;
      FONTSIZE = 12 , FONTNAME = '宋体' , VISIBLE = .F. , CAPTION =  ;
      '出库件数:' , FORECOLOR = RGB(255,0,0) , BACKCOLOR = RGB(255,240,230) ,  ;
      NAME = 'ckjslabel'
 ADD OBJECT CKJSTEXT AS TEXTBOX WITH TOP = 235 , LEFT = 535 , HEIGHT = 25 , WIDTH =  ;
      95 , FONTSIZE = 12 , ENABLED = .F. , VISIBLE = .F. , CONTROLSOURCE =  ;
      'ckjs' , INPUTMASK = '99999999' , DISABLEDBACKCOLOR = RGB(255,240,230) ,  ;
      DISABLEDFORECOLOR = RGB(0,0,255) , NAME = 'ckjstext'
 ADD OBJECT PRINTBUTTON AS COMMANDBUTTON WITH FONTNAME = '宋体' , CAPTION = '打   印' ,  ;
      VISIBLE = .F. , HEIGHT = 25 , TOP = 280 , LEFT = 550 , WIDTH = 70 ,  ;
      NAME = 'printbutton'
 ADD OBJECT CXCX AS COMMANDBUTTON WITH FONTNAME = '宋体' , CAPTION = '查   询' ,  ;
      VISIBLE = .F. , HEIGHT = 25 , TOP = 315 , LEFT = 550 , WIDTH = 70 , NAME =  ;
      'cxcx'
 ADD OBJECT CXGETOUT AS COMMANDBUTTON WITH FONTNAME = '宋体' , CAPTION = '退   出' ,  ;
      VISIBLE = .T. , HEIGHT = 25 , TOP = 350 , LEFT = 550 , WIDTH = 70 ,  ;
      NAME = 'cxgetout'

PROCEDURE Unload
 CLEAR
 CLOSE ALL
 POP KEY
 SET SKIP OF MENU _MSYSMENU .F.
 RELEASE CXFORM , XRCPOPUP , QRQ , ZRQ , SPPH , KH , HZH , HTH , CXJGTJ , RKZL , CKZL ,  ;
      RKJS , CKJS
ENDPROC
*------

PROCEDURE spphtext.GotFocus
 IF XRCPOPUP = 'ckpop'
    THISFORM.CAPTION = '出库查询'
 ELSE
    THISFORM.CAPTION = '入库查询'
 ENDIF
ENDPROC
*------

PROCEDURE spphtext.Valid
 RKZL = 0
 CKZL = 0
 IF EMPTY(THISFORM.SPPHTEXT.VALUE)
    THISFORM.HTHTEXT.ENABLED = .T.
 ELSE
    HTH = SPACE(8)
    HZH = SPACE(7)
    KH = SPACE(4)
    QRQ = {}
    ZRQ = {}
    THISFORM.HTHTEXT.ENABLED = .F.
    THISFORM.HZHTEXT.ENABLED = .F.
    THISFORM.KHTEXT.ENABLED = .F.
    THISFORM.QRQTEXT.ENABLED = .F.
    THISFORM.ZRQTEXT.ENABLED = .F.
     THISFORM.REFRESH
    SELECT DSPPH , DCC , DPM , DGG , DSL , DKC , DKH , DFW , DHZH , DHTH , DRQ , DXH , DLX  ;
         FROM (PATH + 'lys') WHERE DSPPH = SPPH INTO CURSOR cxtmp
    USE IN LYS
    IF _TALLY = 0
       ?? CHR(7)
       THISFORM.CXGRID.VISIBLE = .F.
       WAIT WINDOW '无此条件数据!'
       SPPH = SPACE(8)
        THISFORM.REFRESH
       RETURN 0
    ELSE
       SUM FOR DLX = '入库' TO RKZL DSL * DGG / 1000
       SUM FOR DLX = '出库' TO CKZL -DSL * DGG / 1000
       SUM FOR DLX = '入库' TO RKJS DSL
       SUM FOR DLX = '出库' TO CKJS -DSL
       GO TOP
       THISFORM.SPPHTEXT.ENABLED = .F.
       THISFORM.CXGRID.VISIBLE = .T.
       THISFORM.CXGRID.RECORDSOURCE = 'cxtmp'
       THISFORM.RKZLLABEL.VISIBLE = .T.
       THISFORM.RKZLTEXT.VISIBLE = .T.
       THISFORM.CKZLLABEL.VISIBLE = .T.
       THISFORM.CKZLTEXT.VISIBLE = .T.
       THISFORM.RKJSLABEL.VISIBLE = .T.
       THISFORM.RKJSTEXT.VISIBLE = .T.
       THISFORM.CKJSLABEL.VISIBLE = .T.
       THISFORM.CKJSTEXT.VISIBLE = .T.
       THISFORM.PRINTBUTTON.VISIBLE = .T.
       THISFORM.CXCX.VISIBLE = .T.
        THISFORM.REFRESH
    ENDIF
 ENDIF
ENDPROC
*------

PROCEDURE hthtext.Valid
 THISFORM.QRQTEXT.ENABLED = .T.
 THISFORM.ZRQTEXT.ENABLED = .T.
 IF EMPTY(THISFORM.HTHTEXT.VALUE)
    THISFORM.HZHTEXT.ENABLED = .T.
    THISFORM.KHTEXT.ENABLED = .T.
 ELSE
    HZH = SPACE(7)
    KH = SPACE(4)
    THISFORM.HZHTEXT.ENABLED = .F.
    THISFORM.KHTEXT.ENABLED = .F.
     THISFORM.REFRESH
    CXJGTJ = CXTJ('DHTH','hth','=')
 ENDIF
ENDPROC
*------

PROCEDURE hzhtext.Valid
 CXJGTJ = ''
 IF  .NOT. EMPTY(THISFORM.HZHTEXT.VALUE)
    CXJGTJ = CXTJ('DHZH','hzh','=')
 ENDIF
ENDPROC
*------

PROCEDURE khtext.Valid
 IF  .NOT. EMPTY(THISFORM.KHTEXT.VALUE)
    CXJGTJ = CXTJ('DKH','kh','=')
 ENDIF
ENDPROC
*------

PROCEDURE qrqtext.Valid
 IF  .NOT. EMPTY(THISFORM.QRQTEXT.VALUE)
    CXJGTJ = CXTJ('DRQ','qrq','>=')
 ENDIF
ENDPROC
*------

PROCEDURE zrqtext.Valid
 RKZL = 0
 CKZL = 0
 IF  .NOT. EMPTY(THISFORM.ZRQTEXT.VALUE)
    CXJGTJ = CXTJ('DRQ','zrq','<=')
 ELSE
    IF EMPTY(CXJGTJ)
       RETURN -5
    ENDIF
 ENDIF
 IF XRCPOPUP = 'ckpop'
    CXJGTJ = CXJGTJ + " AND dlx='出库'"
 ELSE
    CXJGTJ = CXJGTJ + " AND dlx='入库'"
 ENDIF
 IF LASTKEY() = 5 .OR. LASTKEY() = 19
    RETURN -1
 ELSE
     SELECT dspph,dcc,dpm,dgg,dsl,dkc,dkh,dfw,dhzh,dhth,drq,dxh,dlx FROM (path+"lys") WHERE &cxjgtj INTO CURSOR cxtmp
    USE IN LYS
    IF _TALLY = 0
       ?? CHR(7)
       THISFORM.HZHTEXT.ENABLED = .T.
       THISFORM.KHTEXT.ENABLED = .T.
       THISFORM.CXGRID.VISIBLE = .F.
       WAIT WINDOW '无此条件数据!'
       SPPH = SPACE(8)
       HTH = SPACE(8)
       HZH = SPACE(7)
       KH = SPACE(4)
       STORE {} TO QRQ , ZRQ
        THISFORM.REFRESH
       RETURN -5
    ELSE
       SUM FOR DLX = '入库' TO RKZL DSL * DGG / 1000
       SUM FOR DLX = '出库' TO CKZL -DSL * DGG / 1000
       SUM FOR DLX = '入库' TO RKJS DSL
       SUM FOR DLX = '出库' TO CKJS -DSL
       GO TOP
       THISFORM.SPPHTEXT.ENABLED = .F.
       THISFORM.HTHTEXT.ENABLED = .F.
       THISFORM.HZHTEXT.ENABLED = .F.
       THISFORM.KHTEXT.ENABLED = .F.
       THISFORM.QRQTEXT.ENABLED = .F.
       THISFORM.ZRQTEXT.ENABLED = .F.
       THISFORM.CXGRID.VISIBLE = .T.
       THISFORM.CXGRID.RECORDSOURCE = 'cxtmp'
       THISFORM.RKZLLABEL.VISIBLE = .T.
       THISFORM.RKZLTEXT.VISIBLE = .T.
       THISFORM.CKZLLABEL.VISIBLE = .T.
       THISFORM.CKZLTEXT.VISIBLE = .T.
       THISFORM.RKJSLABEL.VISIBLE = .T.
       THISFORM.RKJSTEXT.VISIBLE = .T.
       THISFORM.CKJSLABEL.VISIBLE = .T.
       THISFORM.CKJSTEXT.VISIBLE = .T.
       THISFORM.PRINTBUTTON.VISIBLE = .T.
       THISFORM.CXCX.VISIBLE = .T.
        THISFORM.REFRESH
    ENDIF
 ENDIF
ENDPROC
*--
2014-03-06 00:26
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
回复 4楼 sdta
怎样加法,请指导!
2014-03-06 20:15
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
回复 6楼 qingfameng
你好,我想在现有程序做些改动,在合同号中输入12就能显示出所有字符中包括12的编号,不用输入6*12,请问怎样修改,因现在必须输入整个才能显示。
图片附件: 游客没有浏览图片的权限,请 登录注册


[ 本帖最后由 pylyh 于 2014-3-6 23:25 编辑 ]
2014-03-06 23:20
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
回复 8楼 sdta
请问怎样在合同号中输入任意一个字符就能显示出来?现在还是要输入全称。
2014-03-07 00:08
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
回复 10楼 sdta
我不想改动太大,因还有其他的连接,在现有程序中能改一下吗?因为要选择合同号中有12字符的,并且日期在某一时间段。

[ 本帖最后由 pylyh 于 2014-3-7 00:28 编辑 ]
2014-03-07 00:18
快速回复:请教任意输入字显示
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023219 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved