Does anyone have any ideas as to why script is seeing this data as a variant instead of
a string or integer, or how I might be able to convert the item from a variant to an
integer in order to perform the multiplication?
I don't know either why LotusScript is seeing a number as a variant
(another one of those "feature"!) but you can use the Val() function to
convert the annoying variant to a number and treat it as a number within
your code.
Eric Lepage
Greg,
It may be seeing it as a Variant if it can contain more
than one value. To get around this you can just take the
first position in the Variant string and convert it to an
integer.
temp=Cint(var(0))
Jon
Has the field you are referring to been initialized ? If it does not
have any initial value, as far as I remember, it will be of data type
variant.
Anil Vartak
Gregory Radcliff <GRad...@gnn.com> wrote in article
<31F516...@gnn.com>...
> I'm currently accessing a field value from one document and moving that
value to another
> document via script. When I scan the document items using the Script
debugger it
> indicates that the field value is a variant data type. On the actual
form, the field is
> defined as an editable number field (fixed with one decimal place). I
would like to
> perform a multiplication function on the number, however script will not
allow this as
> it is a type mismatch.
>
> Does anyone have any ideas as to why script is seeing this data as a
variant instead of
> a string or integer, or how I might be able to convert the item from a
variant to an
> integer in order to perform the multiplication?
I've noticed something similar where a RT field with a default value
somehow appears as a
text field after a document is created via script. If you refresh the
document you may find that the fields
revert back to their true datatypes. I've had more problems with RT fields
than just about anything
else. Of course I wouldn't trade Notes for anything. :-)
danny