Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 14, 2019 6:19 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: cross platform registry
PostPosted: Thu Oct 13, 2011 9:08 am 
Offline
User avatar

Joined: Sat Jun 04, 2011 8:29 am
Posts: 387
The app Im working on was in VB ... switching to rB to get mac version too...

In VB we use the windows registry to hold some basic user registration information....

In RB is there a library or code to use that can get and set windows registry when in windows but if on mac do something similar...preferences maybe? resource folder? sorry havent been on mac for awhile - over ten years

_________________
Currently using:
Windows XP Pro SP3
Real Studio 2011 Release 4.3 Enterprise
and
Mac OS 10.7.4
Real Studio 2011 Release 4.3 Enterprise
(finally also compiled on Mac)


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Thu Oct 13, 2011 10:10 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
personally I think the registry is "evil"... and I avoid using it at all costs....

As such I developed a class that mimics the old INI method.... and it works for both WIN and MAC

there are a number of topics on this site discussing/mentioning it..... I'll see if I can find the link and post it later.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Thu Oct 13, 2011 10:22 am 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
Not at all to disrespect Dave's class in any way, but when I viewed it a bit ago I found I needed a bit more robustness for my purposes — especially as pertains to creating and preserving comments, spaces, etc. of the INI in the case the user views it directly. I also wanted the class structured a little differently for my purposes. So I wrote my own, too.

If you're interested in seeing mine as well so you can decide which fits your purposes, just let me know. It's free and I don't care if you give me any credit. :)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Thu Oct 13, 2011 10:29 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
Have a look at this

http://www.declaresub.com/wiki/index.php/Property_lists_and_how_to_make_them_using_the_plist_class

_________________
--

REALbasic - the best X-Platform development tool …
… if you don’t use styledText with Umlaute or accent characters.
… if you don’t need dates before 1601.
… if you only open a drawer window but never close it.


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Thu Oct 13, 2011 2:43 pm 
Offline
User avatar

Joined: Sat Jun 04, 2011 8:29 am
Posts: 387
Sure interested on looking at those samples....any and all samples are typically good for learning...

I also use INI files for settings....

Registry used for storing user registration info, birthdate, activation key...

I suppose I could just store it all in a file...

Are you doing that on the mac too for preferences, settings and similar?

_________________
Currently using:
Windows XP Pro SP3
Real Studio 2011 Release 4.3 Enterprise
and
Mac OS 10.7.4
Real Studio 2011 Release 4.3 Enterprise
(finally also compiled on Mac)


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Thu Oct 13, 2011 3:06 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
I always store settings outside of the application. That's just good, standard functionality. My rule of thumb is this:

If I want the user to be able to view the settings directly and make changes, then I go with the INI format. It's simple, easy to look at, allows for comments, and works. But its upside is its downside: it's simple.

If I want to, say, store an array of objects into my settings, then an INI just won't cut it. At the very least it'd be an organizational nightmare and would likely turn the file into a beast I don't want the user messing with. In this case I switch to a PLIST structure, which is basic XML. As XML it has a much more capable structure for holding much more complicated data (like my object array). But I would never ask my user to go in this file, and as such tend to store them away in the SpecialFolder.Preferences location.

Hope this helps. :)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Thu Oct 13, 2011 4:21 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
Here's the link for my INI class: http://dl.dropbox.com/u/1392338/RockTheINI.rbp

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Fri Oct 14, 2011 3:55 pm 
Offline
User avatar

Joined: Sat Jun 04, 2011 8:29 am
Posts: 387
does PLIST work in windows and mac?

besides settings i need to store data to a file....mainly map a bunch of textfields data to a file and be able to read back in...but complicates by multiple grids that can each have a varying number of rows that also need to be saved...

i will check out rockini on monday...thanks for that....

_________________
Currently using:
Windows XP Pro SP3
Real Studio 2011 Release 4.3 Enterprise
and
Mac OS 10.7.4
Real Studio 2011 Release 4.3 Enterprise
(finally also compiled on Mac)


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Fri Oct 14, 2011 4:21 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
torrid wrote:
besides settings i need to store data to a file....mainly map a bunch of textfields data to a file and be able to read back in...but complicates by multiple grids that can each have a varying number of rows that also need to be saved...

That would be a database then.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Fri Oct 14, 2011 4:26 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
markwalsh wrote:
That would be a database then.

Not necessarily. This could be accomplished by a Plist if he so chose. It certainly has the structure to be able to handle what he's describing.

PLIST isn't something that "works" or not; it's an OSX standard for writing preferences to a file. Does that mean it doesn't work on Windows? Not at all, as it really only matters that your software is familiar with the file. In either case it's really just XML, but on OSX it has some further jargon for matching the current Apple standards. On Windows just think of it as a glorified XML file.

Either class will read and write to the respective files. Again, my rule of thumb is whether or not a user will be viewing the file directly. If not, then just go with the Plist — it's more capable and if you decide you want to add more settings in the future you won't be limited by the flat capabilities of the INI structure.

Hope this helps. :)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Sat Oct 15, 2011 9:58 am 
Offline
User avatar

Joined: Sat Jun 04, 2011 8:29 am
Posts: 387
Jason
Thanks for the help....I have not gotten to that part of my project but probably will be on tues or wed... in VB i am writing binary UDTs to a file...unfortunately if you change the UDTs u have to keep code in app to translate if they open an old file....

Several posts in multiple places have encouraged me to use sqllite....but i like the idea of XML better because that keeps door open for even a web version to open and parse an xml file....

if you have any suggestions of samples or tutorials etc. related to storing data to file in xml i really need to study that....

God Bless
Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: cross platform registry
PostPosted: Sat Oct 15, 2011 2:50 pm 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
markwalsh wrote:
torrid wrote:
besides settings i need to store data to a file....mainly map a bunch of textfields data to a file and be able to read back in...but complicates by multiple grids that can each have a varying number of rows that also need to be saved...

That would be a database then.


FileStream Class, is also a good X-Platform solution, many don't seem to know it.
I have a updated version of it, if you need it then pop a PM or search the forum it must be there with a link.

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 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