writing into file

Author Message
kobycool

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 5/13/2006
  • Status: offline
writing into file Saturday, May 13, 2006 8:50 PM (permalink)
0
Original message moved by Country73
Reason : Wrong Forum
hi,
Im trying to write a simple string into file but the string in file always encircled by inverted commas:
I need only the string without this " "
 
The script:
tempfile="C:\TEMP.txt"
Open tempfile For Output As #1
filetime=FileDateTime(tempfile)
write #1,"hello"

 
output file:
"hello"
 
I need only the hello
 
thanks
Koby
 
 
#1
    DiGiTAL.SkReAM

    • Total Posts : 1259
    • Scores: 7
    • Reward points : 0
    • Joined: 9/7/2005
    • Location: Clearwater, FL, USA
    • Status: offline
    RE: writing into file Sunday, May 14, 2006 6:59 AM (permalink)
    0
    Your code looks like it was written for use in Visual Basic or Quickbasic...
    Here's how to do it in vbscript.
     
     Const ForReading = 1
     Const forWriting = 2
     Const ForAppend = 8
     sTempFile = "C:\TEMP.txt"
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     Set oFile = oFSO.OpenTextFile(sTempFile,forWriting,True)
     oFile.WriteLine "Hello"
     oFile.Close
     

     
    "Would you like to touch my monkey?" - Dieter (Mike Meyers)

    "It is better to die like a tiger, than to live like a pussy."
    -Master Wong, from Balls of Fury
     
    #2
      kobycool

      • Total Posts : 2
      • Scores: 0
      • Reward points : 0
      • Joined: 5/13/2006
      • Status: offline
      RE: writing into file Sunday, May 14, 2006 5:51 PM (permalink)
      0
      thanks for your answer, but I really didnt mention that Im using Quickbasic,
      Is there any solution for Quickbasic?
      thanks
      Koby
       
      #3
        DiGiTAL.SkReAM

        • Total Posts : 1259
        • Scores: 7
        • Reward points : 0
        • Joined: 9/7/2005
        • Location: Clearwater, FL, USA
        • Status: offline
        RE: writing into file Monday, May 15, 2006 3:09 AM (permalink)
        0
         tempfile$ = "c:\temp\temp.txt"
         open tempfile$ for append as 1
         output$ = "hello"
         print #1, output$
         close #1
         

         
        That's as close as I can come, as I don't have QB installed where I am sitting right now.
        "Would you like to touch my monkey?" - Dieter (Mike Meyers)

        "It is better to die like a tiger, than to live like a pussy."
        -Master Wong, from Balls of Fury
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9