FileSystemObject: Open file for writing

Results 1 to 2 of 2

Thread: FileSystemObject: Open file for writing

  1. #1
    Join Date
    Dec 1969

    Default FileSystemObject: Open file for writing

    Don&#039;t worry, this isn&#039;t about client side JavaScript.<BR><BR>I have a client side JavaScript include file used for making a toolbar. Each item is indexed by letter in the toolbar.<BR>I want to make adding items to this much easier with an ASP page. I have only ever interacted with files with values 1 (Reading) and 8 (Appending), never 2 (Writing).<BR>When I add an Item, I want it to be in alphabetical order. So if I add item "Aab", I want it to come between "Aaa" and "Abb".<BR>I have made the form to add items, and am using Request.Querystring where the name of the item to be added is "itemname".<BR>I don&#039;t care if the page will be slow, as it will not be used by the public, just me and a few people with no programming skills. Can anyone help me? Preferebly in JScript, although I probably can convert answers in VBScript to JScript.<BR><BR><BR>Here is the file:<BR><BR>&#060;!-- Hide scripts from crappy browsers<BR><BR>function showToolbar()<BR>{<BR><BR>menu = new Menu();<BR><BR>menu.addItem("afile", "A", "A", null, null);<BR>menu.addItem("bfile", "B", "B", null, null);<BR>menu.addItem("cfile", "C", "C", null, null);<BR><BR>// There are twenty three more of the above for other letters.<BR>// I don&#039;t want any of the above modified.<BR><BR><BR>// Below is what I want to add to.<BR><BR><BR>//A Sub Menu<BR><BR>menu.addSubItem("afile", "Aaa", "Aaa", "index.asp?subject=Aaa");<BR>menu.addSubItem("afil e", "Abb", "Abb", "index.asp?subject=Abb");<BR>menu.addSubItem("afil e", "Acc", "Acc", "index.asp?subject=Acc");<BR>menu.addSubItem("afil e", "", "", "");<BR><BR><BR>//B Sub Menu<BR><BR>menu.addSubItem("bfile", "Baa", "Baa", "index.asp?subject=Baa");<BR>menu.addSubItem("bfil e", "Bbb", "Bbb", "index.asp?subject=Bbb");<BR>menu.addSubItem("bfil e", "Bcc", "Bcc", "index.asp?subject=Bcc");<BR>menu.addSubItem("bfil e", "", "", "");<BR><BR><BR>//C Sub Menu<BR><BR>menu.addSubItem("cfile", "Caa", "Caa", "index.asp?subject=Caa");<BR>menu.addSubItem("cfil e", "Cbb", "Cbb", "index.asp?subject=Cbb");<BR>menu.addSubItem("cfil e", "Ccc", "Ccc", "index.asp?subject=Ccc");<BR>menu.addSubItem("cfil e", "", "", "");<BR><BR>// ...and so on<BR><BR>// Do not modify the below<BR><BR>menu.showMenu();}<BR><BR>// End hiding scripts from crappy browsers --&#062;

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQs, believe it or not...

    Category FileSystemObject.<BR><BR>Read about how you can modify an existing file.<BR><BR>Or, rather, how you *can&#039;t*.<BR><BR>Sorry, but opening a file for Write means "please wipe out this file and let me start writing it all over again."<BR><BR>Inserting data into the middle of existing data is what databases were invented for.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts