Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

<OBJECT>.TABLE_GET() Error

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

    <OBJECT>.TABLE_GET() Error

    Can anyone see why this would produce an error? The second line produces a message box with this error;

    Script:OnPush line: 7
    dim tblp as p = fldp.table_get()
    Object does not support requested interface.
    I am just trying to get a pointer to the table of a given field on a form. I cannot use table.current(), table.get() or table.open() for technical reasons, but according to the help file, this should work. What the help file says is at the bottom. Any ideas?

    Code:
    dim fldp as p = :Entities:CUSTSYSFRECID.this
    dim tblp as p = fldp.table_get()
    msgbox("Test","The name of the table is: " + tblp.name_get(),UI_OK)
    ===================================================================

    <OBJECT>.TABLE_GET()

    Syntax

    <TBL> as P = <OBJECT>.TABLE_GET()

    Description

    The <OBJECT>.TABLE_GET() method applies to:

    *

    Browses (for <OBJECT> use either the <BROWSE> pointer or the name of the browse)
    *

    Browse Columns (for <OBJECT> use the address of the column or a pointer to the column)
    *

    Forms (for <OBJECT> use either the <FORM> pointer or the name of the form)
    *

    Form Controls (for <OBJECT> use the address of the control or a pointer to the control)
    *

    Fields (for <OBJECT> use a pointer to the field)

    The <OBJECT>.TABLE_GET() method returns the <TBL> object pointer to the table that contains the data referenced by the <OBJECT> object pointer.

    Supported By

    Alpha Five Version 5 and Above

    Limitations

    Desktop applications only.
    - Dan Hooley
    - Custom Desktop or Web database development -

    #2
    Re: &lt;OBJECT&gt;.TABLE_GET() Error

    Are you sure you're using object names in the current layout, as opposed to table and fieldnames?

    Comment


      #3
      Re: &lt;OBJECT&gt;.TABLE_GET() Error

      Yes, the code is attached to a button on the form.

      You can put this code in a button on one of your forms, and change the first line to your form name and field name, to see what I am talking about.

      Code:
      dim fldp as p = :<formname>:<fieldname>.this
      dim tblp as p = fldp.table_get()
      msgbox("Test","The name of the table is: " + tblp.name_get(),UI_OK)
      - Dan Hooley
      - Custom Desktop or Web database development -

      Comment


        #4
        Re: &lt;OBJECT&gt;.TABLE_GET() Error

        Dan, I'm seeing the same thing here, in both vers 9 and 10. Perhaps the issue is that you're using a method designed for pointers to the fields in the table supporting your form with pointers to objects in the form. Notice that in the help file example discussing <object>.table_get() they establish a pointer to the table field, not the field object in the layout, with the following code:

        fld = tbl.first_name.this

        Your "field pointer" is really a pointer to an object in the layout, instead of a pointer to a field in an open table. I'm thinking this may explain what you're seeing.

        Comment


          #5
          Re: &lt;OBJECT&gt;.TABLE_GET() Error

          Dan, for objects that are bound to table fields it seems that the table name is stored in a property of the layout object. I wonder if something like this would meet your needs:

          Code:
          dim fldp as P
          fldp = :YourFormName:YourfieldName.this  'get pointer to field object in layout
          
          dim tblC as C
          tblC = word(fldP.entry.name,1,"->")  'retrieve tablename from entry property
          
          msgbox("Source Table Name",tblC)

          Comment


            #6
            Re: &lt;OBJECT&gt;.TABLE_GET() Error

            Tom, thanks for confirming this.

            That's interesting, I did't know about the entry property.

            But what I am really after is a pointer to the underlying table, not just the name of the table. I was only using name for testing.

            And yes, I had noticed that the example used a table field, but here is what the help says:

            Form Controls (for use the address of the control or a pointer to the control)
            Wouldn't you take from that that you could establish a pointer to the control on a form and then using that pointer, get a pointer to the underlying table? Or am I reading something wrong?
            - Dan Hooley
            - Custom Desktop or Web database development -

            Comment


              #7
              Re: &lt;OBJECT&gt;.TABLE_GET() Error

              Yes, I think either the docs are misleading (wrong) or the method is not working and should be reported as a bug.

              Having said that it's easy to use the entry property of the field object to get a pointer to the table. Won't something like this get you there?

              Code:
              dim fldp as P
              fldp = :YourFormName:YourfieldName.this  'get pointer to field object in layout
              
              dim tblC as C
              tblC = word(fldP.entry.name,1,"->")  'retrieve tablename from entry property
              
              dim tblp as P
              tblp = table.get(tblC)

              Comment


                #8
                Re: &lt;OBJECT&gt;.TABLE_GET() Error

                I don't think that will work in my situation, but will check it out for sure.

                I don't know if I can explain this clearly or not. It would work if I was calling it from within the form that has the table I want, as in the example I posted, as would just plain table.get(tablename).

                But I am wanting a method of pointing to a specific instance of an open child table in one form from another form. And both forms have some of the same table names, but in different directories. So table.get() points to the wrong instance depending on which form I call it from. I can get a pointer to the correct form and a pointer to a control on the correct form, but I need a pointer to the correct child table of the form. As in: form pointer->control pointer->table pointer.

                Or is there another way to get a pointer to a specific instance of a table in a form, from outside the form?
                - Dan Hooley
                - Custom Desktop or Web database development -

                Comment


                  #9
                  Re: &lt;OBJECT&gt;.TABLE_GET() Error

                  Why all the open forms? Wouldn't it be easier to open the data sources you need without using forms?

                  Comment


                    #10
                    Re: &lt;OBJECT&gt;.TABLE_GET() Error

                    Because the user will be interacting with the forms and the program will be coping data from one form to the other, etc.
                    - Dan Hooley
                    - Custom Desktop or Web database development -

                    Comment


                      #11
                      Re: &lt;OBJECT&gt;.TABLE_GET() Error

                      Tom, (and anyone else interested)

                      Well, I think I found a solution.

                      I put a hidden button on the form that has the tables that I want, and then just "push" that button remotely from the other form, as in; <formname>.<buttonname>.push(). That way the code is called locally and always looks at the correct instance of the table(s). It's working so far, but if anyone has a better idea, please let me know.

                      Thanks for your help.
                      Dan
                      - Dan Hooley
                      - Custom Desktop or Web database development -

                      Comment


                        #12
                        Re: &lt;OBJECT&gt;.TABLE_GET() Error

                        Try this:

                        <form_name>:tables:<table_name>.<fieldname or this>

                        That should give you pointers to the specific session for the specified <form_name>.

                        These examples are from my Interactive Window. My "Menu_main" form is based on a table named "menus" and has one field named "junk" that contains the value "j". (If there isn't at least one record in the table, then every time you open the form, the form will go into Enter mode. I haven't seen any problem with that - I just don't like the concept so I make sure there is always one record in the table even though it's just "junk".)

                        ?Menu_main:tables:menus.junk
                        = "j"

                        DIM tp as P
                        tp = Menu_main:tables:menus.this
                        ?tp.junk
                        = "j"

                        Comment

                        Working...
                        X