New topic: 

SQLite Data Type For Color?

<http://forums.realsoftware.com/viewtopic.php?t=46128>

         Page 1 of 1
   [ 5 posts ]                 Previous topic | Next topic          Author  
Message        tseyfarth          Post subject: SQLite Data Type For 
Color?Posted: Mon Dec 03, 2012 10:22 pm                         
Joined: Sat Dec 04, 2010 9:14 pm
Posts: 759                Hello all,

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

Thanks
Tim   
                             Top                npalardy          Post subject: 
Re: SQLite Data Type For Color?Posted: Mon Dec 03, 2012 10:41 pm                
       Real Software Engineer          
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7572
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      
_________________
My web site Great White Software
RBLibrary.com REALbasic learning  
                             Top                tseyfarth          Post 
subject: Re: SQLite Data Type For Color?Posted: Mon Dec 03, 2012 11:10 pm       
                  
Joined: Sat Dec 04, 2010 9:14 pm
Posts: 759                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                timhare          Post subject: 
Re: SQLite Data Type For Color?Posted: Mon Dec 03, 2012 11:22 pm                
         
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 11859
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                tseyfarth          Post 
subject: Re: SQLite Data Type For Color?Posted: Mon Dec 03, 2012 11:30 pm       
                  
Joined: Sat Dec 04, 2010 9:14 pm
Posts: 759                OK, 

Thanks Timhare!
Tim   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 5 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to