Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Need Some VB6 Error Code Syntax

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Poigahn   Members   

595
Like
0Likes
Like

Posted 26 February 2014 - 06:36 PM

What I am trying to do is equivilant to an IfExist in C
I can Create - Append - and Read from a Disk File from with in the Code.
I can Also open an File/Directory (Save IN ....) dialog Box
What I want to do is Have the program check to see if the FILENAME exist prior to overwriting the file with in the code

Your Brain contains the Best Program Ever Written : Manage Your Data Wisely !!


#2 Paradigm Shifter   Members   

5832
Like
0Likes
Like

Posted 26 February 2014 - 06:56 PM

If you can fopen it for reading without creation flags you good to go?


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#3 Dragonsoulj   Members   

3180
Like
0Likes
Like

Posted 26 February 2014 - 09:12 PM

In general, you can do something like:

 

Sub MyFunction()
On Error GoTo FailedToReadFile
    ' Read File Code
On Error GoTo FailedToWriteToFile
    ' Write File Code
ExitMyFunction:
Exit Sub
FailedToReadFile:
    ' Read File Error Handling
    GoTo ExitMyFunction
FailedToWriteToFile:
    ' Write File Error Handling
    GoTo ExitMyFunction
End Sub





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.