"物料编码"为字符型(A100000),我想结取它的后六位数,然后再转为数值型的,用来自动增加编码数字.但不知该用那个结取涵数?
例:AX:=strtoint(结取函数(query3.fieldbyname('物料编码').Asstring));是不是可以这样?
例:AX:=strtoint(结取函数(query3.fieldbyname('物料编码').Asstring));是不是可以这样?
解决方案 »
- c里winmain函数有四参数,对应的DELPHI里的四参数在哪?
- 这是那方控件?
- TbsSkinButton是什么控件?
- 救命!
- 谁知道学习Authware用什么书最好?来者有分,UP有分!!
- 请问什么控件能实现 “浏览”的功能? 用来找目标程序的路径。(急)
- 三層結構中,主表中包括TDataSetField,當刪除主表時出現"Cannot delete master Record With detail"
- 求Delphi工作(广州)!
- 请问怎样使用mciSendString?
- 象做金山词霸.net2001的安装工具在哪里下载,最好能告诉我要有汉化版。
- 关于导出delphi颜色值为十六进制的问题
- 高分求答,关于资源文件
var
maxno,tmp:integer;
beginwith query3 do
begin
open;
first;
maxno:=strtotint(rightStr(query3.fieldbyname('材料类别').Asstring),6);提示这行不对呀?
while not eof do
begin
tmp:=strtotint(rightstr(query3.fieldbyname('材料类别').Asstring),6);
if maxno<tmp then maxno:=tmp;
next;
end;
close;
end;
combobox3.text:=inttostr(maxno+1);
end;
maxno:=strtotint(rightStr(query3.fieldbyname('材料类别').Asstring,6));
maxno,tmp:integer;
beginwith query1 do
begin
open;
first;
maxno:=strtotint(rightStr(query3.fieldbyname('材料类别').Asstring,6));
while not eof do
begin
TEM:=strtotint(rightStr(query3.fieldbyname('材料类别').Asstring,6));
if maxno<tmp then maxno:=tmp;
next;
end;
close;
end;
combobox3.text:=inttostr(maxno+1);
end;
也不行呀
好像很简单的啊,使用copy就应该可以了吧.."物料编码"为字符型(A100000),我想结取它的后六位数,然后再转为数值型的,用来自动增加编码数字.但不知该用那个结取涵数?
例:AX:=strtoint(结取函数(query3.fieldbyname('物料编码').Asstring));是不是可以这样?
......
temp:=copy(trim(query3.fieldbyname('物料编码').Asstring),3,6);
strtoint(temp)+1;
......
right(query3.fieldbyname('物料编码').Asstring,6)就可以了
RightStr(str,n):从右向左,截取n个字符
Copy(str,index,n):从任意位置,截取n个字符楼主自己看着办......