locked
help mee plz (i need *.txt or *.doc file of my output data) RRS feed

  • Question

  • hi any 1

    i write a code (program) with small basic

    how i can give  my result in *.txt file or *.doc file that appear in black textwidow?

    i need to output data of my program

    thanks

    force major

    Monday, April 4, 2011 1:04 PM

Answers

  • Just to make it fast check this out:

    •File.ReadContents(filepath of any file (not image))

      -This just reads whatever is in the filepath of a file (example: "C:\TestTextFiles.txt")

    •File.WriteContents(filepath of a file (can be a new one that doesn't exist currently), contents of flie)

     -This writes a file with any content.


    ~~AirWaves!!~~
    • Proposed as answer by Kirkkaf Tuesday, April 5, 2011 3:12 AM
    • Marked as answer by litdev Monday, April 11, 2011 5:39 PM
    Tuesday, April 5, 2011 3:08 AM

All replies

  • Hi,

    By what you said I'm not sure wether you want to read from a txt file or you want to write your output to the txt file. However look up both these commands:

    File.ReadContents()
    
    File.WriteContents()

    Please explain further if you like more help.


    Monday, April 4, 2011 4:36 PM
  • Just to make it fast check this out:

    •File.ReadContents(filepath of any file (not image))

      -This just reads whatever is in the filepath of a file (example: "C:\TestTextFiles.txt")

    •File.WriteContents(filepath of a file (can be a new one that doesn't exist currently), contents of flie)

     -This writes a file with any content.


    ~~AirWaves!!~~
    • Proposed as answer by Kirkkaf Tuesday, April 5, 2011 3:12 AM
    • Marked as answer by litdev Monday, April 11, 2011 5:39 PM
    Tuesday, April 5, 2011 3:08 AM
  • hi Dear AirWaves

    very very very Thank u Honey from 4 answer me

    Sorry but i have a new problem plz help me:

    I need to write a code for bookstore that for example:

    we have 10 book "A" and sell 4 book "A" how we can run program and minus 4 book"A" and save 6 book"A" in program that when we run program next time it have 6 book in it's memory?

    plz help me

    if you had time please write a simple code of it

    thank you

    Wednesday, December 14, 2011 9:11 AM
  • thank u kirkkaf 4 help me

    i have new problem plz help me:

    I need to write a code for bookstore that for example:

    we have 10 book "A" and sell 4 book "A" how we can run program and minus 4 book"A" and save 6 book"A" in program that when we run program next time it have 6 book in it's memory?

    if you had time please write a simple code of it

    thank you

     

    Wednesday, December 14, 2011 9:13 AM
  • Hi sir

    I´ve just used to input/ output data from small basic to .txt, .doc and .xls files. Succesfully.

    I´ve just problem only using Access files .msdb.

    May be this code is what do you trying to do.

    I´m concerned with this matter cause a solid programming language must to access any files to read/ write data.

    Best regards,

    _________________________________________________________________________

    TextWindow.Title = "write in .doc file"
    ' defines the path to the file
    pathfile = "C:\Users\carlos\Documents\sample.doc"
    '  writes in the first row of the file
    TextWindow.WriteLine(" Write: " + File.WriteLine(pathfile, 1, " First line"))
    '  writes in the second row of the file
    TextWindow.WriteLine(" Write 2: " + File.WriteLine(pathfile, 2, " Letter to a customer "))
    ' Appends content to the end of the file
    TextWindow.WriteLine(" Add contents: " + File.AppendContents(pathfile, "Word let you makes documents"))
    ' skip a line in the window
    TextWindow.WriteLine(" ")
    ' read the entire contents of the file and displays it in the window
    TextWindow.WriteLine(" Read contents: " + File.ReadContents(pathfile))


    carlosfmur - Buenos Aires
    Monday, January 16, 2012 3:03 AM