inconsistent behavior with assigned arrays

My code is as follows...

Dim tCalculator As New CalcQuickBase()
tCalculator.Engine.ResetVariableNames()
tCalculator.FormulaCharacter = "="c

tCalculator("A") = "{1, 2, 3, 4}"

' Invalid
label_Result1.Text = tCalculator.ParseAndCompute("=[A]")
' Works
label_Result2.Text = tCalculator.ParseAndCompute("={1, 2, 3, 4}")


For some reason, the result for label_Result1 is "invalid expression", yet for label_Result2 I get "1,2,3,4"

Doing aggregations on [A] will work though, for example tCalculator.ParseAndCompute("=sum([A])")
will return "10"

Is there to assign [A] and return it properly the same way it will return "1, 2, 3, 4"?

1 Reply

JB Jaffersathick B Syncfusion Team February 4, 2010 05:39 AM UTC

Hi Drew,

Thank you for your interest in Syncfusion products.

We suggest you to assign the array of value with the formula character if you are not using it with the aggregate function and for using with the aggregate function we suggest you to assign them without formula character.

// Assigning with formula character
tCalculator("A") = "={1, 2, 3, 4}"

// Assigning without formula character for using it in aggregate functions.
tCalculator("A") = "{1,2,3,4}"

Let me know if you have any queries.

Regards,
Jaffer.B


Loader.
Up arrow icon