Subj : file_area.dir object To : Tegularius From : Digital Man Date : Mon Jul 13 2009 06:53 pm 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. .