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

Generic "Basic Data Entry" tools?

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

    Generic "Basic Data Entry" tools?

    I'm starting out designing my first Alpha 5v4.5 application, and was perusing the forums here for ideas on how to design it efficiently. I ran across Tom Cone's marvelous "Basic Data Entry" versions in the code archive, which looks great as a start and a teaching tool. Thanks, Tom!

    My question is: Is it possible to make the scripts completely generic? They are oh so close to being so, but some have code like:

    parentform:idnum.activate() ' set focus

    which requires that the form have a field named "idnum". It seems like it should be possible to get from the form the name of the first user-accessible field, and activate that instead of hard-coding the field name there. I've found how to list the form's children with .child(N), and figuring out which ones are fields with class(), but have not yet found how to determine which is the first one in the form. (child(1) doesn't do it, nor does the last child with class of "field").

    I ask this because my application will have a number of forms for entering different kinds of data, and with this refinement, I would only have to copy the code, not copy, and remember to edit the field name wherever it appears in the code. Also, it would speed my development, and lend a better appearance to the applilcation if the record entry/edit forms all look the same - is is possible to build a "generic" form with the buttons and explanatory text, then copy it and attach it to the requisite table, and place the fields needed in?

    Thanks again to Tom for a great example to steal^h^h^h^h^hborrow ideas from!

    Greg McMullan, still posting from Rose's account




    #2
    RE: Generic

    Noble ambition and possibly possible.

    Suppose you edit your object names as you create them and use a standard convention. Then "the name of the first user-accessible field" would always be the same.
    There can be only one.

    Comment


      #3
      RE: Generic

      Hello Greg from Rosie's account,

      >>My question is: Is it possible to make the scripts completely generic? They are oh so close to being so, but some have code like:

      parentform:idnum.activate() ' set focus

      Comment


        #4
        RE: Generic "Basic Data Entry Forms"

        Thanks, Jim and Stan.

        I'm with Jim on the importance of field names, so will probably try his approach to the problem. Unfortunately, it doesn't really solve the problem of properly generic buttons and scripts, since if I understand you right I'd be trading something like:

        parentform:idnum.activate() ' set focus

        for something like:

        Set_focus("idnum")

        Which still requires me to edit scripts in each and every form.

        It occurs to me that I can probably combine your ideas to limit the amount of editing that I do, by setting up a convention where I have a form-level variable in which I store the name of the first field, and my Set_focus() function reads that variable. That way, instead of at least 5 (I think - didn't really count them) instances of "idnum" that I'd have to change in the single-table BDE form, I'd only have to change one variable.

        I'm still frustrated, though, because clearly Alpha knows what field is first on the form, and it seems to me that it should be possible for me to just ask it, which saves me the hassle of remembering to change the variable when my users want a different form design. I'll keep looking for the answer.

        Thanks again, and stay tuned for more basic questions from me :-) I am sure that I'll have them while I get used to the Alpha 5 way of viewing the world.

        Greg

        Comment


          #5
          RE: Generic

          Greg,

          I've checked the properties and methods of the form and its fields using Xbasic Explorer. I don't believe the tab order setting is exposed to us, even though it's known to Alpha Five. (I'm using ver. 4.03).

          In the meantime, here's an extension to your idea concerning the possible use of a form level variable to store the 'first' field.

          When your form is loaded, perhaps you could store the 'current' object name in the variable you mention, since the first field in tab order should receive focus when the form opens, right? If this is right, you ought to be able to reference the first field in your button scripts, by retrieving the current value from your variable.

          -- tom cone

          Comment


            #6
            RE: Generic

            Greg,

            I took a few minutes to test the feasibility of my idea, and it seems to work ok. Had to use the OnActivate event for the form instead of the OnInit event.

            Tracks changes in the arranged tab order just fine, returns the name of the object that's currently first in tab order even after the tab order is changed.

            -- tom

            Comment


              #7
              RE: Generic

              Lovely, Tom! As useful as I had anticipated from you, from reading your postings here.

              It took me a fair while to track down the method used to do it, but for the benefit of people here who are as new with Alpha as I am, this xbasic code on the OnActivate event
              for my form worked just as you described:

              Code:
              ''XBasic
              'code to try to find the name of the first field that 
              'is entered in the form, to facilitate
              ' writing generic code
              
              this.firstfieldname = this.active()
              
              ui_msg_box("looking up", this.firstfieldname)
              Actually, I haven't yet tested that I am actually storing the value in the variable, but I sure think that I am doing so.

              Interestingly, when I read your suggestion, I looked more closely at the documentation for the .name() method, and saw code that says that it finds the name of the first object on a form. Unfortunately, I assumed that that would be the first VISIBLE object, or the first FIELD, but the following code shows me that it seems to be neither:

              Code:
              ' let us print the name of the first object on the 
              'form, per page 131 of the Xbasic manual:
              
              obj = this.child(1)
              ui_msg_box("First Object Name", obj.name())
              In any case, it looks like this method will work with my version of Alpha Five (4.5, build 266), and it sounds like it will work for yours, as well. Perhaps when I get a little free time and some more pieces of code, I'll write up a submission for the code archive.

              Thanks again!

              Greg

              Comment

              Working...
              X