Quantcast
Channel: PTC Community: Message List - Arbortext
Viewing all articles
Browse latest Browse all 3717

Re: How to call a public static void main(String[] args) method in an ACL function

$
0
0

Hi David,

 

to call a static method from ACL you have to use the java_static() ACL function. In your case the call would be:

 

ret = java_static("HelloObjIs","main",args);

 

Now for the args you need to convert an ACL array to a Java array. Basically you would do the following in ACL:

 

local myarr[];

 

# ... put in values as needed or leave empty...

myarr[1] = "something";

# now convert to Java array

local obj = java_array_from_acl(myarr,"[Ljava/lang/String;");

# now call your static method with parameters

ret = java_static("HelloObjIs","main",obj);

 

Hope that helps.

 

Kind regards

 

Sirko


Viewing all articles
Browse latest Browse all 3717

Trending Articles