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

Accessing field / variable values on a form

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

    Accessing field / variable values on a form

    I've only been working with a5 for a couple of months now. Don't know if I'm getting into a bad habit or not, so would like some input on how you experienced a5 guys do this. I have found the easiest way to get values when writing code in xbasic, is to have a field on a form (hidden if it doesn't need to be seen) that I can reference with either the form pointer or just the field object name itself. But I end up with my form window looking like it has post-it notes all over it when in design mode. This seems much easier, though, than using a table pointer and mix and matching form objects with table field objects.
    Any suggestions would be greatly appreciated.
    Thanks.
    Ernie

    #2
    Re: Accessing field / variable values on a form

    set the hide property for the objects that you really don't want to show..
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.
    "Make it as simple as possible, but not simpler."
    Albert Einstein

    http://www.iadn.com/images/media/iadn_member.png

    Comment


      #3
      Re: Accessing field / variable values on a form

      Hi, Al,
      Well, that's what I'm saying. I usually have several all over the limited real estate that I have hidden.
      have a field on a form (hidden if it doesn't need to be seen)
      So in design mode it looks like post-it notes all over the form. Was just wondering if this is the norm, or if there was a better way of programming. Sometimes the easiest road isn't always the best down the road.
      Thanks for your input.
      Ernie

      Comment


        #4
        Re: Accessing field / variable values on a form

        Sorry I missed your reference to hidden...

        So put them on top of each other in a free area of the form, make them small, and use the object explorer to find them if needed.
        Al Buchholz
        Bookwood Systems, LTD
        Weekly QReportBuilder Webinars Thursday 1 pm CST

        Occam's Razor - KISS
        Normalize till it hurts - De-normalize till it works.
        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
        When we triage a problem it is much easier to read sample systems than to read a mind.
        "Make it as simple as possible, but not simpler."
        Albert Einstein

        http://www.iadn.com/images/media/iadn_member.png

        Comment


          #5
          Re: Accessing field / variable values on a form

          If I don't need the field on the form for the user to see, I use a table pointer in the xbasic code. Of course, I write virtually everything in xbasic so I don't know how this would apply if you were using action scripting.

          However, I do NOT recommend using Table.Open() to get the pointer because that requires you to also find the correct record. Either use <tbl_pointer> = Table.Get("<tablename>") then use that pointer to get all the field values you need or, if only one value is needed I prefer parentform:tables:<tablename>.<field_name> because it's all in one line.

          Note that getting the value from the table with parentform:tables:<tablename>.<field_name> is nearly the same as getting it from the form with parentform:<object_name>.text

          You will note that I don't use parentform:<object_name>.value. This was not a typo. Using the parentform:<object_name>.value method sometimes gives strange results. I'm not sure exactly what is happening in v8 and v9 since I quit using this method a long time ago. ("Once burned" and all that.) In previous versions you will get errors such as:
          - A blank numeric field will return some huge number like 10*10^123 - not zero like you might expect. (Don't quote me on that "123" number.) If you get the .text result then you can check if it is blank. I suppose you could also check to see if the value is > 10*10^99 to determine if it was supposed to be blank. After all most people don't use numbers higher than 1 with 99 zeros on the end. Of course, if you get the text result then you also have to be concerned with non-numeric characters in the text string.
          - A blank logical value sometimes results in "True". I know I've seen this but I'm not sure if it was only for a few builds or was true in all builds of certain versions.

          Due to having past issues with things like this, I no longer use .value to GET data from field objects but I do use .value to put data into field objects. My preferred method now for getting data is the "table pointer" via parentform:tables:<tablename>.<field_name>.

          You can also use Table.current() if it is a one-table form or you want to just use the parent table of the set.

          The Table.current() command also works for child tables in a set but I don't like to use it that way because (a) it's more difficult to find the correct slot number of the child table and (b) sometimes I've changed set structure and then the number of the appropriate child table changes. The big problem with "b" is that I probably won't remember that my script(s) contained references to that child table by slot number until a customer gets an error message. Of course, if the set only contains one child table then this probably won't be an issue.
          Last edited by CALocklin; 05-02-2008, 08:57 PM.

          Comment


            #6
            Re: Accessing field / variable values on a form

            Al & Cal,
            Thanks for the responses. Got good info from both of you. One re-affirms I'm not too far up the wrong tree. Cal, thanks for the info on how you get data. Found your experiences using the .value very interesting. I have had, in my limited experience with a5 some inconsistencies in data retrieval using the form pointer methods. Posted about a week ago about this issue, not knowing when or if I needed to use the .value or the .text or neither. Things are improving, but still have my frustrating moments. Seems just shutting down or compacting the db helps most of the time. I'll continue my education in this area. Thanks again for the help in understanding.
            Ernie

            Comment


              #7
              Re: Accessing field / variable values on a form

              Hi Ernie,
              One advantage to hiding certain key fields on the form is that during design you can unhide them to see what is happening. If I have a conditional object on the form I hide them in the default page which I intend to never show. It is also an easy way to reference a field in a browse by putting it outside the browse on the form. I think it is a good thing for beginners to start at the beginning - though some of us never progress much past that ;).
              Robin

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

              Comment


                #8
                Re: Accessing field / variable values on a form

                Thanks for the input, Robin. Yes, that is why I haven't chosen yet to make them small and on top of each other yet. I like to unhide them to see what's going on when my code starts screwing things up. Hadn't thought about adding a browse field onto the form for reference. Always thought it had to be in the browse and then reference the column. Thanks for that idea.
                Ernie

                Comment

                Working...
                X