Table of Contents
May I See Your References?
Since Valentina operates independently from your application, you should know how to identify Valentina databases and where Valentina databases are located.
You have installed Valentina and are ready to start developing. The Valentina API makes use of references across all incarnations of Valentina tools. If you already know what a reference is, go ahead and skip ahead.
What You Should Already Know
You should understand the basic structure of Revolution projects, functions, handlers, and using interface tools. You should have the understanding of the basics of your computer operating system for storing documents. You should already know the difference between information stored on the disk and information stored in memory
What You Will Learn
- What xxRef, especially dbRef refers to and how to use it
- How do paths work in Valentina
Where to Go Next
Start creating database applications! You may be returning here from Start, Stop and Create Databases to freshen up your understanding of references.
What is a Reference?
Those chapters (and other chapters) regularly use parameters like dbRef, TableRef, FieldRef, CursorRef and others. All of these reference parameters refer to an integer that already exists at the time you actually should use it.
Created Objects: Yes, You Made Them. Your development tool may not be object-oriented in a classic sense, but Valentina is definitely an object-relational database. Valentina databases are objects. When you create a new database, you are creating an instance of an empty Valentina database – an instance of Vdatabase class. What you get back is a reference to this new object that now exists in memory.
If you are not familiar with object-oriented programming, then objects and instances are probably not very meaningful for you. It is important for you to know a few things about Valentina objects and instances even though you haven`t read up on object-oriented programming.
Valentina objects aren’t entirely blank slates – think of them as a kind of copy of a template - similar to using templates in a word processor. An object already has a tiny amount of data in it, and it knows how to execute various commands. It is a lot like a simple robot that rolls off an assembly line.
Again and again you will see a reference to dbRef, which is an integer. You don’t have to worry about what that integer is at this point, only that it`s available for your use. This actually refers to the instance of a Valentina object and it’s the way Valentina keeps track of databases, tables and other objects.
dbRef and Revolution
In Example: Creating a New Database, the first thing you do is create an object in RAM and then you get back a small reference to this object using dbRef.
mDatabase is dbRef for everything that follows on operations within the scope of what you are doing. It doesn’t really matter that it's an integer.
Almost every handler with Valentina uses a reference like dbRef as its first parameter, so this isn’t something you should gloss over.
How Paths Work in Valentina
Valentina is a cross-platform database, and unfortunately, operating systems work with paths differently, so for each OS you should specify the path in the expected format.