User guide

DOKuStar Validation Programming Manual Page 29
Dim alt As Alternative
'...
Set fld = subdoc.Fields("TotalAmount")
fld.Value = "547.47"
'...
'* add a sourceinfo
Set srcInfo = fld.CreateSourceInfo("dataset::ImageSourceInfo")
srcInfo.DataSource = imgDataSource
srcInfo.Zone.SetValue 1650, 2020, 100, 20
'* add alternative
Set alt = fld.Alternatives.Add("dataset::TextFieldAlternative", "TotalAmount_1")
alt.Value = "471,96"
Set srcInfo = alt.CreateSourceInfo("dataset::ImageSourceInfo")
srcInfo.DataSource = imgDataSource
srcInfo.Zone.SetValue 1650, 1930, 100, 20
An Alternative is an own kind of object, which is created by using the Add method of a field’s Alternatives
collection. It takes the fixed string
dataset::TextFieldAlternative as the first parameter and a name for the
alternative (which can be chosen freely) as the second parameter.
Like fields, you add a
Value and a SourceInfo to the alternative.
Alternatives are displayed with a green box in the full image. They need not reside on the same page as the field
itself.