Hi all,
The following routine does not replace the found string with the replacement 
string as expected.  First of all, all words with characters not usually 
allowed in the exception dictionary are swiped in to a three dimensional array 
with their associated translations.  This is actually happening as I wrote a 
test routine to check that it was.  In the third dimension of the array, I am 
storing a list of characters not allowed in the exception dictionary.  This is 
all so happening as I wrote a test routine to check that too.  The problem is 
in the following function where InStr and Replace function don't seem to be 
behaving as I expect them to.  

Begin VbScript
Function OnSpeak(originalString)
 Dim TempString
OnSpeak = originalString
For x = 0 To EntryCount 
' Entry count is a global var value is set at the amount of entries inthe 
excepdictionaries.
If InStr(originalString, ExcepEntries(0,x))
originalString = Replace(originalString, ExcepEntries(0,x), ExcepEntries(1,x))
Next
TempString = OriginalString
OnSpeak = Replace(originalString, OriginalString, TempString)
End Function
This routine worked perfectly when I was just dealing with the Space character, 
but not now I am dealing with 27 punctuation characters.   ExcepEntries(0,x) is 
being indexed as expected because I can test this by putting a speak 
ExcepEntries(, in the loop, and as expected window-eyes is giving me all the 
stored words it has found when the dictionaries were swiped.  I still get the 
space character and chr(33) which is explanation mark, behaving as I want, but 
nothing else, even though they are dinamically present in memory. I can't think 
what's the problem here.  Can someboey give me some pointers.
Warm regards.
Martin Webster.



      

Reply via email to