Not a Number error - conversion from string to number?

  • i have this situation

    set(var1, 5);

    and then in action this

    if (var1 != null, set(view.hlookat, var1));

    Problem is that in debugging mode tracing hlookat says that its NaN??? How can i make my var1 a number?

    regards

  • Hi,

    by calling:

    Code
    set(view.hlookat, var1)

    you will set the 'view.hlookat' variable to the text 'var1', and because the view.hlookat variable is a Number variable the result will be NaN.

    To set to view.hlookat to the content of 'var1', either call:

    Code
    set(view.hlookat, get(var1))

    or

    Code
    copy(view.hlookat, var1)

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!