home *** CD-ROM | disk | FTP | other *** search
-
- 'getpstr.bas - Get information using the GetProfileString API call
-
- open "kernel.dll" for dll as #kernel
-
- appName$ = "windows"
- keyName$ = "device"
- default$ = ""
-
- 'add an ASCII zero so that Liberty BASIC will not pass a copy of result$
- 'into the API call, but a pointer to result$
- result$ = "Carl "+chr$(0)
- size = 50
-
- calldll #kernel, "GetProfileString",_
- appName$ as ptr,_
- keyName$ as ptr,_
- default$ as ptr,_
- result$ as ptr,_
- size as short,_
- result as short
-
- close #kernel
-
- 'display the retrieved information up to but not including the
- 'terminating ASCII zero
- print left$(result$, instr(result$, chr$(0)) - 1)
-
- input r$
-
-
-
-
-
-