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

tbl.record_content_get() and child table

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

    tbl.record_content_get() and child table

    I have looked for this and have not found something to confirm my suspicion.

    I am trying to convert to using <tbl>.record_content_get() when I believe it can be used. The docs state this is usable for when a table is open. I am calling a script from a form based on a parent-child set trying to acquire a crlf() list of one of the child table fields.

    Code:
    'get pointer to art_lbr table and acquire the description into crlf() list
    	dim tbl as p
    	tbl=table.get("art_lbr")
    	
    	dim v_list as C=""
    	v_list=tbl.record_content_get("art_descr","art_id",".t.")
    I get an "Invalid relation type" error (attached). I am going to assume this means that the docs are not quite accurate and only a parent table is available. If this is correct, if anyone has Alpha's ear, maybe a word to them to clarify their documentations might be helpful.
    Attached Files
    John Michaels
    "The only thing needed for evil to flourish is for good men to do nothing" - great quote but probably not Sir Edmund Burke

    #2
    Re: tbl.record_content_get() and child table

    John,

    I don't have first hand experience with this method, but your code establishes a pointer to the filtered view of the child table in your set based form. However, you're using a method that is expecting the pointer to reference an unfiltered view of the child table. I'm guessing this causes the conflict.

    Stated differently, the field values you are seeking are not in scope, since the entire list would include field values from records NOT linked to the current parent table record. Your table pointer references the specific instance of the child table supporting the form, so only the linked records displayed in your form are available to that pointer.

    Comment


      #3
      Re: tbl.record_content_get() and child table

      Thanks Tom,
      Great explanation. Now how do we get that in the Alpha docs! I know you have a fabulous entry which I reference ALL THE TIME! with the tablecount() documentation.

      Secondly, I experience another .... oddity... I didn't expect. When I made a new set reversed so the child became the parent and ran the script, I got output, but it has one parent listing for every linked child record. So if I place only to look at recno(), I get as many lines for that parent recno() as there are child links. Who would have guessed? The documents need help. I'm shying away from this call from sets.
      John Michaels
      "The only thing needed for evil to flourish is for good men to do nothing" - great quote but probably not Sir Edmund Burke

      Comment


        #4
        Re: tbl.record_content_get() and child table

        Originally posted by john michaels View Post
        I have looked for this and have not found something to confirm my suspicion.

        I am trying to convert to using <tbl>.record_content_get() when I believe it can be used. The docs state this is usable for when a table is open. I am calling a script from a form based on a parent-child set trying to acquire a crlf() list of one of the child table fields.

        Code:
        'get pointer to art_lbr table and acquire the description into crlf() list
        	dim tbl as p
        	tbl=table.get("art_lbr")
        	
        	dim v_list as C=""
        	v_list=tbl.record_content_get("art_descr","art_id",".t.")
        I get an "Invalid relation type" error (attached). .
        There are couple of errors in your code:
        1-The first one, is not really an error, but rather a waste of bits and bites:
        You dimmed tbl as p and used it as a pointer to the table but did nothing with it, at least in the code you provided.
        If you wanted to use it, then you would say:
        Code:
        dim tbl as p
        	tbl=table.get("art_lbr") 'better use table.open()	
        	dim v_list as C=""
        	v_list=tbl.record_content_get([B][COLOR="#B22222"][SIZE=3]tbl[/SIZE][/COLOR][/B],"art_id",".t.")
        2-The second, and the reason why you received an error from alpha, is you omitted one of the parameter of the table.record_content_get() method.
        and that parameter is the order. alpha will read the order as ".t." when you meant that for the filter.
        The proper syntax would be:
        v_list=tbl.record_content_get("art_descr","art_id","put the field you want to order with here",".t.")
        If you want to use recno() for order, just put "" for order.
        Incidentally, this method is superior to any other means of getting filtered record from a table. I use it as a matter of routine.

        Comment


          #5
          Re: tbl.record_content_get() and child table

          Record_List as C = <TBL>.RECORD_CONTENT_GET( Expression as C [, Order as C [, Filter as C ]]] )

          String as C = TABLE.EXTERNAL_RECORD_CONTENT_GET( Table_Name as C, Content_Expn as C [, Order_Expn as C [, Filter_Expn as C ]] )

          Comment


            #6
            Re: tbl.record_content_get() and child table

            Gabriel,
            Yes I see what you mean. except the pointer is not supposed to be a parameter as James points out. And this is supposed to be faster for already open tables, such the use of table.get() to point to the open table. Otherwise I'd just use the tried and true, no problems, tercg(), among my most used method. I've played with this a bit, with correct parameters. It's a problematic method. Not going to use it.
            John Michaels
            "The only thing needed for evil to flourish is for good men to do nothing" - great quote but probably not Sir Edmund Burke

            Comment


              #7
              Re: tbl.record_content_get() and child table

              John,

              I can run the trcg() on many a child table and I do not get the error message you're getting. I do however get some very peculiar results in
              some cases. (One is where the child table has 14 records in it and the trcg() returns a line_count of 101. The linked browse shows 1 record) In any case if a table open is issued before the trcg() the correct results are returned. Every time... Problematic is a mild term here.

              Comment


                #8
                Re: tbl.record_content_get() and child table

                Contrary to common belief and contrary to logic, table.open() is faster than table.get().
                The child table here is not open as a child table but both the parent and the child are open as a composite table, that you do not see. Hence the difference in the number of records returned when this method is used vs using tercg().
                Last edited by G Gabriel; 11-23-2013, 07:47 AM.

                Comment


                  #9
                  Re: tbl.record_content_get() and child table

                  Interesting. Especially when the parent has 8 records and the child has 14 and the line_count gives 101. All of which are the same value. Only the first one even being the correct value, all other being repeats of the first value, but then you didn't bother to ask any specifics before you offered your 'explanation'....just as in your extraneous 'pre-edited,' rambling post you failed to notice in John's first and second post (and what was implied by posting the exerts from the help manual) that trcg() <> tercg(). "that you do not see."
                  Out of curiosity, and for the sake of brevity could you post just the code that shows "table.open() is faster than table.get()." I realize that there is almost a unlimited number of "scenarios" (forms open, field rules, table size, etc.) that could exist, and possibly affect timing but I would be interested in your particular analysis.

                  Comment

                  Working...
                  X