9.0

225
Rem Instruction
Syntax
Rem ...
-or-
'...
Group
Miscellaneous
Description
Both forms are comments. The Rem form is an instruction. The ' form can be used at the end of any line. All text
from either ' or Rem to the end of the line is part of the comment. That text is not executed.
Example
Sub Main
Debug
.Print "Hello" ' prints to the output window
Rem the macro terminates at Main's End
Sub
End
Sub
Replace$ Function
Syntax
Replace[$](S$, Pat$, Rep$, [Index], [Count])
Group
String
Description
Replace Pat$ with Rep$ in S$.
Parameter Description
S$ This string value is searched. Replacements are made in the string returned by
Replace.
Pat$ This string value is the pattern to look for.
Rep$ This string value is the replacement.
Index This numeric value is the starting index in S$. Re
p
lace
(
S,Pat,Re
p
,N
)
is e
q
uivalent to
Replace(Mid(S,N),Pat,Rep). If this is omitted use 1.
Count This numeric value is the maximum number of re
p
lacements that will be done. If this
is omitted use -1 (which means replace all occurrences).
See Also: InStr( ), InStrRev( ), Left$( ), Len( ), Mid$( ), Right$( ).
Example
Sub Main
Debug
.Print Replace$("abcabc","b","B") '"aBcaBc"
Debug
.Print Replace$("abcabc","b","B",,1) '"aBcabc"
Debug
.Print Replace$("abcabc","b","B",3) '"caBc"