[netrexx-course] Consequences of the Explicit Option

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[netrexx-course] Consequences of the Explicit Option

General Picture
        Could I get some advice about dealing with the consequences of Options
Explicit?
        When I try to add Options Explicit to a typical AWT application, NetRexx
wants me to declare my frame object before I use it in main().
        Sure, that's to be expected. Problem is, since main() is static, I run
into "can't reference non-static properties in a static method" problems
when I try to start trying to declare the frame object.
        Thanks in advance.



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Consequences of the Explicit Option

dIon Gillard/Multitask Consulting/AU
On Mon, 15 Jun 1998 09:45:03 -0700, Mitch Gould wrote:

|   Could I get some advice about dealing with the consequences of Options
|   Explicit?
|   When I try to add Options Explicit to a typical AWT application, NetRexx
|   wants me to declare my frame object before I use it in main().
|   Sure, that's to be expected. Problem is, since main() is static, I run
|   into "can't reference non-static properties in a static method" problems
|   when I try to start trying to declare the frame object.

The frame you'd use in main, wouldn't be a property of your netrexx class, i.e. assuming something like this

class foo

method foo
        -- do other stuff here

method main(args=String[]) static
        Frame f = Frame()
        f.add(Button("Text"), BorderLayout.CENTER)
        f.setVisible(1)

The frame (f) must be created in main, it can't be a property of the class, as the main method is a static method and is associated with the class foo, not a particular
object of class foo....does this help??




----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Consequences of the Explicit Option

dIon Gillard/Multitask Consulting/AU
In reply to this post by General Picture
On Mon, 15 Jun 1998 17:06:28 -0700, Mitch Gould wrote:

|   Thanks for your reply. Here's what I get when I try this.
|  
|   Frame f = Frame()
|   ^^^^^
Sorry about that chief...some java slipping through..

Should be:
        f = Frame
        f = Frame("blah")
or
        f = Frame("Blah")





----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !