robot脚本__从文本中导入数据实践

Sub Main
    Dim Result As Integer
       
    'Initially Recorded: 2005-8-9  16:40:25
    'Script Name: 新增直接入库单
    '药品表:  药品代码 单位 单价 数量  批号
    ' "ZY.2151999017" "kg" "10" "100" "0001"
    ' "ZY.2151999015" "kg" "11" "111" "0002"
   
      
    Dim yaoMing As String, danWei As String, danJia As string
    Dim shuLIANG AS string , piHao as string
    dim msgtext as string
    dim fname as string

    '以下是单据头:
   
    Window SetContext, "Caption=直接入库单据", ""
    EditBox Click, "ObjectIndex=4", "Coords=148,7"
    '这里取的是鼠标坐标,根据实际情况调整
   
   
    Window SetContext, "Class=TdxPopupEditForm", ""
    InputKeys "{DOWN}{ENTER}{tab}"
   
   
    Window SetContext, "Caption=直接入库单据", ""
    InputKeys "%{DOWN}"
   
    Window SetContext, "Class=TdxPopupEditForm", ""
    InputKeys "{DOWN}{ENTER}"
   
    '以下是单据体:


    fname=InputBox("Enter a filename to print:")
    '输入药品表文件
    Open fname For Input As #1
    '打开文件   
   
   
    Do While Not Eof(1)
    '循环读入药品,直到结束
    Input #1,yaoMing, danWei, danJia,shuLIANG,piHao
   
    Window SetContext, "Caption=直接入库单据", ""
    InputKeys  "%n"
       
    Window SetContext, "Class=TdxPopupEditForm", ""
    'InputKeys "{up}"
    '说明:如果焦点在输入框则不用上面的{UP}
   
    InputKeys  yaoMing & "{ENTER}{ENTER}"
       
    Window SetContext, "Caption=直接入库单据", ""
    InputKeys "{TAB}" & danWei & "{TAB}" & danJia & "{TAB}{TAB}" & shuLIANG & "{TAB}" & piHao
    
    
    Window SetContext, "Caption=直接入库单据", ""
    InputKeys "{TAB}1"
   
    Window SetContext, "Class=TdxPopupEditForm", ""
    InputKeys "{DOWN}{ENTER}"
          
    Loop
   
    Window SetContext, "Caption=直接入库单据", ""
    InputKeys "^a"
    '药品录入完毕审核
   
    Close #1   
  
End Sub

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值