Die KBASE sagt folgendes:
Error: 'Type Mismatch' when using Variant array in LotusScript FullTrim function
Product:
Lotus Notes > Lotus Notes > Versions 6.5, 6.0, 5.0
Platform(s):
Mac OS, Windows
Doc Number:
1089796
Published 06.08.2003
Technote
Problem
A call to the LotusScript FullTrim function can sometimes result in the following error:
"Type Mismatch."
Further research indicates that this occurs only when a Variant array is passed as the parameter, and the elements of the array contain no text other than spaces, tabs or newline characters.
For example:
Dim d(1) As Variant
d(0)=" "
d(1)=""
result=Fulltrim(d)
Solution
This issue was reported to Quality Engineering as SPR# CDCO4K6KEL and has been fixed in Notes 5.0.12 and 6.0.
Workaround:
If the application allows, use a String array rather than a Variant array.
Additional code examples:
This code works without causing the error (since there is at least one element with a character other than a space, tab or newline).
Dim d(1) As Variant
d(0)=" "
d(1)="xyz"
result=Fulltrim(d)
This code works without causing the error because a String array is used:
Dim d(1) As String
d(0)=" "
d(1)=""
result=Fulltrim(d)
This code works without causing the error because a single variable Variant is used:
Dim d As Variant
d=" "
result=Fulltrim(d)
Excerpt from the Notes R5 Online Help:
FullTrim function
Takes an array and eliminates "empty" entries, or takes a string and eliminates duplicate, trailing and leading whitespace.
Syntax
FullTrim( v As Variant ) As Variant
Element
v
Any Array, String, or Variant containing a String.
Return value
A Variant containing a Array or String. If you pass in a String, you get back a String.
If you pass in an Array, you get back an Array.
Usage
Empty for strings is the Empty string.
Empty for numbers is the value 0.
Empty for Variants containing the above are the same. As Well as NULL and Empty.
The FullTrim Trims strings by eliminating any duplicate whitespaces (SPACE, TAB, NEWLINE) from the center of the string and all whitespace at the beginning and end of the strings.
The number of elements in a returned array may vary as empty elements are removed. If all the elements are removed, an array with one empty element is returned.
Andreas