0

如何使用 Progress 按组分隔符拆分此条形码?我试过 chr(29) 没有任何运气。

条码扫描到 Notepad++:http: //i.imgur.com/8DmPZ.png

条形码扫描到输入字段:2409271405202120330017100282

谢谢。

def var c as char no-undo.
def var i as int no-undo.

update c format "x(50)".

do i = 1 to length(c):
    message substr(c, i, 1) = chr(29).
end.
4

3 回答 3

0

这是一个疯狂的猜测,但我在想 ENTRY(entry-num,barcode-string, "group-separator-string")?

于 2012-03-31T17:33:37.933 回答
0

这对我有用:

/* create a test file (otherwise not needed...)
 */

output to "barcode.dat".
put control "240927140520" chr(29) "2120330017" chr(29) "100282".
output close.

/* if you already have barcode.dat start here
 */

define variable m  as memptr    no-undo.
define variable bc as character no-undo.

set-size( m ) = 100.
input from "barcode.dat" binary no-convert.
import unformatted m.
input close.

bc = get-string( m, 1 ).

display
  entry( 1, bc, chr(29)) format "x(12)" skip
  entry( 2, bc, chr(29)) format "x(12)" skip
  entry( 3, bc, chr(29)) format "x(12)" skip
.
于 2012-03-31T21:32:31.633 回答
0

问题是 GS 是一个未定义的控制代码。所以你需要让它被认可。

将以下内容添加到 protermcap 中的终端条目中,以将 GS 定义为 F13:

:(F13)=\035:\

(GS 的八进制代码是 \035 而 F13 是未定义的功能键 - 所以组合应该可以工作。我没有要测试的扫描仪,但这适用于我可以输入键盘的控制代码.. .)

然后使用这样的代码:

define variable bc as character no-undo format "X(50)".

update bc editing:
  if lastkey = 313 then
    apply ".".  /* 313 is the code for F13 */
   else
    apply lastkey.
end.

这应该导致“。” 代替GS插入。这将允许您使用“。”解析字符串。而不是GS。

于 2012-04-03T14:51:47.750 回答