You are not logged in.

Search results

Search results 1-3 of 3.

Wednesday, February 19th 2020, 5:43pm

Author: dedaimiel

How to test if a variable is a number

Quoted from "klaus.krpano" that thread is outdated, krpano already has a build-in isNaN function: https://krpano.com/docu/actions/#expressions.inlinefunctions I knew the function "isNanN", but for me the problem of this function is this: it works fine with strings set(test,"b"); if(isNaN(test),trace('Its NOT number'),trace('Its a number')); ==> its NOT a number or numbers set(test,"4"); if(isNaN(test),trace('Its NOT number'),trace('Its a number')); ==> its a number but when your have a empty, o...

Tuesday, February 18th 2020, 7:55pm

Author: dedaimiel

How to test if a variable is a number

Quoted from "Scott Witte" set(testcase, t); mul(test, testcase, 2); trace(get(test)); ==> NaN if(test==NaN,... ==> tests false set(test2,test); trace(get(test2)); ==> NaN if(test2==NaN, ==> will be true Thanks Scott Witte I tried your code but I think it dosen't work properly. At the end you say "if(test2==NaN, == will be true" perphaps it would be true but unfortunately it doesn't. Inspired in your suggestion I did this other action I think work fine Source code 1 2 3 4 5 <action name="test_nu...

Wednesday, December 11th 2019, 11:57pm

Author: dedaimiel

This code works ok

mod(cur_hlookat,cur_hlookat,360); if(cur_hlookat LT -180, ADD(cur_hlookat,360)); and you have the corrrect value of the hlookat in the cur_hlookat (between -180 and 180)