Jump to content


Photo

Hang Man


  • Please log in to reply
23 replies to this topic

#21 Apocalypse

Apocalypse
  • New Members
  • 46 posts

Posted 28 April 2003 - 12:31 AM

   On Error Resume Next

    Open App.Path & "data.dat" For Input As #2

    Input #2, strResult

    Close #2

    

    Open App.Path & "data.dat" For Random As #1

    

    If Len(strResult) = 0 Then

        For intIndex = 1 To 30

            Put #1, intIndex, gstrString(intIndex - 1)

        Next intIndex

    Else

        For intIndex = 1 To 30

            Get #1, intIndex, gstrString(intIndex - 1)

        Next intIndex

    End If

    

    Close #1

For intIndex = 1 To 30
Put #1, intIndex, gstrString(intIndex - 1)
Next intIndex


I think this writes data into the file...
Drunkeness does not reveal a man's other side, getting to know him does.

#22 poedguy

poedguy
  • Members
  • 200 posts
  • Location:Perth, Western Australia
  •  One of CNC Guild's founders

Posted 28 April 2003 - 05:08 AM

actually the problem is that you opened it for Random and not output which is why it never actually creates the file... You didn't give it a database output format which is what Random uses

open it like this
Open App.Path & "data.dat" For Output As #1
then close it and re-open it for input for the Get command

These may be tiresome things but they work. You could also try using a TextStream object which works even better (use the FileSystemObject in the Microsoft Scripting Runtime reference)

If something works on your machine and not on another then there's a problem with the code... Simple. I have spent ages getting all of my programs to work on all computers, it's not as easy as it seems.

#23

  • Guests

Posted 28 April 2003 - 03:53 PM

This is cool, i downloaded at school! and i play it there now

#24 Apocalypse

Apocalypse
  • New Members
  • 46 posts

Posted 28 April 2003 - 08:28 PM

Glad to see support from all you guys esp. poedguy :D

BTW, poedguy, your case is special, I think your case is the only one that doesn't create a "data.dat" file. If there's anyone else besides poedguy that doesn't have the data.dat file please report back here :p
Drunkeness does not reveal a man's other side, getting to know him does.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users