gettingstarted
[Top] [All Lists]

RE: [RB] Converting Properties/values to string?

To: "'Getting Started'" <gettingstarted at lists dot realsoftware dot com>
Subject: RE: [RB] Converting Properties/values to string?
From: "RBNUBE" <rbnube at mabenterprises dot com>
Date: Mon, 28 Mar 2005 20:23:36 -0500
Delivered-to: gettingstarted at lists dot realsoftware dot com
Importance: Normal
Keywords: rb-gettingstarted
Use integer variables for the RGB color values and then convert these
values to strings that can be saved to your preference file.

  Dim colorRED, colorGREEN, colorBLUE as Integer
  colorRED = 80
  colorGREEN = 20
  colorBLUE = 150
  
  g.forecolor=RGB(colorRED, colorGREEN, colorBLUE)
  g.fillrect 2,2,canvas1.width-3,canvas1.height-3

Write the values of Str(colorRED), Str(colorGREEN) and Str(colorBLUE) to
your prefs file.


Booleans can be written by checking the value before writing:

If thisBoolean = True then
  // Write "True" to your prefs.
Else
  // Write "False" to your prefs.
End If




-----Original Message-----
From: gettingstarted-bounces at lists dot realsoftware dot com
[mailto:gettingstarted-bounces at lists dot realsoftware dot com] On Behalf Of
Eirik Karlsen
Sent: Monday, March 28, 2005 5:27 PM
To: Getting Started
Subject: [RB] Converting Properties/values to string?


Hi,
on saving my app's config (ini) settings I want to do things as simple
as possible. I plan on storing in a text file. The variables are of
type: Color, Boolean, String, Integer/Double


The problem is Color and Boolean, i.e &cFF00FF and False

Is there a simple way of converting these to string so they can simply
be appended to the string as shown here:

fileStream.WriteLine "RPMDROcolor="+str(RPMDROcolor)
(this one obviously doesn't work...)

I'd also need to convert these back later on config open.

Any ideas?

--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>