ComponentOne List 8.0 for ActiveX
Bookmarks in Visual Basic

Visual Basic, on the other hand, treats bookmarks as true variants. That is, they are quantities that can be converted from one form to another without loss of equality, unless they are both in the form of a string. In addition, bookmarks are often passed in Visual Basic as byte arrays, both by the list and by the Data control.

In Visual Basic, two bookmarks should not be compared for equality unless they are first converted to strings. This rule holds true regardless of whether the bookmark comes from a list (bound or unbound) or from a Data control.

Another important consideration regarding bookmarks is their length. You should take care to ensure that all bookmarks in your application are created in the same way. For example, the Visual Basic functions Format$ and Str$ do not generate the same string, even if they are passed the same numeric value. The Str$ function always generates a leading space character for the sign of the numeric value, while Format$ does not:

Str$(1) = " 1"

Format$(1) = "1"

Remember that since these strings are of different length, they constitute different bookmarks.

To avoid difficulties of this nature, we suggest writing a single Visual Basic function, like the MakeBookmark function used in the unbound tutorial projects, and use it consistently whenever a bookmark must be generated.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback