• console.getkeys

    From Mortifis@VERT/ALLEYCAT to All on Wed Jul 24 16:39:55 2019
    I have if(js.global.console) lookup = console.getkeys("HSOQ", lastuser);ã where lastuser=system.lastuser... if entering a number it throws aã!Javascript TypeError: ããWhat is the correct usage of console.getkeys? I inferred: ãããconsole methods ãgetkeys: ãnumber console.getkeys(string keys [,maxnum]) 3.10 get one key from of aãlist of valid command keys, or a number between 1 and maxnumããã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ã
  • From echicken@VERT/ECBBS to Mortifis on Wed Jul 24 17:00:44 2019
    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", lastuser);ã Mo> where lastuser=system.lastuser... if entering a number it throws aã Mo> !Javascript TypeError: ããThat looks like it should work. What's the full text of the error?ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.comã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Digital Man@VERT to Mortifis on Wed Jul 24 14:30:23 2019
    Re: console.getkeysã By: Mortifis to All on Wed Jul 24 2019 04:39 pmãã > I have if(js.global.console) lookup = console.getkeys("HSOQ", lastuser);ã > where lastuser=system.lastuser... if entering a number it throws aã > !Javascript TypeError:ã >ã > What is the correct usage of console.getkeys? I inferred:ã >ã >ã > console methodsã > getkeys:ã > number console.getkeys(string keys [,maxnum]) 3.10 get one key from m ofã > a list of valid command keys, or a number between 1 and maxnumããIt seems to work for me. Perhaps it's what you're *doing* with the lookup value. Are you getting a line number with the error? What line of JavaScript corresponds with that line number?ãã digital manããSynchronet/BBS Terminology Definition #12:ãCBM = Commodore Business MachinesãNorco, CA WX: 98.3øF, 30.0% humidity, 13 mph E wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Mortifis@VERT/ALLEYCAT to echicken on Wed Jul 24 18:32:12 2019
    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 itã > Mo> throws a !Javascript TypeError: ãã > That looks like it should work. What's the full text of the error?ãã!JavaScript C:\sbbs\exec\dup_user_check.js line 277: TypeError:ãlookup.toUpperCãase is not a functionããI suspect that the toUpperCase() is not be supported by the console.getkeys()ãfunction :-/ãã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ã
  • From Digital Man@VERT to Mortifis on Wed Jul 24 14:37:12 2019
    Re: Re: console.getkeysã By: Mortifis to echicken on Wed Jul 24 2019 06:32 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 itã > > Mo> throws a !Javascript TypeError:ã >ã > > That looks like it should work. What's the full text of the error?ã >ã > !JavaScript C:\sbbs\exec\dup_user_check.js line 277: TypeError:ã > lookup.toUpperCã > ase is not a functionã >ã > I suspect that the toUpperCase() is not be supported by theã > console.getkeys() function :-/ããtoUpperCase() is not supported by JavaScript Numbers. console.getkeys() can return a number or a string, depending on the user input.ãã digital manããSynchronet "Real Fact" #56:ãSynchronet Terminal Server introduced SecureShell (SSH) support w/v3.14a (2006).ãNorco, CA WX: 98.3øF, 30.0% humidity, 13 mph E wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Mortifis@VERT/ALLEYCAT to echicken on Wed Jul 24 18:52:01 2019
    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 itã > Mo> 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ããã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ã
  • From Digital Man@VERT to Mortifis on Wed Jul 24 15:36:02 2019
    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 itã > > Mo> 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ããThis Is Spinal Tap quote #29:ãI find lost luggage. I locate mandolin strings in the middle of Austin!ãNorco, CA WX: 97.2øF, 29.0% humidity, 14 mph NE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Mortifis@VERT/ALLEYCAT to Digital Man on Thu Aug 8 09:43:38 2019
    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ã