here is some code i use in a list box so it is from an string


  dim c as color
  dim cv as variant

  if me.ListIndex <> -1 then
       if nameUsed = false then
      cv = me.Cell(me.ListIndex,0)
      cv = ReplaceAll(cv,"#","&c")
      c = cv

      Rectangle1.FillColor = c
      Rectangle2.FillColor = c
    end if

    if nameUsed = true then
      cv = me.CellTag(me.listindex,0)
      cv = ReplaceAll(cv,"#","&c")
      c = cv
      Rectangle1.FillColor = c
      Rectangle2.FillColor = c
    end if
   end if


On 2006-11-19, at 22:29, Youri wrote:




Terry,


Using this I get a : "Type Mismatch Error

Expected Color, but got Variant.


Youri



Terry Ford wrote:
On Nov 19, 2006, at 12:49 PM, Youri wrote:
How can I retrieve (reconstruct) my colors from text to a Color datatype?
Use a variant as an intermediate conversion step.
Dim v As Variant
t = f.OpenAsTxtFile
s = t.readall
v = NthField(s,",",1)
Cal.BackColor = v
Terry
_______________________________________________




Sven E
-----------------------
REALbasic2006R4 OS X 10.4.8 Intel and 10.4.6 PPC
SEEdit Maxi THE XHTML EDITOR FOR MACINTOSH
http://www.seedit.info



_______________________________________________
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>

Reply via email to