StrToDouble

 
When I convert a null string ("") to a double, what should I be getting in the double? A null value or a zero?
 

try this:

Print("What do I get? ", StrToDouble("",2));

 
gifog:
When I convert a null string ("") to a double, what should I be getting in the double? A null value or a zero?


Technically speaking, a null string (NULL) and an empty string ("") are two different values.

An example using an empty string:

double var1 = StrToDouble("");
Print(var1);

An example using a null string:

double var1 = StrToDouble(NULL);
Print(var1);

However, it seems they both get a double (data type) value of 0.

This may be relatively true with EA's Metaquotes language.

But with other programming languages, such as C++ or Java, NULL and "" are NOT the same value; nor would they produce the same results.

 
Thank you for both answers.

I never thought of just printing the results to see what I get - and over the weekend ticks do not happen, so my program wouldn't show anything.

And thank you for testing/printing the results for me as well ('both ...value of 0).
Reason: