1. Jose Panatti
  2. Valentina Database ADK
  3. Wednesday, May 03 2017, 08:27 PM
  4.  Subscribe via email
I`m trying to use enum types in Xojo from Valentina Database but I can't.
I want to complete a popup menu with strings from an enum type.
Created an object of type VTypeEnum but then I d'ont know how to retrieve the values and complete the popup.
Didn't find information on wiki.
Comment
There are no comments made yet.
Ruslan Zasukhin Accepted Answer
Hi Jose,

lets clarify:
- you using Valentina DB
- you want to use its FIELD TYPE VENUM ?
- you try API or SQL way or may be class_way ?

Did you see Example?
* V4RB/Examples/SQL_way/Field_Enum
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Ruslan Zasukhin Accepted Answer
Checking sources of V4RB plugin:

class VEnumType has only Constructor,
and property
Value as String.

I think so far this FIELD must be cerated via SQL ...
And this class allow to use it in VCursor.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
Jose Panatti Accepted Answer
Hi Ruslan.
I'm trying the API way using Valentina DB (client mode).
I saw the example, But seems to be wrong. It uses method of VDatabase called TypeEnum() that does not exist, I supose.
That occur in Method CreateTable_SQL of the Window.
I keep investigating.
Thanks again.
Comment
what is exact name of example and its path?
  1. Ruslan Zasukhin
  2. 2 years ago
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 3
Ruslan Zasukhin Accepted Answer
Yes I see that this example not compiles. We will fix this.
It seems the name of method was changed to

* Type(inIndex as integer) As VType
* Type(inName as string) As VType

To FIX that example change line as
enumType = VTypeEnum( mDatabase.Type( "DayOfWeek" ) )


Also you can check TestProject, search TypeEnum to find code related to this feature.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 4
Jose Panatti Accepted Answer
Now It works fine. Thanks Ruslan.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 5
Ruslan Zasukhin Accepted Answer
Hi Jose,

glad to hear that.

Please notice that main power and unique feature of ENUM fields in ValentinaDB comparing to PostgreSQL, is ability to store SEVERAL sets of localizable strings: EN, DE, RU etc, as many as you need.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.