试试
For FSQ =1 to 6
FS="fsq"+allt(str(FSQ))
h="text"+Allt(Str(FSQ))+"."
ThisForm.&h.Value=iif(val(fs) = 0, "", &FS)
endfor
PUBLIC oform1 oform1=NEWOBJECT("form1") oform1.Show RETURN DEFINE CLASS form1 AS form DoCreate = .T. Caption = "Form1" Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 12, ; Left = 54, ; Height = 36, ; Width = 157, ; Caption = "计算", ; Name = "Command1" ADD OBJECT text1 AS textbox WITH ; FontName = "楷体", ; FontSize = 12, ; Format = "", ; Height = 37, ; Left = 48, ; Top = 84, ; Width = 121, ; ForeColor = RGB(255,0,0), ; Name = "Text1" ADD OBJECT text2 AS textbox WITH ; FontName = "楷体", ; FontSize = 12, ; Format = "", ; Height = 37, ; Left = 48, ; Top = 144, ; Width = 121, ; ForeColor = RGB(255,0,0), ; Name = "Text2" ADD OBJECT text3 AS textbox WITH ; FontName = "楷体", ; FontSize = 12, ; Format = "", ; Height = 37, ; Left = 240, ; Top = 84, ; Width = 121, ; ForeColor = RGB(255,0,0), ; Name = "Text3" ADD OBJECT text4 AS textbox WITH ; FontName = "楷体", ; FontSize = 12, ; Format = "", ; Height = 37, ; Left = 240, ; Top = 156, ; Width = 121, ; ForeColor = RGB(255,0,0), ; Name = "Text4" ADD OBJECT text5 AS textbox WITH ; FontName = "楷体", ; FontSize = 12, ; Format = "", ; Height = 36, ; Left = 48, ; Top = 204, ; Width = 120, ; ForeColor = RGB(255,0,0), ; Name = "Text5" ADD OBJECT text6 AS textbox WITH ; FontName = "楷体", ; FontSize = 12, ; Format = "", ; Height = 34, ; Left = 240, ; Top = 206, ; Width = 121, ; ForeColor = RGB(255,0,0), ; Name = "Text6" ADD OBJECT command2 AS commandbutton WITH ; Top = 12, ; Left = 244, ; Height = 37, ; Width = 121, ; Caption = "关闭", ; Name = "Command2" PROCEDURE command1.Click set talk off use jj Sum 病假,事假,婚假,丧假,探亲,旷工; to fsq1,fsq2,fsq3,fsq4,fsq5,fsq6 *!* For FSQ = 1 to 6 *!* FS="fsq"+allt(str(FSQ)) *!* h="text"+Allt(Str(FSQ))+"." *!* ThisForm.&h.Value=int(&FS) *!* endfor For FSQ =1 to 6 FS="fsq" +allt(str(FSQ)) h="text"+Allt(Str(FSQ))+"." ThisForm.&h.Value=iif(val(fs)=0, "", &FS) endfor ENDPROC PROCEDURE command2.Click quit ENDPROC ENDDEFINE