A Custom Class says my class is Null

Hi,
I have a class (Math2) with misc functions for my project. It
has a function called CheckRelations() which basically checks a
static array in another class (relation). But the Math2 class acts
as if the Relation class is non-existent, even though I have
imported it and I also have all files in the same folder. When I
try to relate to the class in any way i get a Runtime-Error 1009
(Cannot access a property or method of a null object reference.)
I tried tracing the class along with two other classes (one
imported, but another is not) the two classes trace fine: [class
Human] [class relationship]. The Relation class when traced in the
Math2 class results in a 'null'
Code for the CheckRelations function in math2 class: (takes
in String value, and returns the index at which the input =
relation.Type ( i.e. if (String_Input == Relation.Relations
.Type) --> return i ) Return -1 if not found)
import Human;
import Relation; //notice that Relationship is not imported
yet traces out fine
//......REST OF CLASS (other static functions
public static function
CheckRelations(relationType:String):int {
///////Variables
trace(Human,Relation,Relationship); //Human and Relationship
are classes I used to test problem
//Output: [class Human] null [class Relationship]
var relationType:String;
//relationType: the relation to look for in the relations
array
var array:Array = Relation.Relations; //Relations is a
public static var (array)
//array: the array to look inside
var relation:Relation;
//relation: used to hold temp values of relations to compare
var ReturnValue:int = -1;
//ReturnValue: the value to return
var i:uint;
//i: used in for..loops
///////Function
//SOURCE OF ERROR: any reference to Relation class
RelationCheck:for (i = 0; i < array.length; i++) {
relation = array as Relation;
if (relation.Type == relationType) { //relation.Type is a
string value
ReturnValue = i;
break RelationCheck;
return ReturnValue;
Code for getRelation function in Relation class:
public static function getRelation(relation:String):Relation
var val:int = Math2.CheckRelations(relation); // SOURCE OF
ERROR
if (val == -1) {
GameError.InvalidRelation(relation); //throws error when an
invalid relation is specified {this is NOT the problem I'm having}
}return Relations[relation];
------------------------------------------------------------------------------------------ ---------------------------------------------------------

OK, I believe I have got the problem. When I tried to call
the Relation class from another class, I couldn't do that before I
cut any references to the Math2 class. So i ported the
checkRelations function into the Relation class itself in order to
cut any reference to the Math2 class. But to my surprise, when I
did that, I could trace out the Relation class normally from not
only another class, but the Math2 class itself! So after a long
time fiddling with the program I figured out that the reason Math2
was unable to relate to the Relation class was because the Relation
class was still not fully initiated. And since Relation class used
the Math2 class as part of the initiation, and the Math2 class
needed to use the Relation class itself in order to initiate the
Relation class there was practically no existence of the Relation
class as it was still in the initialization process (if that makes
any sense). So instead i called the defineRelations function in my
main fla file, to make sure the Relation class is all set before
hand, and it worked like a charm.
Anyways, thanks a lot Jamesabth
for taking the time to look at my code and help me
out, it was your advice that lead me to this discovery after all .
And also thanks to anyone who has took the time to look through my
problem even though they may have not been able to help me with
it.

Similar Messages

  • Object Custom Program Name of class RE and language EN does not exist

    Hi All,
             We are getting this bbelow error while running a custome program ,
    Object <Custom Program Name> of class RE and language EN does not exist
    Do any one has faced this similar issue earlier.
    Regards,
    Sen

    Hi,
    How did you resolve this problem ?
    Re: Object <Custom Program Name> of class RE and language EN does not exist.
    I am also encountering the same issue when I am executing the report.
    Regards,
    SSR.

  • Inner class vs. imported class

    Hi everyone,
    I have entitiy beans created for a client's web app I'd like to use in the
    web service using WebLogic Workshop 7.0. Say the classes are imported like
    this in the services:
    import com.hoike.clientname.ap.bean.Invoice
    import com.hoike.clientname.ap.bean.Vendor
    Instances of these classes are used in callback methods and some of the
    service methods.
    When I generate the CTRL file, it actually adds those imported classes as
    inner class of the service defined.
    The problem is that when I try to used these services from another service,
    I cannot use the imported classes (as Invoice or Vendor), but instead I have
    to use the inner class (InvoiceService.Invoice or VendorService.Vendor)
    Does WebLogic Workshop 7.0 only allow you to use inner classes? Is there a
    way to use custom classes as method parameters?
    Thanks in advance!
    Makoto

    how do you declare your inner class?
    Is it (public)
    public static class MyInnerClassor (private)
    private static class MyInnerClassor (package)
    static class MyInnerClassor (protected)
    protected static class MyInnerClassTry to change the way you declare the inner class. Use protected or package or public instead.

  • Access data of one class from another class

    Hi,
    I am creating one class say ClassA with some data members,the same class has main() method on execution of which the data members will b assigned a value.
    now i have another class say ClassB with main() method and i want to use the data in ClassA in ClassB do i have any way by which i can have access to that data.
    The instance of ClassA created in ClassB is not showing any values in data members.
    Can u help me find a solution for this.
    Thank you.
    Parag.

    I have tried by making one data member public so that it can have direct access from other class.But it shows null value.
    The problem is that ClassA class data members are assigned values when it completes the execution of function main() so does it retains the values.
    c sample code below.
    public classA{
    int a,b;
    p s v m(String [] args)
    setab();
    public void setab()
    //set values of a and b by doing some manipulations.
    public classB{
    p s v m(string []args)
    classA aclass = new classA();
    /* now what should i do to access the values of a & b in
    aclass object*/
    i strictly need to follow this way do i have a way out.

  • How Do I Run A Class From Another Class?

    Hiya everyone, id like to know how to run a class from another class.
    Ive got a Login class which extends a JFrame and a Personnel class which also extends a JFrame. When i press the login button (in Login class), ive got it to decide if password/login are acceptable and if they are, I want the Login class to close then run the Personnel class.
    Im just after the code which says to close this class and run the Personnel class. How do i do that?
    Ive researched this but couldnt get an understandable answer!
    Help would be much appreciated, Ant...

    This is the Login Class:
    public class MainMenu extends javax.swing.JFrame {
        Statement statement = null;
        int currentRecord;
        ResultSet rs = null;
        String name = null, job = null, mission = null, login = null, password = null;
        String loginVal;
        String passwordVal;
        /** Creates new form MainMenu */
        public MainMenu() {
            initComponents();
            try{
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                String filename = System.getProperty("user.dir") + "/src/Personnel.mdb";
                String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + filename;
                Connection conn = DriverManager.getConnection( database , "","");
                statement = conn.createStatement();
                System.out.println("Connected...ok");
            } catch (Exception e) {
                System.err.println("Got a connection Problem!");
                System.err.println(e.getMessage());
        private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {                                        
            loginVal = txtLogin.getText();
            passwordVal = txtPassword.getText();
            String name = null, job = null, mission = null, login = null, password = null;
            try{
                rs = statement.executeQuery("SELECT Login,Password FROM Personnel WHERE Login = '" + loginVal + "' ");
                System.out.println("TRYING SELECT CLAUSE");
                if(rs.next()){
                    System.out.println("THERE IS A NEXT RECORD");
                    login = rs.getString(1);
                    password = rs.getString(2);
                    System.out.println("GOT THE NEXT RECORD");
                    System.out.println(login + password);
                System.out.println("Query Complete");
            }catch(Exception s){
                //s.printStackTrace();
                System.out.println("NO RECORDS EXIST FOR THIS LOGIN ID");
            if(passwordVal.equals(password)){
                System.out.println("Access Granted"); //CLOSE MAIN AND RUN CONTROL CLASS
            } else{
                System.out.println("Access Denied"); //RE-RUN CLASS
        }                 

  • Passing a parameter from one class to another class in the same package

    Hi.
    I am trying to pass a parameter from one class to another class with in a package.And i am Getting the variable as null every time.In the code there is two classes.
    i. BugWatcherAction.java
    ii.BugWatcherRefreshAction.Java.
    We have implemented caching in the front-end level.But according to the business logic we need to clear the cache and again have to access the database after some actions are happened.There are another class file called BugwatcherPortletContent.java.
    So, we are dealing with three java files.The database interaction is taken care by the portletContent.java file.Below I am giving the code for the perticular function in the bugwatcherPortletContent.java:
    ==============================================================
    public Object loadContent() throws Exception {
    Hashtable htStore = new Hashtable();
    JetspeedRunData rundata = this.getInputData();
    String pId = this.getPorletId();
    PortalLogger.logDebug(" in the portlet content: "+pId);
    pId1=pId;//done by sraha
    htStore.put("PortletId", pId);
    htStore.put("BW_HOME_URL",CommonUtil.getMessage("BW.Home.Url"));
    htStore.put("BW_BUGVIEW_URL",CommonUtil.getMessage("BW.BugView.Url"));
    HttpServletRequest request = rundata.getRequest();
    PortalLogger.logDebug(
    "BugWatcherPortletContent:: build normal context");
    HttpSession session = null;
    int bugProfileId = 0;
    Hashtable bugProfiles = null;
    Hashtable bugData = null;
    boolean fetchProfiles = false;
    try {
    session = request.getSession(true);
    // Attempting to get the profiles from the session.
    //If the profiles are not present in the session, then they would have to be
    // obtained from the database.
    bugProfiles = (Hashtable) session.getAttribute("Profiles");
    //Getting the selected bug profile id.
    String bugProfileIdObj = request.getParameter("bugProfile" + pId);
    // Getting the logged in user
    String userId = request.getRemoteUser();
    if (bugProfiles == null) {
    fetchProfiles = true;
    if (bugProfileIdObj == null) {
    // setting the bugprofile id as -1 indicates "all profiles" is selected
    bugProfileIdObj =(String) session.getAttribute("bugProfileId" + pId);
    if (bugProfileIdObj == null) {
    bugProfileId = -1;
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    session.setAttribute(
    ("bugProfileId" + pId),
    Integer.toString(bugProfileId));
    //fetching the bug list
    bugData =BugWatcherAPI.getbugList(userId, bugProfileId, fetchProfiles);
    PortalLogger.logDebug("BugWatcherPortletContent:: got bug data");
    if (bugData != null) {
    Hashtable htProfiles = (Hashtable) bugData.get("Profiles");
    } else {
    htStore.put("NoProfiles", "Y");
    } catch (CodedPortalException e) {
    htStore.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    PortalLogger.logException
    ("BugWatcherPortletContent:: CodedPortalException!!",e);
    } catch (Exception e) {
    PortalLogger.logException(
    "BugWatcherPortletContent::Generic Exception!!",e);
    htStore.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.GET_BUGLIST_FAILED));
    if (fetchProfiles) {
    bugProfiles = (Hashtable) bugData.get("Profiles");
    session.setAttribute("Profiles", bugProfiles);
    // putting the stuff in the context
    htStore.put("Profiles", bugProfiles);
    htStore.put("SelectedProfile", new Integer(bugProfileId));
    htStore.put("bugs", (ArrayList) bugData.get("Bugs"));
    return htStore;
    =============================================================
    And I am trying to call this function as it can capable of fetching the data from the database by "getbugProfiles".
    In the new class bugWatcherRefreshAction.java I have coded a part of code which actually clears the caching.Below I am giving the required part of the code:
    =============================================================
    public void doPerform(RunData rundata, Context context,String str) throws Exception {
    JetspeedRunData data = (JetspeedRunData) rundata;
    HttpServletRequest request = null;
    //PortletConfig pc = portlet.getPortletConfig();
    //String userId = request.getRemoteUser();
    /*String userId = ((JetspeedUser)rundata.getUser()).getUserName();//sraha on 1/4/05
    String pId = request.getParameter("PortletId");
    PortalLogger.logDebug("just after pId " +pId);  */
    //Calling the variable holding the value of portlet id from BugWatcherAction.java
    //We are getting the portlet id here , through a variable from BugWatcherAction.java
    /*BugWatcherPortletContent bgAct = new BugWatcherPortletContent();
    String portletID = bgAct.pId1;
    PortalLogger.logDebug("got the portlet ID in bugwatcherRefreshAction:---sraha"+portletID);*/
    // updating the bug groups
    Hashtable result = new Hashtable();
    try {
    request = data.getRequest();
    String userId = ((JetspeedUser)data.getUser()).getUserName();//sraha on 1/4/05
    //String pId = (String)request.getParameter("portletId");
    //String pId = pc.getPorletId();
    PortalLogger.logDebug("just after pId " +pId);
    PortalLogger.logDebug("after getting the pId-----sraha");
    result =BugWatcherAPI.getbugList(profileId, userId);
    PortalLogger.logDebug("select the new bug groups:: select is done ");
    context.put("SelectedbugGroups", profileId);
    //start clearing the cache
    ContentCacheContext cacheContext = getCacheContext(rundata);
    PortalLogger.logDebug("listBugWatcher Caching - removing markup content - before removecontent");
    // remove the markup content from cache.
    PortletContentCache.removeContent(cacheContext);
    PortalLogger.logDebug("listBugWatcher Caching-removing markup content - after removecontent");
    //remove the backend content from cache
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(((JetspeedUser)data.getUser()).getUserName()));
    PortalLogger.logDebug("listBugWatcher Caching User: " +((JetspeedUser)data.getUser()).getUserName());
    PortalLogger.logDebug("listBugWatcher Caching pId: " +pId);
    if (pdata != null)
    // User's data found in cache!
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null");
    pdata.removeObject(PortletCacheHelper.getUserPortletHandle(((JetspeedUser)data.getUser()).getUserName(),pId));
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null- after removeObject");
    PortalLogger.logDebug("listBugWatcher Caching -finish calling the remove content code");
    //end clearing the cache
    // after clearing the caching calling the data from the database taking a fn from the portletContent.java
    PortalLogger.logDebug("after clearing cache---sraha");
    BugWatcherPortletContent bugwatchportcont = new BugWatcherPortletContent();
    Hashtable httable= new Hashtable();
    httable=(Hashtable)bugwatchportcont.loadContent();
    PortalLogger.logDebug("after making the type casting-----sraha");
    Set storeKeySet = httable.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, httable.get(paramName));
    PortalLogger.logDebug("after calling the databs data from hashtable---sraha");
    } catch (CodedPortalException e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    catch (Exception e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.EXCEPTION_CODE));
    try {
    ((JetspeedRunData) data).setCustomized(null);
    if (((JetspeedRunData) data).getCustomized() == null)
    ActionLoader.getInstance().exec(data,"controls.EndCustomize");
    catch (Exception e)
    PortalLogger.logException("bugwatcherRefreshAction", e);
    ===============================================================
    In the bugwatcher Action there is another function called PostLoadContent.java
    here though i have found the portlet Id but unable to fetch that in the bugWatcherRefreshAction.java . I am also giving the code of that function under the bugWatcherAction.Java
    ================================================
    // Get the PortletData object from intermediate store.
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(
    //rundata.getRequest().getRemoteUser()));
    ((JetspeedUser)rundata.getUser()).getUserName()));
    pId1 = (String)portlet.getID();
    PortalLogger.logDebug("in the bugwatcher action:"+pId1);
    try {
    Hashtable htStore = null;
    // if PortletData is available in store, get current portlet's data from it.
    if (pdata != null) {
    htStore =(Hashtable) pdata.getObject(     PortletCacheHelper.getUserPortletHandle(
    ((JetspeedUser)rundata.getUser()).getUserName(),portlet.getID()));
    //Loop through the hashtable and put its elements in context
    Set storeKeySet = htStore.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, htStore.get(paramName));
    bugwatcherRefreshAction bRefAc = new bugwatcherRefreshAction();
    bRefAc.doPerform(pdata,context,pId1);
    =============================================================
    So this is the total scenario for the fetching the data , after clearing the cache and display that in the portal.I am unable to do that.Presently it is still fetching the data from the cache and it is not going to the database.Even the portlet Id is returning as null.
    I am unable to implement that thing.
    If you have any insight about this thing, that would be great .As it is very urgent a promt response will highly appreciated.Please send me any pointers or any issues for this I am unable to do that.
    Please let me know as early as possible.
    Thanks and regards,
    Santanu Raha.

    Have you run it in a debugger? That will show you exactly what is happening and why.

  • How can i change the class in the Class Library project to be static or public so i can use it from the windows application project ?

    First i know that when i make any changes to the class library project i need to rebuild the project then to remove the Capture.dll from the TestScreenshot project and then to add again the updated Capture.dll
    The problem for example in this case i'm trying to use a public static variable i add in the DXHookD3D9.
    In the DXHookD3D9 i added this public static variable:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    //using SlimDX.Direct3D9;
    using EasyHook;
    using System.Runtime.InteropServices;
    using System.IO;
    using System.Threading;
    using System.Drawing;
    using Capture.Interface;
    using SharpDX.Direct3D9;
    namespace Capture.Hook
    internal class DXHookD3D9: BaseDXHook
    public DXHookD3D9(CaptureInterface ssInterface)
    : base(ssInterface)
    LocalHook Direct3DDevice_EndSceneHook = null;
    LocalHook Direct3DDevice_ResetHook = null;
    LocalHook Direct3DDevice_PresentHook = null;
    LocalHook Direct3DDeviceEx_PresentExHook = null;
    object _lockRenderTarget = new object();
    Surface _renderTarget;
    public static decimal framesperhourtodisplay = 0;
    protected override string HookName
    get
    return "DXHookD3D9";
    List<IntPtr> id3dDeviceFunctionAddresses = new List<IntPtr>(
    framesperhourtodisplay
    The problem is i can't even get to the Capture.Hook namespace and not to the DXHookD3D9 from the TestScreenshot application window project.
    This is a screenshot:
    For example fro the FramesPerSecond class i can use it get to it from the windows forms application.
    namespace Capture.Hook
    /// <summary>
    /// Used to determine the FPS
    /// </summary>
    public class FramesPerSecond
    int _frames = 0;
    int _lastTickCount = 0;
    float _lastFrameRate = 0;
    Since it's public i guess.
    But if i will change the DXHookD3D9 class from internal to public:
    public class DXHookD3D9: BaseDXHook
    I will get error on the DXHookD3D9: 
    Error 1
    Inconsistent accessibility: base class 'Capture.Hook.BaseDXHook' is less accessible than class 'Capture.Hook.DXHookD3D9'
    And the BaseDXHook class:
    namespace Capture.Hook
    internal abstract class BaseDXHook: IDXHook
    protected readonly ClientCaptureInterfaceEventProxy InterfaceEventProxy = new ClientCaptureInterfaceEventProxy();
    public BaseDXHook(CaptureInterface ssInterface)
    this.Interface = ssInterface;
    this.Timer = new Stopwatch();
    this.Timer.Start();
    this.FPS = new FramesPerSecond();
    Interface.ScreenshotRequested += InterfaceEventProxy.ScreenshotRequestedProxyHandler;
    Interface.DisplayText += InterfaceEventProxy.DisplayTextProxyHandler;
    InterfaceEventProxy.ScreenshotRequested += new ScreenshotRequestedEvent(InterfaceEventProxy_ScreenshotRequested);
    InterfaceEventProxy.DisplayText += new DisplayTextEvent(InterfaceEventProxy_DisplayText);
    ~BaseDXHook()
    Dispose(false);
    How can i solve it so i can use the variable framesperhourtodisplay in the DXHookD3D9 class with the TestScreenshot windows forms application ?

    Hi,
    I dont know if it will work here, since I dont know the complete structure, but the base call must be public, if the derived class is public, so the base class is at least as accessible as the derived class.
    Try make the base class public. (And maybe the base-class IDXHook of the base also...)
    Or use a different approach and make only the properties public that are needed to be public by adding an extra class...
    A structure could look like:(you need to create a class thats public in your dll and expose a property, and set this property in the internal class...)
    In the Accessing class (here Form1)
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    C c = new C();
    MessageBox.Show(B.F.ToString());
    and in the class Lib:
    internal class A
    public A()
    B.F = DateTime.Now.Millisecond;
    public class B
    public static int F { get; set; }
    public class C
    public C()
    A a = new A();
    (add a referenc to the class lib from the accessing project)
    Regards,
      Thorsten

  • Flex RPC mapping Java nested classes to ActionScript classes

    We are calling a Java method in our project using
    RemoteObject the value returned by the java method is a ArrayList
    containing instances of a class say ParentClass with some nested
    classes.
    The structure of ParentClass(Java) is something like this
    class ParentClass {
    //some primitives
    private ChildClassA childAInstance;
    private ChildClassB childBInstance;
    //getters setters
    We have created similar class structure on the ActionScript
    side, the ActionScript classes(ParentClass,ChildClassA
    ,ChildClassB) have been properly annotated with the [RemoteClass]
    metadata tag,
    The problem is that though i'm getting the primitive data
    members of the ParentClass through RPC in my corresponding AS
    ParentClass class i'm getting an runtime exception trying to access
    ChildClassA,ChildClassB members.
    Am i missing something, exactly the same scenario is
    mentioned in this article
    http://www.adobe.com/devnet/flex/articles/complex_data.html
    But the Object.registerClass method mentioned in the tutorial
    is giving me compilation error, the sample code attached with the
    article is corrupt zip too.
    Please help me out on this

    JAXB will create classes from an XML schema, SAX is a parser library and JAXP is a library of XML a bunch of XML tools.
    I don't care for JAXB too much. I would skip it and go right to the JAX-RPC spec (WebServices).

  • How to call derived class to base class

    Hello everybody,
    I create a GUi application in java swing. Now i want to navigate between the screen but the timing between the screen is very slow bcoz i imported the class from package to another package. Now i want to extends one package to another package to reduce the navigation time but it saying error bcoz i cant able to call my derived class to base class. if anyone know the answer for this please answer this immediately.
    If any other method is there to optimise the navigation time please tell me
    by
    (kamal)

    Sorry, I've got major difficulties understanding your query:
    I create a GUi application in java
    ication in java swing. ok
    Now i want to navigate between
    the screenwhat? switch screens? display a different dialog?
    but the timing between the screen is very
    slowtiming? do you mean the time it takes to display a different dialog?
    bcoz i imported the class from package to
    another package.how did you come to the conclusion that that is the reason for the slowness? Did you do any profiling or is this just guess-work?

  • How to add objects to panel in one class from another class

    Hi this is what i am trying to do. I have a drag and adrop tool working where the users and select objects on a small panel and drag them to another panel called the tpan. What i want to do is create another class, which creates objects and now i want to display these objects on the tpan. So say i have a class DisplayTpan(), this class is used to display the objects which have been dragged from the small panel, and objects on this panel have mouselisteners attached, so that these objects can be moved around on the tpan. I have created another class called creatObj(), and from this class i want to add objects to the tpan. The DisplayTpan class extends a Jpanel, would this be he case for the CreateObj() class? In the CreateClass i have made a call to DisplayTpan t = new DisplayTPan();
    t.add(object);
    But this does not add the object to the panel, any ideas on how it should be done?
    Problem number two i have is say, I have two objects created on that oanel, i now want to draw a line t connect the two objects, this is just simply a call to the drawLine function but how would it be possible to add a ,mouselistener to that line, so it can be extended moved around etc? Any help much appreciated thanks.

    Try to convert the PL/SQL code from Forms trigger into a PL/SQL library(.PLL),
    and then attach that PLL in your forms.
    Note that all Forms objects should be referenced indirectly, for example,
    you have to rewrite
    :B1.DEPT_CODE := :B2.DEPT_CODE;
    :B3.TOTAL_AMOUNT := 100;
    ==>
    copy('B2.DEPT_NO','B1.DEPT_NO');
    copy('100','B3.TOTAL_AMOUNT');
    This is the best way to share PL/SQL code among Oracle Forms.

  • Accessing a variable defined in one class from another class..

    Greetings,
    I've only been programming in as3 for a couple months, and so far I've written several compositional classes that take MovieClips as inputs to handle behaviors and interactions in a simple game I'm creating. One problem I keep coming upon is that I'd love to access the custom variables I define within one class from another class. In the game I'm creating, Main.as is my document class, from which I invoke a class called 'Level1.as' which invokes all the other classes I've written.
    Below I've pasted my class 'DieLikeThePhishes'. For example, I would love to know the syntax for accessing the boolean variable 'phish1BeenHit' (line 31) from another class. I've tried the dot syntax you would use to access a MovieClip inside another MovieClip and it doesn't seem  to be working for me. Any ideas would be appreciated.  Thanks,
    - Jeremy
    package  jab.enemy
    import flash.display.MovieClip;
    import flash.events.Event;
    import jab.enemy.MissleDisappear;
    public class DieLikeThePhishes
    private var _clip2:MovieClip; // player
    private var _clip3:MovieClip; //phish1
    private var _clip4:MovieClip; //phish2
    private var _clip5:MovieClip; //phish3
    private var _clip6:MovieClip; //phish4
    private var _clip10:MovieClip; // background
    private var _clip11:MovieClip // missle1
    private var _clip12:MovieClip // missle2
    private var _clip13:MovieClip // missle3
    private var _clip14:MovieClip // missle4
    private var _clip15:MovieClip // missle5
    private var _clip16:MovieClip // missle6
    private var _clip17:MovieClip // missle7
    private var _clip18:MovieClip // missle8
    private var _clip19:MovieClip // missle9
    private var _clip20:MovieClip // missle10
    private var _clip21:MovieClip // missle11
    private var _clip22:MovieClip // missle12
    var ay1 = 0;var ay2 = 0;var ay3 = 0;var ay4 = 0;
    var vy1 = 0;var vy2 = 0;var vy3 = 0;var vy4 = 0;
    var phish1BeenHit:Boolean = false;var phish2BeenHit:Boolean = false;
    var phish3BeenHit:Boolean = false;var phish4BeenHit:Boolean = false;
    public function DieLikeThePhishes(clip2:MovieClip,clip3:MovieClip,clip4:MovieClip,clip5:MovieClip,clip6:M ovieClip,clip10:MovieClip,clip11:MovieClip,clip12:MovieClip,clip13:MovieClip,clip14:MovieC lip,clip15:MovieClip,clip16:MovieClip,clip17:MovieClip,clip18:MovieClip,clip19:MovieClip,c lip20:MovieClip,clip21:MovieClip,clip22:MovieClip)
    _clip2 = clip2;_clip3 = clip3;_clip4 = clip4;_clip5 = clip5;_clip6 = clip6;
    _clip10 = clip10;_clip11 = clip11;_clip12 = clip12;_clip13 = clip13;_clip14 = clip14;
    _clip15 = clip15;_clip16 = clip16;_clip17 = clip17;_clip18 = clip18;_clip19 = clip19;
    _clip20 = clip20;_clip21 = clip21;_clip22= clip22;
    _clip3.stage.addEventListener(Event.ENTER_FRAME, onEnterFrame)
    function onEnterFrame(event:Event):void
    vy1+= ay1;_clip3.y += vy1; vy2+= ay2;_clip4.y += vy2;
    vy3+= ay3;_clip5.y += vy3; vy4+= ay4;_clip6.y += vy4;
    if (phish1BeenHit ==false)
    if(_clip3.y >620)
    {_clip3.y = 620;}
    if (phish2BeenHit ==false)
    if(_clip4.y >620)
    {_clip4.y = 620;}
    if (phish3BeenHit ==false)
    if(_clip5.y >620)
    {_clip5.y = 620;}
    if (phish4BeenHit ==false)
    if(_clip6.y >620)
    {_clip6.y = 620;}
    if (_clip11.hitTestObject(_clip3) ||_clip12.hitTestObject(_clip3)||_clip13.hitTestObject(_clip3)||_clip14.hitTestObject(_cl ip3)||_clip15.hitTestObject(_clip3)||_clip16.hitTestObject(_clip3)||_clip17.hitTestObject( _clip3)||_clip18.hitTestObject(_clip3)||_clip19.hitTestObject(_clip3)||_clip20.hitTestObje ct(_clip3)||_clip21.hitTestObject(_clip3)||_clip22.hitTestObject(_clip3))
    _clip3.scaleY = -Math.abs(_clip3.scaleY);
    _clip3.alpha = 0.4;
    ay1 = 3
    vy1= -2;
    phish1BeenHit = true;
    if (_clip11.hitTestObject(_clip4) ||_clip12.hitTestObject(_clip4)||_clip13.hitTestObject(_clip4)||_clip14.hitTestObject(_cl ip4)||_clip15.hitTestObject(_clip4)||_clip16.hitTestObject(_clip4)||_clip17.hitTestObject( _clip4)||_clip18.hitTestObject(_clip4)||_clip19.hitTestObject(_clip4)||_clip20.hitTestObje ct(_clip4)||_clip21.hitTestObject(_clip4)||_clip22.hitTestObject(_clip4))
    _clip4.scaleY = -Math.abs(_clip4.scaleY);
    _clip4.alpha = 0.4;
    ay2 = 3
    vy2= -2;
    phish2BeenHit = true;
    if (_clip11.hitTestObject(_clip5) ||_clip12.hitTestObject(_clip5)||_clip13.hitTestObject(_clip5)||_clip14.hitTestObject(_cl ip5)||_clip15.hitTestObject(_clip5)||_clip16.hitTestObject(_clip5)||_clip17.hitTestObject( _clip5)||_clip18.hitTestObject(_clip5)||_clip19.hitTestObject(_clip5)||_clip20.hitTestObje ct(_clip5)||_clip21.hitTestObject(_clip5)||_clip22.hitTestObject(_clip5))
    _clip5.scaleY = -Math.abs(_clip5.scaleY);
    _clip5.alpha = 0.4;
    ay3 = 3
    vy3= -2;
    phish3BeenHit = true;
    if (_clip11.hitTestObject(_clip6) ||_clip12.hitTestObject(_clip6)||_clip13.hitTestObject(_clip6)||_clip14.hitTestObject(_cl ip6)||_clip15.hitTestObject(_clip6)||_clip16.hitTestObject(_clip6)||_clip17.hitTestObject( _clip6)||_clip18.hitTestObject(_clip6)||_clip19.hitTestObject(_clip6)||_clip20.hitTestObje ct(_clip6)||_clip21.hitTestObject(_clip6)||_clip22.hitTestObject(_clip6))
    _clip6.scaleY = -Math.abs(_clip6.scaleY);
    _clip6.alpha = 0.4;
    ay4 = 3
    vy4= -2;
    phish4BeenHit = true;
    if (_clip3.y > 10000)
    _clip3.x = 1000 +3000*Math.random()-_clip10.x;
    _clip3.y = 300;
    _clip3.alpha = 1;
    _clip3.scaleY = Math.abs(_clip3.scaleY);
    ay1 = vy1 = 0;
    phish1BeenHit = false;
    if (_clip4.y > 10000)
    _clip4.x = 1000 +3000*Math.random()-_clip10.x;
    _clip4.y = 300;
    _clip4.alpha = 1;
    _clip4.scaleY = Math.abs(_clip4.scaleY);
    ay2 = vy2 = 0;
    phish2BeenHit = false;
    if (_clip5.y > 10000)
    _clip5.x = 1000 +3000*Math.random()-_clip10.x;
    _clip5.y = 300;
    _clip5.alpha = 1;
    _clip5.scaleY = Math.abs(_clip5.scaleY);
    ay3 = vy3 = 0;
    phish3BeenHit = false;
    if (_clip6.y > 10000)
    _clip6.x = 1000 +3000*Math.random()-_clip10.x;
    _clip6.y = 300;
    _clip6.alpha = 1;
    _clip6.scaleY = Math.abs(_clip6.scaleY);
    ay4 = vy4 = 0;
    phish4BeenHit = false;
    var missleDisappear1 = new MissleDisappear(_clip11,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear2 = new MissleDisappear(_clip12,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear3 = new MissleDisappear(_clip13,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear4 = new MissleDisappear(_clip14,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear5 = new MissleDisappear(_clip15,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear6 = new MissleDisappear(_clip16,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear7 = new MissleDisappear(_clip17,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear8 = new MissleDisappear(_clip18,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear9 = new MissleDisappear(_clip19,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear10 = new MissleDisappear(_clip20,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear11 = new MissleDisappear(_clip21,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear12 = new MissleDisappear(_clip22,_clip3,_clip4,_clip5,_clip6,_clip10);

    I would approach it in much the same way as you would in java, by making getters and setters for all of your class variables.
    Getters being for returning the values, Setters being for setting them.
    So you would make a get function for the variable you want to access ala:
    function get1PhishBeenHit():boolean {
         return this.phish1BeenHit;
    Then to access the value of that variable from outwith the class:
    var result:boolean = ClassInstanceName.get1PhishBeenHit();

  • Setting native code from a class of a class passed in...

    I hope this makes sense, and its probably a stupid question but here it goes.
    I have a native function that takes in a java class. I can call the getters of this class from the native code to get values to fill out my c structure just fine, but conceptually I am not 100% how to call the getters of a class that is part of the other class I passed in. Basically i have something like this:
    the java call to the native being:
    public native void setJSource(JSource theSource);
    JNIEXPORT void JNICALL Java_AbfaRegion_setJSource
      (JNIEnv *env, jobject thisObj, jobject someVarsObj)
              jclass clazz;
              jmethodID mid;
              jint val;
              clazz = (*env)->GetObjectClass(env,someVarsObj);
              mid = (*env)->GetMethodID(env,clazz, "GetHeight", "I");
              val = (*env)->CallIntMethod(env,someVarsObj, mid);
              //put val into my struct
              mid = (*env)->GetMethodID(env,clazz, "GetWidth", "I");
              val=(*env)->CallIntMethod(env,someVarsObj, mid);
              //put val into my struct
    }I know how to do this...but what if I had a class say:
    class myClass
        JSource theSource; //has its own getters and setters like GetHeight
        int someVal;
        double anotherVal;
        public native void setMyClass(myClass theClass)
        int GetSomeVal()
          return this.someVal;
        int GetAnotherVal()
          return this.anotherVal;
        void SetSomeVal(int iSomeVal) 
          this.someVal=iSomeVal;
        void SetAnotherVal(double dAnotherVal)
          this.anotherVal=dAnotherVal;
    }and then suppose in the native setMyClass I would like to get the height of the jsource of myclass, how can i do that in native code, do I have to use findclass or something?
    Thanks for any help here, sorry if its a dumb question..
    -Shane

    For any class whose methods you are going to call, you need to first get a reference to the "class" record. So if you have an outer class, and have looked up its class record, and called a getter, and been returned an object (phew!):
    You need to now look up the class for the inner object; you can then look up the the methods and call them.
    JNI supports two ways to look up class:
    FindClass, where the key argument is the fully-qualified class name.
    GetObjectClass, where the key argument is an object reference.

  • Authoring Tool "Inherit Class" vs "New Class" vs "Extended Class" Scenario Help

    Hi Community,
    I am currently creating the ground work needed to create Self Service Portal Request Offerings to be used by end users and then take that input and automate it with Orchestrator.
    I'm pretty comfortable with the overall process of how this is done, but I was hoping to get guidance from the community to make sure that I don't waste my time by editing my existing management pack incorrectly from the beginning.
    We currently have a Whole bunch of SR and IR Templates in a Management Pack - lets call it: "Company.Templates.MP" now what I want to do is edit this MP and add new List and String Properties to hold the responses provided from the
    Self Service Portal so that I can use a Runbook Activity to feed these responses into Orchestrator.
    Now what I have done is "Extended" the existing "Service Request" and "Incident" classes and created the new properties in each extended class. Now that I have Extended the default Classes I believe that the properties now apply
    to EVERY existing and new SR and IR.
    My question is... Do you think I have done this correctly?
    I have a gut feeling that I have done it wrong and I should revert my MP changes and then instead of extending the existing IR and SR Classes which affect all existing Work Items, I should create a new SR and IR class which would then be used to create new
    Templates which are then ONLY ones that contain the new properties that would be used for Runbook Automation.
    The feedback I receive will be VERY MUCHLY appreciated...

    Answering your implicit question in the title:
    Inherit is where you create a new class that has all the properties of the parent and then some new ones also, but people can still use the parent for regular work. This is for specialization, like say you want a new type of incident to
    cover firewall problems, and need new properties for the IP and Ports from the portal.
    Extended would be where you add properties to a class that make sense for all of those and all inheriting classes. say the client has a cost of IT tracking system where every Incident and Service Request needs to be assigned a cost of effort
    code, you would create two extensions for Incident and Service request, and point them at the same enum list. you wouldn't extend WorkItem, because changes, activities, released etc wouldn't use a simple cost estimate list value, and you wouldn't inherit off
    of SR and IR because all user requests should have this property, even if some of them are blank  
    New would be a class from scratch that inherits from Entity. This is hardly ever what you want to do, because even completely new things are either work items or config items, and should, where ever possible, inherit from one of those
    basil classes
    Now to your explicit question: No, i think you've done exactly what the situation called for. every SR should have this value, even if it is empty for the historical items.
    two side notes: 1) any item that refers to the base of an extension will continue to work as expected, but  2) Offerings are always the exception. The net of these two rule of thumb guidelines is that your existing templates should continue to work
    without modification, but you may have to recreate the offering before you can use the new property in a question.  
    AFAIK you cannot extend an abstract calls (ex. Work Item), but I could be wrong.
    http://codebeaver.blogspot.dk/

  • How to listen to user actions in child class from parent class?

    Hi,
    I have a basic custom class ChildCustomForm that include a JTextField. In order to know what user types, I add a listener to
    this textbox:
    textField.addKeyListener( new KeyAdapter()
                @Override
                public void keyPressed( final KeyEvent e )
                    //user typed something
                    userTyped = true;
             });Now I have another parent class that uses ChildCustomForm, and parent class has to know once user types, then set
    its own userTyped flag.
    My problem is: since I added listener in child class, I cannot get textfield and add listener again in parent class, so parent class will not be able to know as soon as user types (polling is not a good solution here).
    I am wondering if there is a way to do this?
    regards,

    jack_wns wrote:
    I have a basic custom class ChildCustomForm that include a JTextField. In order to know what user types, I add a listener to
    this textbox:You want to listen for input into the textbox, correct? This may take the form of keyboard input, or could be a paste-text event in which case your keylistener will miss it. I recommend that you look into a DocumentListener here so you will catch any changes, be they keyboard or cut or paste.
    My problem is: since I added listener in child class, I cannot get textfield and add listener again in parent class, so parent class will not be able to know as soon as user types (polling is not a good solution here).The observer pattern may work here.

  • Accessing Super Class of Super Class

    Consider the following classes
    Class A {
    print() {
    System.out.println("Class A Called");
    Class B extends A {
    print() {
    System.out.println("Class B Called");
    Class C extends B {
    print() {
    System.out.println("Class C Called");
    How can I call the print method of class A while working in class C ? Please state all possible solutions.
    Can it somehow be done using super ?

    RZP wrote:
    Consider the following classes
    Class A {
    print() {
    System.out.println("Class A Called");
    Class B extends A {
    print() {
    System.out.println("Class B Called");
    Class C extends B {
    print() {
    System.out.println("Class C Called");
    How can I call the print method of class A while working in class C ? Please state all possible solutions.
    Can it somehow be done using super ?Here is one possible solution.
    I really don't understand the ramifications of reflection... and am not familiar with OOP design... but reflection seems to enable a programmer to avoid OOP design principals as well as type-checking. While I like reflection, most of my readings suggest to rarely use it.
    public class Main {
      public static void main(String[] args) {
        try {
          new C(789).print();
        } catch(Exception e) { e.printStackTrace();  }
          static class A {
            protected A a;
            protected int id;
            public A(A a, Integer id) {
              this.a = a;
              this.id = id;
            public A(int id) { this.id = id; }
            public void print() {
              System.out.println("Class A called... from a " + a.getClass().getCanonicalName() + " using the original instance with id = " + a.id);
        static class B extends A {
          public B(A a, Integer id) { super(a, id);  }
          public B(int id) { super(id); }
          public void print() { System.out.println("Class B called...");   }
        static class C extends B {
            public C(A a, Integer id) { super(a, id); }
            public C(int id) { super(id); }
            public void print() {
                try {
                    System.out.println("Class C called...");
                    Object obj = getClass().getSuperclass().getSuperclass().getConstructor(A.class, Integer.class).newInstance(this, -111);
                    obj.getClass().getMethod("print", null).invoke(obj, null);
                } catch (Exception e) {
                    e.printStackTrace();
    }Anyway, I think that enables one to invoke overridden methods in super classes, regardless of how "high-up" they are in the class heirarchy (without having to use a new object to do it). Use that idea in an interview at your own risk but just not in interviews for the same position I am trying to get...
    Edited by: dpxqb on Apr 17, 2010 4:43 AM

Maybe you are looking for

  • What's the use of 'Saving'?

    Is there a way that I can just open up index file in iWeb, make a few changes (just add a few words even), save it, then just drag the "saved" index file in my ftp? And voilà? All this publishing over and over's giving me a headache. I'd just like to

  • ID password not accepted anymore (once worked)

    Good morning, I am kind of desperate...and I hope somebody is familiar with this problem. I have adobe reader 11 XI, the latest version. I am taking a trainingcourse at Learningtrain. They provide lessonmaterial with certificates / id only. I created

  • Program Won't Start Up

    a few days ago i went to start a program from my dock and accidently hit my limewire program, which i didn't want to start. the icon began to bounce so i right clicked on it and hit 'force quit'. the program didn't start so i thought everything was o

  • Help! Can't find photos on backup drive

    A while ago my Ibook died. I had everything backed up to an external drive. And I know the photos were there, now everytime I go to that drive all that I can see when I open the Iphoto library on the backup drive are the pictures that are in my curre

  • My new nano's screen is stuck and wont turn back round? how do i get it to turn back around?

    my new nano's screen is stuck and wont turn back round? how do i get it to turn back around?