renan-guimaraes / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Array of const param problem #390

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add a TdwsUnit
2. define a class TMyClass
3. define a method that has at least one parameter with type "array of const"
4. create a simple script that will create a TMyClass instance, call the method 
defined above

What is the expected output? What do you see instead?
in the OnEval event, expecting Info.Vars['paramNameHere'].Data to contain all 
values passed, instead, only Data[0] is filled

What version of the product are you using? On what operating system?
latest SVN source

Check attached test project

Running under D2010

Original issue reported on code.google.com by duminica...@gmail.com on 12 May 2013 at 12:00

Attachments:

GoogleCodeExporter commented 9 years ago
Your test case is incorrect.

Getting information out of a "array of const" argument on the native side is 
complicated, but it works if you do it like this:

ShowMessage(VarToStr(LArgs.Element([0]).Value) + ' ' + 
VarToStr(LArgs.element([1]).Value) + VarToStr(LArgs.element([2]).value));

Original comment by masonwhe...@gmail.com on 12 May 2013 at 3:53

GoogleCodeExporter commented 9 years ago
Ahhh, that's what I was missing!! my bad ):

Original comment by duminica...@gmail.com on 12 May 2013 at 4:44