locked
How to create a saving dirvectory RRS feed

  • Question

  • GraphicsWindow.Title = "NotePad"
    GraphicsWindow.BackgroundColor = "Black"
    PGDF= Program.Directory+"\Namelist.txt"    '  data is stored in namelist.txt
    Box[1] = Controls.AddTextBox(375, 50)
    Controls.SetTextBoxText(Box[1], "Title")
    Box[2] = Controls.AddTextBox(375, 100)
    Controls.SetSize(Box[2], 160, 20)
    Controls.SetTextBoxText(Box[2], "Date")
    Box[3] = Controls.AddMultiLineTextBox(250, 150)
    Controls.SetSize(Box[3], 400, 300)
    Controls.SetTextBoxText(Box[3], "Notes")
    'Regular textbox size = 160, 
    ButtonSave = Controls.AddButton("Save", 325, 475)
    Controls.SetSize(ButtonSave, 300, 50)
    smsg= Shapes.AddText(" Saved ")
       Shapes.Move(smsg,0,-50)  
    
    sub textsave
       data=""
     
      Shapes.Move(smsg,PX,-50) 
      For i=1 To 5
         data=data+ Controls.GetTextBoxText(box[i])+","  ' five data are connected  
         Controls.SetTextBoxText(box[i],"")                       '  null 
      EndFor  
      File.AppendContents(PGDF,data)             '  data is saved (appended)
       PX=10+math.GetRandomNumber(700)
       Shapes.Animate(smsg,PX,800,4000)       ' information if saved
     EndSub
     
    
    How do I create a directory that WILL ACTUALLY SAVE THIS FILE!!!!
    Monday, March 19, 2012 12:19 AM

Answers

  • The directory where files are saved in your case is 'Program.Directory'.  Try TextWindow.WriteLine(Program.Directory) to see where it is.

    If you save your SmallBasic file somewhere, this directory will be there; if you don't save the SmallBasic program before running it, this directory will be a temp directory; if you type %temp% in the title bar of windows explorer it will take you there.

    Don't know what you mean by: users can draw and not type???

    Monday, March 19, 2012 7:39 PM

All replies

  • Can anybody also give me an example of code that I could use in addition to this so that users can draw and not type???
    Monday, March 19, 2012 12:24 AM
  • The directory where files are saved in your case is 'Program.Directory'.  Try TextWindow.WriteLine(Program.Directory) to see where it is.

    If you save your SmallBasic file somewhere, this directory will be there; if you don't save the SmallBasic program before running it, this directory will be a temp directory; if you type %temp% in the title bar of windows explorer it will take you there.

    Don't know what you mean by: users can draw and not type???

    Monday, March 19, 2012 7:39 PM
  • like notpad if you use windows like in notepad you can either type or draw and I want to create something like that here!
    Monday, March 19, 2012 10:29 PM
  • I only know how to type into notepad?
    Tuesday, March 20, 2012 6:25 PM