• file_area.dir object

    From Tegularius@VERT/BAUDHOUS to All on Thu Jul 9 09:32:39 2009
    The docs say that this is an associative array of all directories. Thisãis the only time it is mentioned in the docs. It has no properties.ãSo what use is it?ããI'm still trying to solve my little problem using js: given the internalãcode of a desired file area, to change bbs.curdir to the one with that code.ãã---ã þ Synchronet þ The Bauding House - baudhous.synchro.netã
  • From Nightfox@VERT/DIGDIST to Tegularius on Thu Jul 9 12:33:21 2009
    Re: file_area.dir objectã By: Tegularius to All on Thu Jul 09 2009 09:32:39ãã > > The docs say that this is an associative array of all directories. Thisã > > is the only time it is mentioned in the docs. It has no properties.ããI've noticed this with some of the Synchronet JavaScript docs. But if the ãdocs don't list properties, that doesn't mean there aren't any properties. ãThere must be some of the object exists. If you want to find out what ãproperties are in an object, you can iterate through an object's properties ãand output them as follows:ããfor (var prop in file_area.dir)ã console.print(prop + "\r\n");ããThat will output all the property names, followed by a carriage return & ãnewline.ããIf you also wanted to output the values of the properties, you could do this:ãfor (var prop in file_area.dir)ã console.print(prop + ": " + file_area.dir[prop] + "\r\n");ããNightfoxããã---ã þ Synchronet þ Digital Distortion BBSã
  • From Digital Man@VERT to Tegularius on Sat Jul 11 00:09:49 2009
    Re: file_area.dir objectã By: Tegularius to All on Thu Jul 09 2009 09:32 amãã > The docs say that this is an associative array of all directories. Thisã > is the only time it is mentioned in the docs. It has no properties.ã > So what use is it?ããThe objects in the file_area.dir array are the same as the objects in theãfile_area.list_list[].dir_list[] array, they're just organized differently andãthe array contains *all* directories instead of just those that the currentãuser has access to.ãã digital manããSnapple "Real Fact" #190:ãThailand means "Land of the Free." ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Tegularius@VERT/BAUDHOUS to All on Mon Jul 13 06:50:57 2009
    Re: file_area.dir objectã By: Digital Man to Tegularius on Sat Jul 11 2009 00:09:49ããThe little job is almost done. I've discovered that it is just a matter ofãassigning the desired internal code to bbs.curdir_code, i.e.:ã bbs.curdir_code=newcodeããIf newcode is valid, then the change is made; if not, it isn't. The caseã(upper or lower) of newcode doesn't matter. However, the valueãof bbs.curdir_code is reported all in lower-case.ããThis brings up my remaining little question. I would like my .js toãrecognize whether the change of directory is successful by comparingãnewcode to bbs.curdir_code after an attempt to change it. However,ãif the cases of the two strings don't match, the comparison returns false.ãHow do I change the case of a string to upper or lower? The guide mentionsãtoLowerCase and toUpperCase as methods of strings, but I can't make themãwork. Are they obsolete? Could someone give an example of the syntax?ããOh yes, one more question, about console.getstr. This takes a stringãas an optional argument. What is the purpose of this argument? Itãdoesn't appear to be either the string variable to be assigned (whichãis done via the returned value) or a prompt. Something needs to beãthere if one wants to use the other arguments, but I can't determineãwhat it does.ãããã---ã þ Synchronet þ The Bauding House - baudhous.synchro.netã
  • From Nightfox@VERT/DIGDIST to Tegularius on Mon Jul 13 12:37:04 2009
    Re: file_area.dir objectã By: Tegularius to All on Mon Jul 13 2009 06:50:57ãã > > This brings up my remaining little question. I would like my .js toã > > recognize whether the change of directory is successful by comparingã > > newcode to bbs.curdir_code after an attempt to change it. However,ã > > if the cases of the two strings don't match, the comparison returns falseã > > How do I change the case of a string to upper or lower? The guide mentioã > > toLowerCase and toUpperCase as methods of strings, but I can't make themã > > work. Are they obsolete? Could someone give an example of the syntax?ããtoUpperCase() and toLowerCase() return a copy of the string in upper/lower ãcase. You could use it like this:ãif (bbs.curdir_code.toUpperCase() == "SOME_DIR")ããã---ã þ Synchronet þ Digital Distortion BBSã
  • From Digital Man@VERT to Tegularius on Mon Jul 13 18:53:44 2009
    Re: file_area.dir objectã By: Tegularius to All on Mon Jul 13 2009 06:50 amãã > Re: file_area.dir objectã > By: Digital Man to Tegularius on Sat Jul 11 2009 00:09:49ã >ã > The little job is almost done. I've discovered that it is just a matterã > of assigning the desired internal code to bbs.curdir_code, i.e.:ã > bbs.curdir_code=newcodeã >ã > If newcode is valid, then the change is made; if not, it isn't. The caseã > (upper or lower) of newcode doesn't matter. However, the valueã > of bbs.curdir_code is reported all in lower-case.ã >ã > This brings up my remaining little question. I would like my .js toã > recognize whether the change of directory is successful by comparingã > newcode to bbs.curdir_code after an attempt to change it. However,ã > if the cases of the two strings don't match, the comparison returns false.ã > How do I change the case of a string to upper or lower? The guide mentionsã > toLowerCase and toUpperCase as methods of strings, but I can't make themã > work. Are they obsolete? Could someone give an example of the syntax?ããNo, they're not obsolete. What did you try?ããThere's an example here:ãhttps://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String/tãoLowerCaseãã > Oh yes, one more question, about console.getstr. This takes a stringã > as an optional argument. What is the purpose of this argument?ããIt's the default value of the string (e.g. when used with the K_EDIT modeãflag).ãã > Itã > doesn't appear to be either the string variable to be assigned (whichã > is done via the returned value) or a prompt. Something needs to beã > there if one wants to use the other arguments, but I can't determineã > what it does.ããActually, unless you're using K_EDIT, you don't need to specify the string atãall. The method implementation is smart enough to know the difference betweenãnumbers (e.g. maxlen and mode arguments) and string arguments. Many of theãSynchronet JS methods are this way.ãã digital manããSnapple "Real Fact" #65:ãA one-day weather forecast requires about 10 billion math calculations.ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Tegularius@VERT/BAUDHOUS to Digital Man on Wed Jul 15 21:02:49 2009
    Re: file_area.dir objectã By: Digital Man to Tegularius on Mon Jul 13 2009 18:53:44ãã > No, they're not obsolete. What did you try?ã > ã > There's an example here:ã > https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Strinã > oLowerCaseããThanks. I figured that one out shortly after posting. I had simplyãforgotten to put () at the end.ãã > ã > > Oh yes, one more question, about console.getstr. This takes a stringã > > as an optional argument. What is the purpose of this argument?ã > ã > It's the default value of the string (e.g. when used with the K_EDIT modeã > flag).ã > ãThanks again!ããWeb and FTP are basically working now. This is starting to be fun...ãããã---ã þ Synchronet þ The Bauding House - baudhous.synchro.netã
  • From Digital Man@VERT to Tegularius on Thu Jul 16 01:29:57 2009
    Re: file_area.dir objectã By: Tegularius to Digital Man on Wed Jul 15 2009 09:02 pmãã > Web and FTP are basically working now. This is starting to be fun...ããAs it should be! :-)ãã digital manããSnapple "Real Fact" #23:ãThe San Francisco Cable cars are the only mobile national monument.ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã