You should stick with the first method if you created the method using
extends.  If the property "does not exist" then it may be a simple scoping
issue.  In other words you might want to make the method protected (just in
case you accidentally made it private) or even public depending upon where
you put the method or if it will be called from different locations.

~joe

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lennox
Jacob
Sent: Thursday, August 10, 2006 7:47 PM
To: Getting Started
Subject: Re: How can I simplify this code?

Thanks Christian,

If I use it like this:
EF1.SetupColor
EF2.SetupColor
EF3.SetupColor
EF4.SetupColor
EF5.SetupColor
I get a compile error
This method or property does not exist    (SetupColor)


But if I call it like this

SetupColor(EF1)
SetupColor(EF2)
SetupColor(EF3)
SetupColor(EF4)
SetupColor(EF5)

Then I get a compile error
Only the first parameter may use the Extends option.

Kindly assist again.
Thanks 
Lennox

Christian Miller <[EMAIL PROTECTED]> wrote: -----BEGIN PGP SIGNED
MESSAGE-----
Hash: SHA1

On Aug 10, 2006, at 7:01 PM, Lennox Jacob wrote:
>   How can I simplify this code?

Protected Sub SetupColor(Extends EF as Editfield)
   If EF.text = ""  then
     EF.backcolor = &cDBDBDB
   else
     If val(EF.text) > 18 then
       EF.backcolor = &cFF8CC8
     else
       EF.backcolor = &cF9FFCF
     end if
   end if
End Sub


And then just call it:
EF1.SetupColor
EF2.SetupColor
EF3.SetupColor
EF4.SetupColor
EF5.SetupColor

Christian
Pariahware, Inc. Custom Software



- --
God loved you so much that He gave His only son Jesus.  What have you  
done with God's gift?



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFE28aUvplmRR9PMqERAhjZAJwPV4jbMk/U3ZSNvhD4cRSIQ79S7wCfWuXv
qRu/JM/4VyTtIApIZ5TobW8=
=yMn+
-----END PGP SIGNATURE-----
_______________________________________________
Unsubscribe or switch delivery mode:


Search the archives of this list here:




                
---------------------------------
Get your email and more, right on the  new Yahoo.com 
_______________________________________________
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>

Reply via email to