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

Topparent.find(vGoToRecord) only accepts numeric values?

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

    Topparent.find(vGoToRecord) only accepts numeric values?

    I posted this question on another v9 thread I had found earlier. (no response)

    http://msgboard.alphasoftware.com/al...l=1#post597286

    Ironically, for the FORM.find() function/method to work, it seems that you have to pass this function a numeric value by using eval() even when the record you're looking for is indexed, auto-incremented, and designated as type C. ex: "00101" versus 101 - Where in effect you have to send the numeric value 101 to find record "00101" in order for FORM.find() to work.

    It appears that the FORM.find() method presumably searches all indexed fields, which is presumably both risky and inefficient/slow to use. And in doing so, it somehow magically converts all indexes to a numeric field type prior to searching for a match..... Actually, I wonder whether all .dbf indexes are somehow internally stored as numeric values (regardless of actual field type), which could explain why FORM.find(vGoToRecord) needs to be passed a numeric variable??????

    Is there a better function that allows you to explicitly specify the indexed field (in a form based on a set) you're trying to search.....
    (IE: lookup button on an invoice ~ I've found workarounds, but no single line function that can do this.)

    This is what I'm looking for. (It's obviously "pseudo-pseudo code", and won't work): topparent.find_by_key(key_name,key_type,key_value)???


    Maybe this is one of those situations where writing a function and storing it in the code library is the only solution....

    FUNCTION = apply a filter (query) based on an xdialog lookup, and then issue a FORM.show_all() after record is found, so all records in the form are still navigable.) ~ pseudo code: query one record and go to it, then remove all filters (query) without navigating off the record....
    Last edited by SNusa; 01-31-2012, 08:42 PM.
    Robert T. ~ "I enjoy manipulating data... just not my data."
    It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
    RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

    #2
    Re: Topparent.find(vGoToRecord) only accepts numeric values?

    Robert, I believe one can do a find by key with character string arguments. However, the sort sequence of the form must be set appropriately beforehand. The form level find by key method uses the current sort sequence of the form and expects the search key that's passed to the function to have the same data type as the field controlling the sort sequence of the form. If the form is sorted on a numeric field, a numeric data type is expected. If the form is sorted on a character field a character data type is expected.

    Take a look at this page from the helps.

    Comment


      #3
      Re: Topparent.find(vGoToRecord) only accepts numeric values?

      If you are getting the key value from somewhere else, and already know what it is, I typically use this syntax:

      say you searched invoices for a specific invoice, so you already know the invoice number and have it in a variable named invnum - like the number is "0001234" (character)

      and you have an index for the the parent table named "invoice_number"

      you can say
      parentform.index_set("invoice_number")
      parentform.find(invnum)

      note this script must know what the variable is, if you are getting it from somewhere else.
      Cole Custom Programming - Terrell, Texas
      972 524 8714
      [email protected]

      ____________________
      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

      Comment


        #4
        Re: Topparent.find(vGoToRecord) only accepts numeric values?

        parentform.index_set("Invoice_Nu")
        topparent.find(vc_invoice)

        Got it. Glad I asked... Thanks Tom & Martin!

        I was "testing stuff" using the Alpha invoice form. Apparently the index needs to be explicitly set. (I guess I was thrown off track when I noticed that adding eval() made it work (seemingly, and not invoke the debugger) without explicitly defining any index.) I had also expected the index was automatically / implicitly set due to the set's structure. (Not to mention the fact that the navigational controls are navigating sequentially without setting index.) ~ Note: The index can either be set using code as above, or set in the forms order expression properties.

        So many ways to do the same things in Alpha 1.) topparent.find(vc_invoice) 2.) Set filter/query and then use Form.Show_All() or 3.) use SuperControl..... (And to top things off, there are numerous different ways you can apply the index / sort order too! ~ very cool!)
        Robert T. ~ "I enjoy manipulating data... just not my data."
        It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
        RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

        Comment


          #5
          Re: Topparent.find(vGoToRecord) only accepts numeric values?

          Robert, I've found that a good way to get familiar with the help documentation is to use it. The wiki format is a bit off-putting. But I get better at finding things the more I try. In this case you would have found the answers explaining the behavior you were seeing if you had searched for form functions and methods. -- tom

          Comment


            #6
            Re: Topparent.find(vGoToRecord) only accepts numeric values?

            Thanks Tom. I had searched, but obviously didn't make the connection.

            The help file explicitly indicates (QUOTED FROM WIKI):

            You may want to use the <FORM>.INDEX_SET() or the <FORM>.QUICK_SORT() method first to set the sort order of the table.
            Which implies that specifying the .index_set() is optional. And when it worked by adding the eval() statement, that made matters even more confusing! (Not to mention that I had incorrectly presumed (because of this) the .FIND() method was searching all indexed fields anyways. ~in the order they were entered in the table definitions, because of the following way in which this particular method is displayed in the a5 GUI:

            NOTE: The X-basic explorer displays the FORM.find() function as follows: .find(* [findwhat] ) and I took the * literally as a wildcard!) ~ Hence the added confusion.
            Last edited by SNusa; 02-01-2012, 12:18 PM.
            Robert T. ~ "I enjoy manipulating data... just not my data."
            It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
            RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

            Comment


              #7
              Re: Topparent.find(vGoToRecord) only accepts numeric values?

              Robert, your criticism seems a bit unfair. You omitted the sentence immediately preceding the quoted passage. The entire passage reads:

              The search key is determined by the current sort order. You may want to use the <FORM>.INDEX_SET() or the <FORM>.QUICK_SORT() method first to set the sort order of the table.
              In any event you might want to drop Martin Heller a message with suggested language improvements so that the ambiguity that tripped you up is removed for others.

              Thanks.

              -- tom

              Comment


                #8
                Re: Topparent.find(vGoToRecord) only accepts numeric values?

                Originally posted by Tom Cone Jr View Post
                ...Robert, your criticism seems a bit unfair...
                Tom - No criticism here. And you're probably right. (It's just the way I personally interpreted the wiki help page.)
                As I stated, i thought the sort order was already defined, since you can use the record navigation toolbar (in the Alpha Sports Invoice) to move through records. (And I just happened to be using the invoice number field in combination with the .find() method.)

                What I still find strange is this: In this particular case, (using Alpha Sports Invoice form)..... ~ Why do you think that enclosing the character field in the eval() function enabled the .find() method work properly and find/navigate to the correct invoice without manually setting the index?

                ie: using topparent.find(eval(vc_invoice)) was a workaround (that actually worked) when I failed to first set the index using <FORM>.index_set()


                I attribute most of this to my "ignorance." And understanding the reasons as to why my "wrongful workaround" actually worked, just might provide me with additional insight as to how a5 works!
                Last edited by SNusa; 02-01-2012, 02:33 PM.
                Robert T. ~ "I enjoy manipulating data... just not my data."
                It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
                RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

                Comment

                Working...
                X