asp 网页 脚本 运行不正常 请帮忙看看

来源:百度知道 编辑:UC知道 时间:2024/05/22 15:18:18
dim seq
dim xuhao
seq = rs1.fields("NEXTVAL")
response.Write seq
if seq>=1 and seq<10 then
xuhao="m1A0000" & seq
else if sep=>10 and seq<100 then
xuhao="m1A000" & seq
end if
response.Write xuhao

到此可以执行到response.Write seq ,但是下面就不对了,请高手指点。谢谢。运行正确了另外加分,决不食言。

if seq>=1 and seq<10 then
xuhao="m1A0000" & seq
else if sep=>10 and seq<100 then
xuhao="m1A000" & seq
end if
response.Write xuhao

改成
xuhao = seq
While Len(xuhao) < 5
xuhao = "0" & xuhao
Wend
xuhao = "m1A" & xuhao

Response.Write xuhao

你的if嵌套少了个end if
dim seq
dim xuhao
seq = rs1.fields("NEXTVAL")
response.Write seq
if seq>=1 and seq<10 then
xuhao="m1A0000" & seq
else if sep=>10 and seq<100 then
xuhao="m1A000" & seq
end if
end if
response.Write xuhao

--------asp:javascript----
var seq ="";
var xuhao ="";
seq = rs1.fields("NEXTVAL").value;
response.Write seq ;
if ((seq!=1)&&(seq<10)){
xuhao="m1A0000" + seq ;
}elseif((sep=>10)&&(seq<100)){
xuhao="