Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Nov 19, 2018 2:25 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: SQLite Data Type For Color?
PostPosted: Mon Dec 03, 2012 10:22 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Hello all,

What is the best data type to use to save a color value in SQLite?

Thanks
Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: SQLite Data Type For Color?
PostPosted: Mon Dec 03, 2012 10:41 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
well since colors are basically just numbers you might use an integer

few, if any databases, have matching types for things like colors

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: SQLite Data Type For Color?
PostPosted: Mon Dec 03, 2012 11:10 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Hello npalardy and thanks for your reply!

So, it would be read in as an integer, but would rs "like" using that value to set a color?

Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: SQLite Data Type For Color?
PostPosted: Mon Dec 03, 2012 11:22 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Yes. The "easy" way to do the conversion is to use a Variant.

dim n as integer = rs.Field("theColor").IntegerValue
dim v as variant = n
dim c as color = v


Top
 Profile  
Reply with quote  
 Post subject: Re: SQLite Data Type For Color?
PostPosted: Mon Dec 03, 2012 11:30 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
OK,

Thanks Timhare!
Tim


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group