![]() |
#2
hu9jj2022-04-18 08:56
|
只有本站会员才能查看附件,请 登录
这个对象名无效的错误应该怎么排除?
附上我的代码:

LPARAMETERS cPropertyName, eNewValue, nVisiblity, cDescription
NODEFAULT
lexist=.f.
***判断增加的属性是否存在,如果存在则修改属性值,不存在则添加属性***
IF this.propertys.count>0
FOR i=1 TO this.propertys.count
IF this.propertys(i)==cpropertyname
lexist=.t.
IF TYPE("enewvalue")=="C"
enewvalue=STREXTRACT(enewvalue,'"','"')
ENDIF
this.&cpropertyname=enewvalue
ENDIF
ENDFOR
ENDIF
*IF lexist=.f.
* [color=#0000FF]IF VARTYPE(this.&cpropertyname)#"U"[/color]
* cpropertyname[color=#808080]=cpropertyname+"1"[/color]
* ENDIF
* DODEFAUL(cpropertyname,enewvalue)
* this.propertys.[color=#0000FF]add(cpropertyname) &&往element属性集里添加属性[/color]
*ENDIF
IF lexist=.f.
IF VARTYPE(this.&cpropertyname)=="U"
DODEFAUL(cpropertyname,enewvalue)
ELSE
this.&cpropertyname=enewvalue
ENDIF
this.propertys.add(cpropertyname) &&往element属性集里添加属性
ENDIF
NODEFAULT
lexist=.f.
***判断增加的属性是否存在,如果存在则修改属性值,不存在则添加属性***
IF this.propertys.count>0
FOR i=1 TO this.propertys.count
IF this.propertys(i)==cpropertyname
lexist=.t.
IF TYPE("enewvalue")=="C"
enewvalue=STREXTRACT(enewvalue,'"','"')
ENDIF
this.&cpropertyname=enewvalue
ENDIF
ENDFOR
ENDIF
*IF lexist=.f.
* [color=#0000FF]IF VARTYPE(this.&cpropertyname)#"U"[/color]
* cpropertyname[color=#808080]=cpropertyname+"1"[/color]
* ENDIF
* DODEFAUL(cpropertyname,enewvalue)
* this.propertys.[color=#0000FF]add(cpropertyname) &&往element属性集里添加属性[/color]
*ENDIF
IF lexist=.f.
IF VARTYPE(this.&cpropertyname)=="U"
DODEFAUL(cpropertyname,enewvalue)
ELSE
this.&cpropertyname=enewvalue
ENDIF
this.propertys.add(cpropertyname) &&往element属性集里添加属性
ENDIF