declaring a path to be used for sequential file access

redscitle
05-09-2003, 11:39 PM
I am working on the May Challenge, the Alarm Clock.
I'm going to make 2 programs, one for setting the alarm, and another that runs in the systray to check if the current time matches the one stored into a file.
Now this file that I use the #write statement to create is in the ...\Microsoft Visual Studio\VB98\ folder, but I want to create the file in the same folder that holds my project, and in the future my standalone exe. I don't understand the path expression, so could any one enlighten me on this?
Thanks a lot in advance.

vbfan
05-10-2003, 12:36 AM
You need to use App.Path when you save your File, like this:

Dim Path as String
Path = app.Path & "\mytext.txt"
Open Path For Append As #FF
'.....

redscitle
05-10-2003, 07:08 PM
Thanks a lot man!
I was also wondering if there was a way to look into the app.path directory and like count how many files there are in the directory of a specified file type, with out actually viewing the files and/or their titles?

Thanks again.

redscitle
05-10-2003, 08:27 PM
help, ne1?

vbfan
05-11-2003, 01:54 AM
You can use the Dir function to see what is in a folder.

Dim count as integer,name as string
Name = Dir$(app.Path & "\*.txt")
Do WHile not name = ""
count = count + 1
Name = Dir
Loop
msgbox count & " Textfiles were found"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum