Link to home
Start Free TrialLog in
Avatar of mories
mories

asked on

converting filename to truename... ??

Hello people,

if have a string which is a filename on drive h: for ex
strFilename := 'h:\ab\test.doc'

i'm on a network and i want to convert strFileName to a truename like '\\servername\sharename'

i use Windows.WNetGetConnection(PChar('h:'),PChar(strNetPath),dwMaxNetPathLen)
to get the truename of h:

but how do i put these two string together ???

'\\servername\share'
'h:\ab\test.doc'
to become
'\\servername\share\ab\test.doc'

i have tried some string operations. but i cannot get this to work.
Avatar of inter
inter
Flag of Türkiye image

Hi,

Let

x := '\\servername\share';
y := 'h:\ab\test.doc' ;

The code for concatenating them is

fullname := x + System.Delete(y,1,2); //delete drive letter from y

Regards,
Igor
ASKER CERTIFIED SOLUTION
Avatar of RJENKINS
RJENKINS

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial