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

how to use an array

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

  • how to use an array

    I've been searching through the forums and the local help file for this but don't quite understand what to do.

    I want to build a lookup filter using an array (someone told me this was the way to go).

    Where is the best place to start to try to understand what I'm doing?

    John
    Failure makes improvements

  • #2
    Re: how to use an array

    Start with the help file.

    Comment


    • #3
      Re: how to use an array

      Thanks for the reply

      I've been there.

      My problem is I'm working on a project that is beyond my present ability. Hence my question.
      Failure makes improvements

      Comment


      • #4
        Re: how to use an array

        John, tell us what you're trying to accomplish. A "lookup filter" is simply an expression that describes the records to be retrieved from a table. Not clear why you'd want to put that in an array.

        Perhaps you're talking about running a query against a table, and then reading through the filtered records one at a time in order to store field values from each record in an array?

        Comment


        • #5
          Re: how to use an array

          I have a clothing rental business. I allocate "hired" items to my customers between two dates, collect and return. This works perfectly for me with one machine doing the reservations.

          Business is good I want to move to more than one machine, my problems begin.

          Presently I query my stock and set a logical field to true if an item is booked. However if a second PC does the same for different dates my booked logical field gets over written with the latest query results.

          OK for machine 2 not OK for machine 1.

          Apparently an array is the answer as this will get round this problem.

          I have tried reading the help file and looking at hotel reservation solutions on the message board but I'm a bit out of my depth

          John
          Failure makes improvements

          Comment


          • #6
            Re: how to use an array

            John, I think reservation systems are among the most complex to design. It's not clear to me why an array will help you here, but I leave that to others. There are probably more elegant approaches but to me the simplest course would be to rethink your data structures.

            If you rent clothing by the day I'd have a table that contained a separate record for each day an article of clothing was booked. If the garment were booked for 4 days in a row I'd have 4 records, one for each day. A simple search of this table based on garment id and a single date would show you if it's available or not. In other words I'd try to stop thinking of the garments as the items you're billing. It's really the days of use, or simply, the days, that you're billing. Each day is like a line item on an order or invoice, if you see what I mean.

            That's about the extent of what I can contribute here, but I'll be watching cause it's a matter of interest. Hopefully others with more experience on this type of app will chime in to confirm or correct my suggestions, and offer more guidance.

            Comment


            • #7
              Re: how to use an array

              Apparently an array is the answer as this will get round this problem.
              Not the only answer and won't resolve overbooking issue which is a query flaw.

              Leave arrays aside for now. What you need to do first is to address this issue:
              However if a second PC does the same for different dates my booked logical field gets over written with the latest query results.
              The second machine should first query those records where the booked field is false. Then you will have a myriad of ways to show what's available, array is simply one way but not the only one.

              Comment


              • #8
                Re: how to use an array

                Thanks for this input

                I think I understand what you are saying. So machine 2 is now looking at all unbooked stock but does this not mean that machine 2 is excluding stock that may be available to its set of dates.

                Also would machine one start to see machine 2 booked stock as unavailable?

                Would this be copied to a local file on each machine on the network?

                John
                Failure makes improvements

                Comment


                • #9
                  Re: how to use an array

                  If you are on a network, both machines will be working on the same table. It is no different than working with one machine with the exception that with a network you could:
                  a. Access the same table by more than one machine AT THE SAME TIME and/or
                  b.Access the same table from More than one location.

                  But the structure of the query is the same regardless of how many machines access the table.

                  You have to put in place a scheme that tells you what's available when.

                  Comment


                  • #10
                    Re: how to use an array

                    (Date_of_return >= Var->vdCOLLECT ) .and. (Date_of_collection <= Var->vdRETURN )

                    This is the expression I presently use to mark all the booked items as true then my lookup filter is as follows. The important bit is Booked=.f. the rest is for ease of use for the operator

                    Booked=.f..AND.containsi(Kilt_Description, personal_details->tartan).AND.containsi(Kilt_Size, personal_details->kilt_size).

                    Can you suggest what I need to do to resolve my second machine problem

                    John
                    Failure makes improvements

                    Comment


                    • #11
                      Re: how to use an array

                      Hi John,
                      I think Tom has the right idea on needing more tables to find when an item is booked. Certainly people try to schedule in advance don't they? If the Item is marked as booked and the dates are part of that table then how can future dates be scheduled? If instead you pull up an item and enter bookings into a linked table then you can reverse the set to see the items booked for the date range you are looking for.
                      Robin

                      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                      Comment


                      • #12
                        Re: how to use an array

                        You needed Columbo to figure this one out!

                        When I first looked at your last post, everything seemed just fine and I was about to respond that you are doing what you should be doing.. then I saw that cigarette butt that seems to always tip off Columbo to the real killer.

                        Here is the cigarette butt:
                        (Date_of_return >= Var->vdCOLLECT ) .and. (Date_of_collection<= Var-> vdRETURN )

                        Now I could be wrong and this whole Columbo theory could be just a fantasy, but it seems to me that:
                        1-You are marking records as true based on two variables vdCOLLECT & vdRETURN
                        2-Then when you do the same from the second machine, the values of these variables are different from those in the other machine, hence you have the overlap.

                        Variables are not shared over a network. They are local to your machine.
                        Last edited by G Gabriel; 05-21-2008, 11:58 AM.

                        Comment


                        • #13
                          Re: how to use an array

                          John,
                          If you use Tom's suggestion for creating a booked item by day table,You will not have to mark records when querying. There is isually an optimal design to solve a business problem. Your present design is not optimal. Your present design works for you in a single user environment, but not in a multi-user one.By creating an index tag combining the item code and the rental date, you can instantaneously see if a particular item is available on a day or for a range of days.

                          Sometimes it is necessary to abandon a previous design and redesign. If you do the ultimate solution will be simple.
                          John

                          Comment


                          • #14
                            Re: how to use an array

                            What would I do get alpha to create these entires automatically. I remember a long time ago on this message board one of the gurus telling me it was not a good idea to have alpha create its own records.

                            I have been thinking about redesiging but when you have used one approach for many years it s hard to make that move.

                            Maybe the time is right to make that change.

                            John
                            Failure makes improvements

                            Comment


                            • #15
                              Re: how to use an array

                              Originally posted by John Keogh View Post
                              What would I do get alpha to create these entires automatically. I remember a long time ago on this message board one of the gurus telling me it was not a good idea to have alpha create its own records.

                              I have been thinking about redesiging but when you have used one approach for many years it s hard to make that move.

                              Maybe the time is right to make that change.

                              John
                              If you have a date range then getting the number of records to add could be done with some date subraction to get a count for using in a FOR NEXT loop with table.enter_begin() - a button script could do it.
                              Robin

                              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                              Comment

                              Working...
                              X