VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



The first of the 2 functions takes the filename or fullpath of filename as argument and returns the

by Vijaya Krishnan . K (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 30th December 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

The first of the 2 functions takes the filename or fullpath of filename as argument and returns the extension of the file. The second function

Rate The first of the 2 functions takes the filename or fullpath of filename as argument and returns the



 
Public Function GetExtension(filename as string) as string

dim i as integer
dim l as integer
dim pos as integer

l = len(filename)

for i = l to 2 step -1
  c = mid(filename,i,1)
  if c = "." then
    pos = i + 1
    exit for
  end if
next

c = mid(filename,pos,(l-pos+1))
GetExtension = c

End Function 


'module to get filetitle given full path of filename
 
Public Function GetFileTitle(filename as string) as string

dim i as integer
dim l as integer
dim pos as integer

l = len(filename)

for i = l to 2 step -1
  c = mid(filename,i,1)
  if c = "\" then
    pos = i + 1
    exit for
  end if
next

c = mid(filename,pos,(l-pos+1))
GetExtension = c

End Function 







Download this snippet    Add to My Saved Code

The first of the 2 functions takes the filename or fullpath of filename as argument and returns the Comments

No comments have been posted about The first of the 2 functions takes the filename or fullpath of filename as argument and returns the. Why not be the first to post a comment about The first of the 2 functions takes the filename or fullpath of filename as argument and returns the.

Post your comment

Subject:
Message:
0/1000 characters