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



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

Saving changes.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Saving changes.

    Here's another one that's been driving me mad, hope someone can help:

    I have some code attached to a "Save" button. A value is calculated, using a function I have written. This works OK and is called like this:

    m_deposit = depCalc(dateStart,dateEnd,roomname.value)

    I then want to put the value of m_deposit into a form object called deposit. I do that with:

    deposit.value = m_deposit

    This technique works elsewhere. However, nothing changes on my form. If I then Modify the form again, but change nothing, the correct (new) value IS written correctly when the Save button is pressed. If I put the following around the above line:

    deposit.value = m_deposit

    I get the correct value (ie the new value I've just input) in the first message box, but the previous value in the second message box. So, the new value is not getting written to deposit.value. (But it is the second time I do it.) What should I be doing to make the value of m_deposit get into deposit.value on the first attempt?

    HELP, please. Thanks, as ever,


  • #2
    RE: Saving changes.


    Two things occur to me, but, with free advise, what you get may be worth what you pay for .

    One, do you perhaps need to refresh the form?

    Two, you might try writing directly to the table rather than the form, as in tablename->deposit.

    Let us know what finally works.


    Jay Talbott
    Jay Talbott
    Lexington, KY


    • #3
      RE: Saving changes.

      Thanks Jay,

      No, I've tried refreshing the form, but I'm refreshing it with the wrong value: the lines -
      ui_msg_box("TEST",str(m_deposit)) // result, say, 123.00
      deposit.value = m_deposit
      ui_msg_box("TEST",str(deposit.value)) // result still 0.00, or whatever was previously in the deposit object
      show that, for some reason, the value of m_deposit is not getting written to my form object, deposit.value.

      It must be something I'm doing wrong, because I'm finding something similar elsewhere, now. Can anybody see anything wrong with copying an amount to a form object like this? Everywhere else it displays as soon as the line is executed.




      • #4
        RE: Saving changes.


        Is the Deposit field a simple field, or do you have field rules that govern data entry ?

        Is the Deposit field object a simple object, or do you have scripts attached to any of its actions (events) ?

        Have you tried closing Alpha Five, rebooting, and then compacting?

        -- tom


        • #5
          RE: Saving changes.

          Hi Tom, thanks for your time.

          The deposit field is a simple field with no rules.

          There is one 3 line script attached to the Deposit field object's Can Arrive event, saying:

          if modifying = .f.
          end if

          (modifying is a global var, and it's always true when modifying the form), but there is no script attached to any other of the object's events.

          I've tried rebooting, compacting etc. Doesn't work.

          Ah, well... time for bed. Perhaps I'll dream the answer; wouldn't be the first time!



          • #6
            RE: Saving changes.


            If your Save button's script changes the value of Modifying to False, wouldn't that cancel any effort to change the value of the deposit object on your form?

            -- tom


            • #7
              RE: Saving changes.

              No, the global variable "modifying" is set to false after the deposit-related code (and various other checks) is run. The variable is used to control which buttons can be pressed, or which fields changed, at different times. A "Next Record" button can't be pressed while the present record is being modified, for instance (it has to be validated and saved first). My problem is not with entering the particular field ("deposit" in this case) but with making the value change following the modification of other fields. That is, I'm changing other fields, then when a button is pressed certain validations are carried out (check that certain field combinations are completed etc.) and then, depending on a combination of room, season(s) and length of stay (you've guessed - it's a hotel system!), a deposit is calculated and displayed on the form (IF ONLY!).

              As my ui_msg_box() tests have shown, the correct value is getting calculated but it will not copy to deposit.value.

              All I really want to know is that the line:

              formfield.value = memvariable

              would be expected to move the value of memvariable to formfield.value. Should I use formfield.text instead? Or as well as?

              This is what I find the most frustrating thing about A5 (this forum being the best thing about A5!): if I have a problem with some xbasic script I can go through it line by line and (eventually) work out what's wrong, but A5 itself is a bit of a closed box, so there's no way of knowing what is going on in there.

              Plus, of course, I'm relatively new so I'm not even certain what it SHOULD be doing. But if I can't write a new value to a form field, I'm going to have a lot of trouble in the future, I guess, 'cos I need to do it all the time.

              Well, I won't be working on the system 'till Monday, now, so I'm hoping for a flash of inspiration over the weekend (either in me or, more likely, in one of you good people).

              Thanks for the resposes,



              • #8
                RE: Saving changes.


                If the script that does all your calculations, uses values which are themselves created in the script, you may be having a timing problem. You cannot assume that each line of your script will fully execute (process to conclusion) before the next line begins. So, for example, if one section of your script goes out to disk, retrieves some records, does some calcs, and then closes the source file, all of that may still be going on while your script continues on.

                If you don't have a simple field refresh issue, then it's most likely that the value is not being computed when you think it is.

                -- tom


                • #9
                  RE: Saving changes.


                  When you say:

                  "This is what I find the most frustrating thing about A5 (this forum being the best thing about A5!): if I have a problem with some xbasic script I can go through it line by line and (eventually) work out what's wrong, but A5 itself is a bit of a closed box, so there's no way of knowing what is going on in there. "

                  I can relate.

                  However, you should realize that you're really talking about black boxes within black boxes. The designers of Alpha Five have to use tools (DLL's) built by Microsoft, each of which is a black box. Microsoft has to use tools that work with the central processing unit designed by others, which contains it's own microcode, which, to Microsoft, is a black box, too.

                  It's amazing the darn things work at all.

                  -- tom


                  • #10
                    RE: Saving changes.

                    >> It's amazing the darn things work at all.

                    You're right there, Tom, and I do appreciate the truth of your earlier remarks.

                    Re your comment that lines of a program can execute in an order other than that in which it was written - er, well, I'm astonished. I really AM amazed that anything works if this is the case. Are you sure that if, say, lines 1 to 30 calculate a value and line 31 writes it to a variable, A5 can execute line 31 before 1 - 30 has completed? Or have I misunderstood you? I must have.

                    If A5 really does work like that, what's to stop a value arrived at only half way through a calculation being written to the new variable and used in further computations, etc? If this gets out it's going to make Alpha look a bit flaky, isn't it?



                    • #11
                      RE: Saving changes.


                      don't worry. Just be cognizant that if a command statement sets a process in motion, Alpha Five is multi-threaded, and may first set that process in motion, and then before it's finished, resume marching through the original script. It does not take the statements out of sequence. However, it is inherently multi-threading... or so it seems to me. The symptom of this behavior is evident when the commands that are executed in your script misbehave because the original process has not concluded.

                      My personal rule: Keep it simple. Keep it short. Avoid lengthy scripts wherever possible. If one is required, test for multi-threading issues by thinking about the processes that are set in motion by your command statements. If you include complex calculations that require Alpha Five to scan a bunch of records, and then process them, this 'process' may not be finished when you would otherwise expect it to be done. This is not DOS. It's Windows, and multi-tasking, multi-threading improves performance. If you scan the messages in this forum you'll easily find cases where folks were bumping into this using scripts that appended a bunch of records, then marked a bunch of records, then exported a bunch of records. Each sequence was an inddependent process that did not run to completion before the next began. If this is your situation, you probably will be well advised to encapsulate your processes in user defined functions. These UDF's will run to completion before your script resumes.

                      -- tom


                      • #12
                        RE: Saving changes.


                        Fortunately I do put most computations into UDFs. These conversations have been interesting, but the fact remains that my line:

                        formfield.value = memvariable

                        doesn't work. It's quite a simple line. memvariable has been previously calculated in a UDF [ie,


                        ]. But if I simply assign a random value to memvariable (without running the UDF) it still doesn't work!

                        Ah, well, I'll keep plugging away. I'll let you know if I find a "cure". Thanks again.



                        • #13
                          RE: Saving changes.


                          If you get stumped, consider posting a working model here so we can tear it apart. Otherwise, 'conversation' is about all any of us can offer, I'm afraid. -- tom