TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: DAVE NAVARRO
date: 1998-01-21 16:19:00
subject: PBDLL5: Long filenames to

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.