Check if file exist and save with other filename

I'm saving file with Table1.SaveCSV... and im using Public variable for initial naming. But i need, when i save changed table again to get File1.csv, then File2.csv, File3.csv...

Thank you in advance.
 

Attachments

  • Problem2.sbp
    853 bytes · Views: 203
  • Items.txt
    390 bytes · Views: 206

klaus

Expert
Licensed User
Longtime User
I suggest you the attached program.
Instead of changing the end number use a MessageBox to notify the user that the file does already exist and give him the choice to either overwrite it or to change the file name.
Otherwise the user will not see what happens.

Best regards.
 

Attachments

  • Problem21.sbp
    1.4 KB · Views: 209
Than you Klaus and Erel.

I did get the point but i didn't get your program to work (for some reason it won't create file on the first creation). But you showed me how it can be done.

On the other side, user does not have to interact with file names (he just have to make file1, file2, file3 etc. and all there files will be saved on network disk for later computing).
 

klaus

Expert
Licensed User
Longtime User
The attached program saves the different files.
As in your example you had a TextBox to let the user enter a filename I thought that this would have always been the case.

You are right, in my previous post there is a line missing.

Best regards.
 

Attachments

  • Problem21.sbp
    1.4 KB · Views: 215
  • Problem22.sbp
    818 bytes · Views: 186
Top