Addressing an object

Started by Stéphane Devouard, September 28, 2022, 10:46:08 AM

Previous topic - Next topic

Stéphane Devouard

Hi

This code returns an error 29 on line 581


0580 IF XL[J]=0 THEN XL[J]=NEW("*obj/xml")
0581 XLIG=XL[J]'ADD_NODE("ligne")


I told the boss to change it to :

0580 if xl[j]=0 xd=new("*obj/xml"); xl[j]=xd else xd=xl[j]
0581 xlig=xd'add_node("ligne")


And it worked

Looks like this type of syntax
array[index]'some_method()
While valid, is not supported by the parser or compiler

That being said, we are on a V16 with V15 license, maybe it has been fixed in a more recent version ?

Regards
Stéphane Devouard
Portfolio | Work

Mike King

Object handles, while they may be kept in an array must be referenced using a simple numeric variable.  You cannot access object properties/methods using a object handle in an array.
Mike King
President - BBSysco Consulting - http://www.bbsysco.com
eMail: mike.king@bbsysco.com