Using Java, with the latest release of App Studio. I’m trying to validate a variable (Comps) to confirm that it is a number. Here’s the syntax:
if(IsNumeric(Comps) ){
edtTotal.value = Math.round(Comps);
}
Here’s the error: Uncaught ReferenceError: IsNumeric is not defined. line 34 column 3
Is “IsNumeric” deprecated? It still appears in your language reference for Java. If it is deprecated, can you suggest another way of avoiding the “NaN” error?
Thanks!
PPetree
October 20, 2021, 9:44pm
#2
IsNumeric would be a function YOU write… isNAN() is what JavaScript uses.
ghenne
October 21, 2021, 10:20am
#3
IsNumeric() is a function AppStudio has added for backwards compatibility with Visual Basic.
To include it in your project, check BASIC in the Libraries panel.
Thanks for the answer (and solution). Just familiarizing myself with JS–catching up on newer languages from C/C++/8086-8052-PIC assembly/Delphi, etc…
Thanks for the reply. I ended up using isNAN(), as suggested by PPetree. I can’t find a “Libraries” panel…
ghenne
October 22, 2021, 3:22pm
#6
The Libraries panel shows up when you highlight Project Properties and Global Code in the Project Explorer .
Thanks! I hadn’t seen that previously…