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

Query options??

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

    #46
    Re: Query options??

    yes - both with and without the options

    Code:
    t1=table.open("patients")
    query.filter=""; query.order=""; query.options=""
    query.filter="left(lastname,1)='a' .or. left(lastname,1)='w' .or. left(lastname,1)='s' "
    query.order="lastname"
    query.options="T"
    dim shared uid as c
    idx=t1.query_create()
    msgbox("","" + idx.records_get())
    t1.fetch_first()
    while .not. t1.fetch_eof()
     uid=t1.Uniqueid
     temp=lookup("patients","uniqueid=" + quote(var->uid),"uniqueid")
     t1.fetch_next()
    end while
    msgbox("","" + query.filter)
    t1.close()
    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


      #47
      Re: Query options??

      Martin

      Back in Post 10, I gave Glenn a test zip that was similar to your code.

      Both the "T" option and the "X" option worked every time with the lookup on the same table (the only difference was that I only had 43 records in the table and in Glenn test he has over 5000 records of which 2244 will be in the loop.


      In Glenn's app, something is causing the query to be dropped. It may have something to do with the lookup or it could have something to do with the number of queries that are in his test app.

      I guess we will have to wait to see if Selwyn or someone replies to Glenn's Bug report.

      FWIW

      Tom Baker

      Comment


        #48
        Re: Query options??

        ok - here's another iteration, with a double loop and a tracer
        I tested it with query.options="X","T", and ""
        ran successfully in all cases

        Code:
        'Date Created: 03-Jun-2010 08:00:36 PM
        'Last Updated: 04-Jun-2010 01:41:39 PM
        'Created By  : martin cole
        'Updated By  : martin cole
        'this is a dummy script meant to reproduce a 
        'possible bug or issue where query slots are used by lookup() in recent patches, whereas they were not in early releases, and/or in V8
        t1=table.open("patients")
        recds1=t1.records_get()
        temp="a"; temp2="a" + crlf()
        for i=1 to 25
        temp=increment_value(temp); temp2=temp2 + temp + crlf()
        next
        'get all 26 letters in a variable
        dim shared qry as c
        recds=0
        n=w_count(temp2)
        for i=1 to n 
         query.filter=""; query.order=""; query.options=""
         qry=word(temp2,i,crlf())
         query.filter="left(lastname,1)=" + quote(var->qry)
         query.order="lastname"
         query.options="T"
         dim shared uid as c
         idx=t1.query_create()
         recds=recds + idx.records_get()
        ' msgbox("","" + idx.records_get())
         t1.fetch_first()
         while .not. t1.fetch_eof()
          uid=t1.Uniqueid
          temp=lookup("patients","uniqueid=" + quote(var->uid),"uniqueid")
          if temp <> uid
           msgbox("","error temp not equal to uid")
          end if 
          t1.fetch_next()
         end while
         idx.drop()
        next
        msgbox("recds1= " + recds1,"recds= " + recds + "  " + query.filter)
        t1.close()
        ps - i have 1738 records in the patients table
        Last edited by martinwcole; 06-04-2010, 03:31 PM.
        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


          #49
          Re: Query options??

          Martin

          There is a lot of activity in your latest code. And the result is the same, they work with the "T" option as well as the "X" and even with no option.

          I have gone over Glenn's code and other than it is also busy with five queries prior to the the looping section, I can't find anything wrong with the syntax (Unless I missed something).

          Again, something is diffrent in Glenn's code and I cannot put a finger on what it is that causes the query to drop and indeed it does drop.

          So far a lot of good has come from this posting - there is a lot of valuable information in what was posted. Now all we need is a solution.

          Tom Baker

          Comment


            #50
            Re: Query options??

            Sorry for the delay in posting an update .... family illness

            Anyway .... what I got back from Selwyn was ...

            "i am getting an error when i try to run your script, but we did make a change to lookup() so that it uses temporary queries"

            I sent him back a reply letting him know if the error was with the operation, to ignore. And I also asked him if he ment the lookup() was changed to temp queries in V10 or he just changed it to temp queries in latest pre-patch?? .... didnt get an answer back ... not sure I will.

            So .... if lookup() is using temp queries, it would make sense that the recursive lookups() in my code would eventually bump someone out of the available slots and if my main query uses query.options = "T", that makes it subject to getting bumped.

            The thing im struggling with though, if I use options = "" things work ok and my main query survives the loop process. I would think it wouldnt matter and the same amount of slots are available and it would still eventually get bumped. My theory is, there are certain slots for temp queries and slots for standard queries ..... just a theory .... only person that can tell us is Selwyn .... I asked for some explanation .... no reply as of today.

            Glenn

            Comment


              #51
              Re: Query options??

              Martin .... the test you ran on the patient DB and all options worked .... was that V10?

              Glenn

              Comment


                #52
                Re: Query options??

                yes - release cand 5 i think
                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

                Working...
                X