PDA

Click to See Complete Forum and Search --> : Path


susn
Apr 3rd, 2001, 07:28 AM
By using a .ini File to save some settings i need to ensure that the .ini File is created in the current App Path.

At the moment the ini is located to C:\WINNT

i do like following:

SetINIEntry = WritePrivateProfileString(ByVal Eintrag, ByVal Section, ByVal Value, ByVal FileName)

Is there a way to set the ini to App.Path?

Thx,

Susn

dj4
Apr 3rd, 2001, 11:50 PM
Try this:

dim FileName as string

FileName = App.Path & "\MyIni.ini"

SetINIEntry = WritePrivateProfileString(ByVal Eintrag, ByVal Section, ByVal Value, ByVal FileName)

-Dj4

susn
Apr 4th, 2001, 07:59 AM
I got this Funktion ....

Function Path$(ByVal drv$, ByVal subdir$)

Do While Right$(drv$, 1) = "\"
drv$ = Left$(drv$, Len(drv$) - 1)
Loop

Do While Left$(subdir$, 1) = "\"
subdir$ = Mid$(subdir, 2)
Loop

Path$ = drv$ + "\" + subdir$

End Function


And i use it like this:

SetINIEntry "Waferlayout", "Standort", glbStandort, Path$(App.Path, "wlayout.ini")


Thank u for your Response DJ4.

Greetings and Cheers,

Susn