Announcement

Collapse
No announcement yet.

Problem With Retrieving Inner Object: Syntax Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem With Retrieving Inner Object: Syntax Error

    This is going to get interesting, at least as I attempt to describe what the heck I'm doing here. I have an Outter Object Class, it contains all the information handling for managing the Main parameters for the object's structure, in addition to managing an array of Inner Objects, however, to be fair, these are "Mid Level" objects. Each mid level object as all the code for managing the group's parameters, in addition to having "pass through" calls to the object array it manages. The final Inner Object is the actual data handler for the system. So, I have an array of objects, each would contain an array of objects. It looks really complex, but currently it looks like the best way to handle the data because the data is not linear in nature.

    One FoxClass contains array of FoxShapes.
    Each FoxShape contains an array of FoxFrames.

    For example, I can get a data element with:
    TYPE SET lVariable = FoxClass.FrameHeader(ShapeIndex, FrameIndex)

    In FoxClass, it validates the desired FoxShapes(ShapeIndex) is valid, and it returns:
    Code:
    PROPERTY GET FrameHeader(BYVAL ShapeIndex AS LONG, BYVAL FrameIndex AS LONG) AS FOXFRAMEHEADER
        LOCAL FrameReturn AS FOXFRAMEHEADER
        FrameReturn.ShapeFormat = -1
        IF ShapeIndex < FileHeader.NumShapes THEN _
            IF ISTRUE ISOBJECT(Shapes(ShapeIndex)) THEN _
                TYPE SET FrameReturn = Shapes(ShapeIndex).FrameHeader(FrameIndex)
        PROPERTY = FrameReturn
    END PROPERTY
    And likewise in the FoxShapes class, it gets the information from the FoxFrame:
    Code:
    PROPERTY GET FrameHeader(BYVAL FrameIndex AS LONG) AS FOXFRAMEHEADER
        LOCAL FrameReturn AS FOXFRAMEHEADER
        FrameReturn.ShapeFormat = -1
        IF FrameIndex <= UBOUND(Frames) THEN _
            IF ISTRUE ISOBJECT(Frames(FrameIndex)) THEN _
                TYPE SET FrameReturn = Frames(FrameIndex).FrameHeader
        PROPERTY = FrameReturn
    END PROPERTY
    And of course, all the FoxFrame class has to do is return the information:
    Code:
    PROPERTY GET FrameHeader() AS FOXFRAMEHEADER
        PROPERTY = FrameHeader
    END PROPERTY
    Now, my problem; I want to get the WHOLE FoxFrame object from the system:
    Code:
    ' in FoxClass
    PROPERTY GET FrameObject(BYVAL ShapeIndex AS LONG, BYVAL FrameIndex AS LONG) AS FOXFRAMEHANDLER
        IF ISTRUE ISOBJECT(Shapes(ShapeIndex)) THEN _
            PROPERTY = Shapes(ShapeIndex).FrameObject(FrameIndex)
    END PROPERTY
    
    ' in FoxShape
    PROPERTY GET FrameObject(BYVAL FrameIndex AS LONG) AS FOXFRAMEHANDLER
        IF FrameIndex <= UBOUND(Frames) THEN _
            PROPERTY = Frames(FrameIndex)
    END PROPERTY
    And the compiler gives me a syntax error:
    Code:
    Error 477 in C:\PROGRAM FILES\PATCH MAKER\FOXEDIT\FOXCLASS.BAS(201:046):  Syntax error
    Line 201:                 PROPERTY = Shapes(ShapeIndex).FrameObject(FrameIndex)
    
                    PROPERTY = Shapes(ShapeIndex).FrameObject(FrameIndex)
                                                 ^
    The caret (^) is where the compiler puts the cursor when it aborts, it's right between the ) and the period. So, what am I overlooking? Am I going to need to use a global variable to pass back my inner FoxFrame?
    Last edited by colin glenn; 17 Feb 2009, 08:43 AM. Reason: Pushed the wrong button, ...
    Furcadia, an interesting online MMORPG in which you can create and program your own content.

  • #2
    Originally posted by colin glenn View Post

    PROPERTY = Shapes(ShapeIndex).FrameObject(FrameIndex)
    ^[/code]The caret (^) is where the compiler puts the cursor when it aborts, it's right between the ) and the period. So, what am I overlooking? Am I going to need to use a global variable to pass back my inner FoxFrame?
    Can you assign it to a local variable, then assign to PROPERTY to that variable?

    Comment


    • #3
      Mod:
      Code:
      ' in FoxClass
      PROPERTY GET FrameObject(BYVAL ShapeIndex AS LONG, BYVAL FrameIndex AS LONG) AS FOXFRAMEHANDLER
          LOCAL pFrame AS FOXFRAMEHANDLER
          IF ISTRUE ISOBJECT(Shapes(ShapeIndex)) THEN _
              LET pFrame = Shapes(ShapeIndex).FrameObject(FrameIndex)
          PROPERTY = pFrame
      END PROPERTY
      
      ' in FoxShape
      PROPERTY GET FrameObject(BYVAL FrameIndex AS LONG) AS FOXFRAMEHANDLER
          LOCAL pFrame AS FOXFRAMEHANDLER
          IF FrameIndex <= UBOUND(Frames) THEN _
              LET pFrame = Frames(FrameIndex)
          PROPERTY = pFrame
      END PROPERTY
      
      ' compile sez:
      Error 477 in H:\PATCH MAKER\FOXEDIT\FOXCLASS.BAS(202:040):  Syntax error
      Line 202:         LET pFrame = Shapes(ShapeIndex).FrameObject(FrameIndex)
      And at the same spot.
      Furcadia, an interesting online MMORPG in which you can create and program your own content.

      Comment


      • #4
        Without seeing all the code it's hard to make a guess but it could be a compound access problem. Why not zip it all up and send it to support to make sure.

        Have you considered using a Dictionary object instead of arrays? There is code around here somewhere.

        James

        Comment


        • #5
          Compound access problem, that sounds interesting.

          I would say it's an issue of retrieving an object from an object within an object. If I code around it, (which, by the way would be just as effective in one function of the program), I can get the FoxShape object from the FoxClass, then fetch each FoxFrame from the FoxShape. This work around will be annoying in later parts of the program when the user can go from Frame to Frame without regards to the shape, to have to have the program perform such a dual access and needing to have an instance to each of the inner classes for any routine that needs to access the frame data seems a bit much.*

          It should be possible to do the wizardry of getting the inner object from the outer object so a zipping I go to support.

          Dunno about using a Dictionary object, there's a lot of elements to any Shape/Frame, some derived, some mandated, and it does have to be a tree by it's nature.

          * Not all cases will all the frame data need to be on hand for any actions conducted by the user, thinking about it overall, just 2 possible actions where I need the complete FoxFrame for deep manipulation of the data.
          Last edited by colin glenn; 17 Feb 2009, 03:55 PM. Reason: Clarification
          Furcadia, an interesting online MMORPG in which you can create and program your own content.

          Comment


          • #6
            PB's wonderful support team recommended this:
            Code:
            PROPERTY GET FrameObject(BYVAL ShapeIndex AS LONG, BYVAL FrameIndex AS LONG) AS FOXFRAMEHANDLER
                LOCAL FoxShape AS FOXSHAPEHANDLER
                IF ISTRUE ISOBJECT(Shapes(ShapeIndex)) THEN
                    LET FoxShape = Shapes(ShapeIndex)
                    PROPERTY = FoxShape.FrameObject(FrameIndex)
                END IF
            END PROPERTY
            And it compiles. So at this particular point I'm happy with the results and will leave the why it won't work straight forward alone.
            Furcadia, an interesting online MMORPG in which you can create and program your own content.

            Comment

            Working...
            X