From: dave@powerbasic.com (Dave Navarro)
Subject: PBDLL5: Long filenames to short filenames
'=============================================================================
=
'
' LongToShort for PB/DLL 5.0
' Copyright (c) 1998 by PowerBASIC, Inc.
'
'=============================================================================
=
$COMPILE EXE
$INCLUDE "WIN32API.INC"
FUNCTION LongToShort(BYVAL Path AS STRING) AS STRING
LOCAL LongPath AS ASCIIZ * 256
LOCAL ShortPath AS ASCIIZ * 256
LOCAL Temp AS STRING
WHILE LEN(Path)
Temp = EXTRACT$(Path, "\")
LongPath = ShortPath + Temp
Path = LTRIM$(MID$(Path, LEN(Temp) + 1), "\")
GetShortPathName LongPath, ShortPath, SIZEOF(ShortPath)
ShortPath = ShortPath + "\"
WEND
FUNCTION = RTRIM$(ShortPath, "\")
END FUNCTION
FUNCTION WinMain (BYVAL CurInst&, _
BYVAL PrvInst&, _
CmdLine AS ASCIIZ PTR, _
BYVAL CmdShow&) EXPORT AS LONG
d$ = "C:\Program Files\Common Files\Designer\mscondes.dll"
MsgBox d$,, LongToShort(d$)
END FUNCTION
*** QwkNews (tm) v2.1
* [TN11.1] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|