| |
|
|
|
Description:
Searchpath seek in the angegebenen directory after a File and gives back, whether these there present is. with Searchpath can itself the Dateiname a way + Dateiname-combination extract.
Deklaration:
DEF SearchPath(6) !KERNEL32,SearchPathA
Parameter:
1.Parameter: address one Strings or Memory-Variable with a String, the whom To durchsuchenden way contains. it go no Unterverzeichnisse search. is this Parameter 0, becomes in subesquent Verzeichnissen sought: => -in the directory, from the the program loaded watts. -in the actually directory. -in the windows Systemverzeichnis. -with NT in the 16 BIT Systemverzeichnis. -in the Windows directory. -into Verzeichnissen, The under the Umgebungsvariable PATH aufgeführt are. 2.Parameter: address one Strings or Memory-Variable with a String, the whom Filenames (no extension) contains. 3.Parameter: address one Strings or Memory-Variable with a String, the The expansion the File (with point) contains. 4.Parameter: Size the Memory-Variables from Parameter 5 (in letters). 5.Parameter: Bereichvariable, The whom found Pfadnamen plus whom Filenames receiving. 6.Parameter: Memory-Variable, The The address the Dateinamens inside the in Parameter 5 zurückgegebenen Strings receiving.
Return Value:
0 with failure. with success The length the Strings in Parameter 5 without abschließendes Nullbyte.
Examples:
Declare Searchpath$,Filename$,Extension$,Size&,Buffer#,Pointer#,Fehler&,Point&
DEF SearchPath(6) !"KERNEL32","SearchPathA"
LET Searchpath$=$WINPATH
LET Filename$="NOTEPAD"
LET Extension$=".EXE"
Size&=255
DIM Buffer#,260
DIM Pointer#,4
Clear Buffer#
Clear Pointer#
Fehler&=@Searchpath(0,@addr(Filename$),@addr(Extension$),Size&,Buffer#,Pointer#)
Fehler&=@Searchpath(@addr(Searchpath$),@addr(Filename$),@addr(Extension$),Size&,Buffer#,Pointer#)
PRINT "Länge the Strings: "+@STR$(FEHLER&)
PRINT "Gefundene File: "+@String $(Buffer#,0)
Print "Adresse the Dateinamens: "+@st$(@Long(Pointer#,0))
LET POINT&=Buffer#
LET POINT&=@LONG(Pointer#,0)-POINT&
Print "Hier begins the Dateiname: "+@STR$(POINT&)
Print "Dateiname without way: "+@String $(Buffer#,Point&)
Dispose Buffer#
Dispose Pointer#
waitkey
|
|
|
| |
|
|