Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

[V. 1.142] New Compiler - How to access Methods from Classes of higher Order?

Discussion in 'Programming Questions and Suggestions' started by Xellon, Jun 30, 2016.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Xellon Trainee Engineer

    Messages:
    66
    So, all new Compiler, yay!
    New Properties for IMyThrust, double yay!
    No longer able to access Methods from Classes of higher Order? Oh.

    Here's what I've been using until today:
    Code:
    void Main (string argument)
    {
        //Do some Stuff
    }
    
    void MyMethod()
    {
        //Do other Stuff
    }
    
    class MyClass : Program //This ": Program" is the bit that broke
    {
        MyMethod(); //This would have worked
    }
    I apologize in advance if I've got any Terms or Names wrong, I'm only doing a bit of Programming in my Freetime and got most of my Knowledge from Google Searches.

    So, I'd like to hereby summon upon us the Code Wizards, those wise Beings, and plead them to aid my cause: How can I get this into working Order again?!

    Thank you in advance!
    ~Xellon
     
  2. Malware Master Engineer

    Messages:
    9,511
    Adding my response to the PM for anyone else wondering the same:

    ###
    You're not supposed to inherit Program that way, that was never appropriate. All you would get is a pointless bloating of your class as none of its content would be initialized correctly, none of the GridTerminalSystem or Echo or anything else would be usable anyway.

    So to answer your question, yes, it's intended and no you cannot (and should not) circumvent it.

    What I do is pass Program in to subclasses as an instance.
     
Thread Status:
This last post in this thread was made more than 31 days old.