none
sub for full file path RRS feed

  • Question

  • is there a way when writing to a file to have my software look for the file in the following or similar directory: %installation directory%\cmddoc.txt"?
    Sunday, September 22, 2013 5:03 PM

Answers

  • so I am using this to write to and read from a file but when I put the "File.ReadContents" I get "Expected expression here" and it doesn't make sense to me what to do. the line I'm getting the error on has the following code

    name = File.ReadContents(Program.Directory\cmddoc.txt)

    No, use name = File.ReadContents(Program.Directory+"\cmddoc.txt")

    Jan [ WhTurner ] The Netherlands

    Sunday, September 22, 2013 5:22 PM
    Answerer
  • Small Basic has the Program.Directory command. This returns the directory from where you started the program.

    Jan [ WhTurner ] The Netherlands

    Sunday, September 22, 2013 5:06 PM
    Answerer

All replies

  • Small Basic has the Program.Directory command. This returns the directory from where you started the program.

    Jan [ WhTurner ] The Netherlands

    Sunday, September 22, 2013 5:06 PM
    Answerer
  • so I am using this to write to and read from a file but when I put the "File.ReadContents" I get "Expected expression here" and it doesn't make sense to me what to do. the line I'm getting the error on has the following code

    name = File.ReadContents(Program.Directory\cmddoc.txt)

    Sunday, September 22, 2013 5:20 PM
  • so I am using this to write to and read from a file but when I put the "File.ReadContents" I get "Expected expression here" and it doesn't make sense to me what to do. the line I'm getting the error on has the following code

    name = File.ReadContents(Program.Directory\cmddoc.txt)

    No, use name = File.ReadContents(Program.Directory+"\cmddoc.txt")

    Jan [ WhTurner ] The Netherlands

    Sunday, September 22, 2013 5:22 PM
    Answerer
  • thx

    Sunday, September 22, 2013 5:28 PM
  • chabad360,

    Is it clear to you why Jan's answer works?

    Sunday, September 22, 2013 5:30 PM
    Moderator
  • yea! why?

    Sunday, September 22, 2013 5:34 PM
  • just asking in case it wasn't?  how strings are formed and concatenated.
    Sunday, September 22, 2013 5:37 PM
    Moderator
  • how strings are formed and concatenated.

    I understand. :)



    • Edited by chabad360 Sunday, September 22, 2013 5:40 PM
    Sunday, September 22, 2013 5:38 PM