Switch to: V9V8V7V6V5

Valentina Class: Properties

Valentina.CacheSize

Declaration:

CacheSize as Integer (r/o)

The current size of Valentina cache is in bytes. You should assign the cache size when calling the Valentina.Init() method. There is no way to change this parameter at runtime.

Example:

size = Valentina.CacheSize

Valentina.Database(index)

Declaration:

Database( inIndex as integer ) as VDatabase (r/o)

Returns a database from the array of databases by an index.

See also:

Valentina.DatabaseCount

Example:

db = Valentina.Database( i )

Valentina.DatabaseCount

Declaration:

DatabaseCount as integer (r/o)

Returns the count of databases that were instantiated in your application. The result counts both opened and closed databases as well as local and remote databases.

Example:

res = Valentina.DatabaseCount

Valentina.DebugLevel

Declaration:

DebugLevel as EVDebugLevel (r/w)

This allows you to set the debug level for Valentina ADK.

Any debug level above 0 will create a file which outputs the results. The file will be named “V4RB_Log.txt”. It will be created in the same directory as the project. The only exception is for Mach-O builds in Mac OS X where it will be created one level inside the executable.

The valid values are:

kLogNothing   = 0 - no debug messages.
kLogErrors    = 1 - log a message only when an error occurs.
kLogFunctions = 2 - log every function.
kLogParams    = 3 - log every function and its parameters.

Example:

Valentina.Init( 10 * 1024 * 1024 )
Valentina.DebugLevel = EVDebugLevel.kLogParams

Note: Do not forget to set the debugging level to zero for your final product release.

Valentina.ErrNumber

Declaration:

ErrNumber as Integer (r/o)

Description:

You can examine this property to see if the last Valentina operation was successful.

There are 2 kinds of errors: OS-relative errors and Valentina-specific errors. OS-based errors are negative numbers. You can find their description in your OS documentation. Valentina specific errors are positive numbers.

NOTE: this style of “LAST ERROR” is used usually in Valentina ADKs for procedural languages. For OO languages the mechanism of exceptions is used with help of VException class.

Example:

errnumber = Valentina.ErrNumber

Valentina.ErrString

Declaration:

ErrString as String (r/o)

Description:

Returns the string which describes the last error. Usually is used in pair with Valentina.ErrNumber.

Example:

err_number = Valentina.ErrNumber
err_str = Valentina.ErrString
ShowErrorDialog( err_number, err_string )

Valentina.YieldMode

Specific to Valentina for Xojo.

Declaration:

YieldMode as Boolean (r/w)

Description:

Default state is “true”. If true, then we run special code inside most of V4RB calls for better UI responsiveness (no beach balls and “app not responding” state) within long Valentina calls. But, you may set it to false in some circumstances like console-based app (no UI) or unexpected app crashes.

Valentina.FlushEachLog

Declaration:

FlushEachLog as Boolean (r/w)

Description:

If this property is TRUE then Valentina will flush the disk log file after each message. This slows down the work significantly. But it is very useful if your application crashes.

TIP: You can wrap the problematic code only.

Example:

Valentina.FlushEachLog = true
 
	// some debugged code
 
Valentina.FlushEachLog = false

Valentina.LocalConnection

Declaration:

LocalConnection as VConnection (r/o)

Description:

Returns a VConnection object, which is a singleton (unique instance in the application) and plays the role of “connection to local HDD”.

This allows you to work with a local database using the API of a VConnection class. In particular, you can access the method VConnection.SqlQuery() to execute SQL commands beyond the database level.

Example:

dim localConnection as VConnection
localConnection = Valentina.LocalConnection
 
localConnection.SqlQuery( "USE DATABASE db1" )

Valentina.ThrowExceptions

Declaration:

ThrowExceptions as Boolean (r/w)

Description:

If this property is TRUE (default value) then Valentina ADK will throw exceptions. Otherwise, Valentina will not throw exceptions and you will have to check the property VDatabase.ErrNumber to verify whether a Valentina call was successful.

Example:

Valentina.ThrowExceptions = FALSE

Valentina.Version

Declaration:

Version as String (r/o)

Description:

Returns the version of the Valentina engine.

Example:

ver = Valentina.Version