GetDeviceName$
DeviceName$ = GetDeviceName$(Filename$)
 
Parameters:

    Filename$ = The filename & path you wish to grab the device letter from
Returns:

    DeviceName$ = The grabbed device name
 

      The GetDeviceName$ function returns the device letter from an absolute filename/path.



FACTS:


      * None




Mini Tutorial:


      This example, shows how to grab the file extension, filename, folder and device name from an absolute file name.

      An absolute filename, is a filename that contains the device, the folder (directory) and the filename. Something like this "C:\Windows\MyFile.txt"


  
  
; Create a filename string for us to examine
  File$="C:\Windows\Temp\HelloWorld.TXT"
  
; Display the File extension from the filename
  Print GetFileExt$(File$)
  
; Display the just the FileName
  Print GetFileName$(File$)
  
; display the directory with device and folder name
  Print GetFolderName$(File$)
  
; just the device name
  Print GetDeviceName$(File$)
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  
  




This example would output something like this.

  
  .TXT
  HelloWorld.txt
  C:\Windows\Temp\
C:
  

 
Related Info: GetFileExt$ | GetFileName$ | GetFolderName$ :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com