Ken, looks like I was off a bit but not completely wrong.  A grid in the
MSDN Library shows that the Replace function (which had been in VB for
ages) was made available by the IIS 3 upgrade, which brought VBScript 2
with it.  Later versions of VBScript arrived with IIS 4 and VS 6.  It
wasn't until IE 5 that IE began bringing VBScript upgrades.  Seems an
odd place to do it, doesn't it?  We never use, and therefore never
upgrade, IE on our servers.


-----Original Message-----
From: Ken Schaefer [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 01, 2002 4:21 AM
To: ActiveServerPages
Subject: Re: Replace Function.


VBScript is independant of the IIS version. You can either download the
VBScript engine separately, or you can update your copy of Internet
Explorer (which will also update your VBScript/JScript engines)

Also, you can find out which version a function has been supported in by
looking in the reference. Replace has been there since VBScript v2.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Showbear" <[EMAIL PROTECTED]>
Subject: RE: Replace Function.


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.unsub%%


---
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