|
Cd.NoValue |
Posted by Fid on Oct-01-2021 21:55 |
|
Hi,
We experience trouble with the use of Cd.NoValue on ChartDirector 5.1 (Asp Edition)
If we use decimal values it's ok but if we try to insert a Cd.NoValue it stop with the following message:
ChartDirector erreur '800a8000'
Error converting argument 1 to type class DoubleArray
Extract from the code:
liste_valeurs3 = "65; 75; 47; 34; 42; 49; 73; cd.NoValue; 90; 69; 66; 78"
[...]
data1 = Split(liste_valeurs3, ";")
[...]
Call layer1.addDataSet(data1, &H00ff00, "Atom Synthesizer").setDataSymbol(cd.GlassSphere2Shape, 11)
=> Error
Thanks for any help! |
Re: Cd.NoValue |
Posted by Peter Kwan on Oct-02-2021 02:49 |
|
Hi Fid,
cd.NoValue is a number, which is not the same as a text string "cd.NoValue".
If a number is required, but you use a text string, VB/VBScript will try to automatically convert the number to a text string. For example, the text string "3" will be converted to the number 3. The text string "cd.NoValue" is not a number in VB/VBScript language, so it cannot be converted to a number. As a result, data1 is not an array of numbers, as it contains at least one non-number.
If you must use text strings instead of numbers, you may convert it with your own code. For example, you may "X" to mean no value, like:
liste_valeurs3 = "65; 75; 47; 34; 42; 49; 73; X; 90; 69; 66; 78"
data1 = Split(liste_valeurs3, ";")
'Convert the text strings to numbers
For i = 0 To UBound(data1)
If Trim(data1(i)) = "X" Then
data1(i) = cd.NoValue
Else
data1(i) = CDbl(data1(i))
End If
Next
Hope this can help.
Regards
Peter Kwan |
Re: Cd.NoValue |
Posted by Fid on Oct-06-2021 21:58 |
|
It works!
Thanks a lot
Best regards! |
|