Help With CODE 
Author Message
 Help With CODE

I'm trying to make a program that craetes little txt.files.  I'd like that
the txt.files created have following numbers.  Meaning that when I create
two files after each other the first one could be AA123111.txt and the next
one would be AA123112.txt
So I'm not asking much and I think it can't be that hard but I'm a beginner
so I still have alot of learning to do.
PLease help me if you know how to put a kind of automatic number to a file
with if possible a letter in front like the AA, it may also be only one.
Thank you,
Peter.



Fri, 23 Feb 2001 03:00:00 GMT  
 Help With CODE
Just use a global variable (ok, i know you pro's dont like 'em) wich holds
the current "file number". And when you want a new file name you do
something like this:

strFileName = "AA" + Str(intFileNumber)
intFileNumber = intFileNumber + 1

And you could store that number in a seperate file when quiting the app to
load back into memory when starting it again.

----------------------------------------------
Andreas Swensson

Quote:
>I'm trying to make a program that craetes little txt.files.  I'd like that
>the txt.files created have following numbers.  Meaning that when I create
>two files after each other the first one could be AA123111.txt and the next
>one would be AA123112.txt



Fri, 23 Feb 2001 03:00:00 GMT  
 Help With CODE
I just finished a project where I had to create text files with similar
naming method as you need. What I did was, create a single field table in an
Access database and read the file name from that table and increment the
number at the end of the file name by one and update the field upon exiting.
Some overhead involved because of db access but it works fine.
Good Luck

Quote:
>I'm trying to make a program that craetes little txt.files.  I'd like that
>the txt.files created have following numbers.  Meaning that when I create
>two files after each other the first one could be AA123111.txt and the next
>one would be AA123112.txt
>So I'm not asking much and I think it can't be that hard but I'm a beginner
>so I still have alot of learning to do.
>PLease help me if you know how to put a kind of automatic number to a file
>with if possible a letter in front like the AA, it may also be only one.
>Thank you,
>Peter.




Fri, 23 Feb 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. HELP Error code 2244 & Error code 2465

2. Help with code to pull up .chm help file

3. FAO: Graham Mandeno - Or Anyone Can Help - Reusable Code

4. Help modify code for time format

5. Help with code

6. Help writing code

7. Need Help on Coding Syntax

8. Needed help for coding

9. Help with code

10. Help Writing Code/Module For An Excel Function

11. Help Optimizing Code

12. Help Using code in www.mvps.org API CALL to hide Access 97

 

 
Powered by phpBB® Forum Software