Alex, you don't say what problem you're having.

My recollection (which may be foggy) is that the VB Replace function was
not supported in IIS4's VBScript, but is supported in IIS 5's.  Look up
"Replace function" in docs or on line and try it.  If it doesn't work,
you can try the one I wrote years ago, code below.

Once you've replaced the slashes, you can concatenate "file:" (ignore
auto-HTML formatting in this message) to your string.

strLink = "file:" & strFixedString

Is there a problem doing this?  What is it?

If you want to bend your brain a little, look up "regular expressions"
on the MSDN web site for a different way of manipulating strings.  An
entire book is about to be published on the subject by O'Reilly, which
may finally help me understand the black art of using them.

HTH

(watch for improper line breaks in the code below)

Function MyReplace(strIn, strOldText, strNewText)
' replace�instances of strOldText found in strIn
'  with strNewText
'  returns new string, strIn is preserved
        Dim intPos
        Dim strOut
        Dim intOldLen
        '�initialize�working string
        strOut = strIn
        intOldLen = Len(strOldText)
        intPos = Instr(1,strOut,strOldText)
        Do Until intPos = 0
        strOut = Left(strOut, intPos-1) & strNewText & Mid(strOut,
intPos + intOldLen)
                intPos = Instr(1,strOut,strOldText)
        Loop
        MyReplace = strOut
End Function

After you've done the replacement 


-----Original Message-----
From: Alex Elger [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 31, 2002 10:36 AM
To: ActiveServerPages
Subject: Replace Function.


Does any one know how i can add a string (Specifically file:) to the
start of a " + chr(34) + Location + chr(34) + "

Ie if Location = \\server\folder\doc
then i have replace, replace \ for /...
so i need to add file: to the start.
so i get file://server/folder/doc
Thanks for any help in advance.
Alex Elger
Micronage Ltd
[EMAIL PROTECTED]


---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED] To unsubscribe send a blank email to
%%email.unsub%%



---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to