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

Subelement Not Found

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

    Subelement Not Found

    Geez, another oddity and I can't get 'round it. Has anyone run into this?:

    Got a bunch of code that's typical:

    Code:
    t = table.open("mytable")
    t.dothis
    t.dothat
    .....
    ExistKey = t.order_id
    When the script runs, it works just fine until it hits the t.order_id and pops an error message that t.order_id subelement not found. The field exists, it's spelled correctly etc. etc. Another odd point about this is that sometimes (often) it doesn't show up in the autocomplete list when entering Xbasic code to refer to it.
    -Steve
    sigpic

    #2
    Hey Steve,

    I have had the same stuff happen to me, but it was usually something silly like closing the table too soon or mis-spelling, ect. ...

    Also, if I remember, I got that error once when the data types were different.

    Anyway, go take a walk or something and I bet you find it when you come back.

    See you in June.

    Scott

    Comment


      #3
      Anyway, go take a walk or something and I bet you find it when you come back.
      Took a walk yesterday. Slept on it last night. Tried more today. Still no joy.
      -Steve
      sigpic

      Comment


        #4
        Steve,

        I wonder if the field name is being interpreted as a reserved word somehow? Do you get the same error if the fieldname is changed ?

        -- tom

        Comment


          #5
          I'd have to do a fair amount of re-writing upstream to try this. I don't think this is the issue as I can write other scripts that use the field just fine. This, from interactive just now:

          Code:
          t = table.open("internet_orders")
          ?t.ORDER_ID
          = "650        "
          
          t.fetch_next()
          ?t.ORDER_ID
          = "651        "
          I dunno why the original problem scirpt (600 lines long so rewriting is out) doesn't "see" the field when I'm picking sublements of the pointer or why it otherwise seems to see the all the other subelements just fine.

          I tried saving the script as another script thinking a bit of corruption. No difference.

          I've deleted and re-written that portion of the script. No difference.

          I've tried other tacts to use the value of the field but no matter how I reference it, I get the error.
          -Steve
          sigpic

          Comment


            #6
            I think Tom meant ExistKey is being interpreted as a reserved word somehow.

            What happens when you debug it? Do you get a value for t.ORDER_ID before the line ExistKey = t.order_id?

            That might help tell you where your problem is.

            Comment


              #7
              Tried this before the offending line of code:

              Code:
              ui_msg_box("tOrders.order_ID", tOrders.order_id)
              tOrders.order_id subelement not found

              It's not the variable -- it's the reference to the field.
              -Steve
              sigpic

              Comment


                #8
                Steve,

                Was that a typo or something?

                You went from t.order_id to torders.order_id

                Is your table pointer t or torders?

                Comment


                  #9
                  The example I gave was from Interactive. The "real" code uses tOrders. And, just in case it gets you wondering, here's tOrders as the pointer in Interactive:

                  Code:
                  tOrders = table.open("internet_orders")
                  ?tOrders.ORDER_ID
                  = "628        "
                  
                  tOrders.fetch_next()
                  ?tOrders.ORDER_ID
                  = "631        "
                  And, in a brand new script, this worked as expected:

                  Code:
                  torders = table.open("internet_orders")
                  ui_msg_box("", torders.Order_id)
                  torders.fetch_next()
                  ui_msg_box("", torders.order_id)
                  tOrders.close()
                  Finally, here's more of the existing code:

                  Code:
                  tOrders = table.open("internet_orders", file_rw_shared)
                  query.filter = "swept = {}"
                  query.order = "order_id"
                  ndx = tOrders.query_create()
                  count = ndx.records_get()
                  tOrders.fetch_first()
                  i = 1
                  
                  while .not. tOrders.fetch_eof()
                  
                  ' Existing Order?
                  ExistKey = tOrders.Order_id   <<<-- error occurs here
                  -Steve
                  sigpic

                  Comment


                    #10
                    And ExistKey is declared how? Is it still in scope when the offending line is reached?

                    -- tom

                    Comment


                      #11
                      Originally posted by Tom Cone Jr
                      And ExistKey is declared how? Is it still in scope when the offending line is reached?

                      -- tom
                      Currently dimmed implicitly. I've tried dimming it explicitly but no difference. And see my response to Scott below -- even when I try to reference the field with some other function, such as ui_msg_box() I get the error.
                      -Steve
                      sigpic

                      Comment


                        #12
                        Hummmm ... here's a shot in the dark, but I have seen this happen too.

                        See what happens if you change your query.order to something other then order_id.

                        Like I said, it's a shot in the dark, but who knows

                        Comment


                          #13
                          Steve, and remember to set the query.options value explicitly. You may be picking up trash from earlier testing...

                          -- tom

                          Comment


                            #14
                            Changing the query.order had no effect.

                            Specifying the query.options had no effect.

                            7 hrs on this so far plus you guys' time. Dunno, dunno.

                            ....bit later...:

                            Just got weirder:

                            I put a reference to a different field in a ui_msg_box() just before the offending line:

                            Code:
                            ui_msg_box("", tOrders.Product_id)
                            Got the subelement not found, even though it's a different field.
                            Last edited by Steve Workings; 05-03-2006, 01:13 PM.
                            -Steve
                            sigpic

                            Comment


                              #15
                              Steve, since we can't see your script (and don't really really want to), we're guessing and guessing. Here are some more ideas. The errors you're seeing could be caused by the pointer to the table ("tOrders") being trashed or released by some other part of your script, or by a timing issue which prevents the script from accessing the table cause it's still "in use" when this line of the script is executed. If it were me, I'd insert a flock of xbasic_wait_for_idle() statements every where disk activity is occurring. I'd also make certain that I'm not using the same pointer name for different purposes elsewhere in my script.

                              -- tom

                              Comment

                              Working...
                              X