Subj : Re: console.getkeys To : Digital Man From : Mortifis Date : Thu Aug 08 2019 09:43 am > Re: Re: console.getkeys > By: Mortifis to echicken on Wed Jul 24 2019 06:52 pm > > > Re: console.getkeys > > > By: Mortifis to All on Wed Jul 24 2019 16:39:55 > > > Mo> I have if(js.global.console) lookup = console.getkeys("HSOQ", > > > Mo> lastuser); where lastuser=system.lastuser... if entering a number > > > Mo> it throws a !Javascript TypeError: > > perhaps I should run a condition check similar to if(lookup == [whatever > > || ... keys are in getkeys)) before I lookup.toUpperCase ... though > > before it was lookup = readln() and there was no error > readln() returns either a string or undefined. undefined.toUpperCase() would > also throw a JS exception. > You might want to use typeof in this case to be sure your variable is a > string before you start treating it like a string. > digital man Thank you, I am still learning JS/C :\ I ended up using if(isNaN(lookup)) { ... } block. I am sure typeof is more flexible :-) My doctor said I have the body of a 25 year old ... and the mind of a 10 :-/ --- þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81 .