Alpha Video Training
Results 1 to 3 of 3

Thread: Zero Values

  1. #1
    Member
    Real Name
    Thomas Holt
    Join Date
    Apr 2000
    Posts
    191

    Default Zero Values

    Hello All,

    This is confusing the life out of me, so please bear with me if the question is a bit muddled.
    I have a script running off a button on a tabbed subform, the script declares shared variables, places form level values into these variables and then calls some subscripts. The objective is to perform calculations in the subscripts and then place the values into the table on the last tab on the form.
    The problem is that the first time through the script the field values(from the form) do not appear to be populating the shared variables, so ZERO is the values returned after the calculations.
    Second time or subsequent times through the script there is no problem at all. The problem only occurs when going into the form and starting a new session(?) and running the script for the first time.

    Has anyone else experienced anything similar to this ?
    Any ideas as to why this may be happening and how to cure will as always be greatly appreciated.
    I hope the above makes at least some sense.

    Many Thanks
    Cheers
    Tom

  2. #2
    "Certified" Alphaholic
    Real Name
    Finian Lennon
    Join Date
    Apr 2000
    Location
    Atlanta, GA
    Posts
    1,805

    Default RE: Zero Values

    Hi Tom:

    This sounds vaguely similar to something that happened to me a couple of months back ... Does the script run any queries?

    I had a button that would fail the first time it ran but would always work on subsequent attempts.

    It turned out that a remaining value of query.order from a higher level was causing the problem. I needed to first query.order="", query.options="", query.filter=""
    and that took care of it.

    Finian

  3. #3
    Member
    Real Name
    Thomas Holt
    Join Date
    Apr 2000
    Posts
    191

    Default RE: Zero Values

    Hello Finnian,

    Thanks for the response, unfortunately I think it is time for some humble pie, I think I've been looking so long at the problem I tried to make it something it wasn't.

    The problem was that the zero values were in discount fields (or so I assumed), these discounts are worked out by calulated them against a sub_total values. I narrowed in on the discount fields as the problem, however I had not summed all the values needed by the sub_total field before applying the discounts. Therefore I was calculating the discounts against a zero value and therefore producing zero results. The shared sub_total variable was calculated from a script lower down the calling order, so the second time I ran the script it had picked up the sub_total values and the results were as required.
    All I needed to do was populate the sub_total variable befor calling the discount script.

    Oh well a good few hours down the drain but another lesson learnt.

    Thanks again for the response Finnian, and a Happy New Year to all the people out here in APLHALAND.

    Cheers
    Tom

Similar Threads

  1. Previous values
    By Albert Conner in forum Alpha Five Version 5
    Replies: 1
    Last Post: 03-19-2004, 04:03 PM
  2. Copy Values
    By Keith Hubert in forum Alpha Five Version 4
    Replies: 6
    Last Post: 07-16-2002, 12:35 PM
  3. Previous values lookup unique values only
    By Greg Fong in forum Alpha Five Version 4
    Replies: 3
    Last Post: 02-01-2002, 03:47 PM
  4. minimum values
    By Duane Pederson in forum Alpha Five Version 4
    Replies: 1
    Last Post: 01-03-2002, 12:07 PM
  5. ASCII Values
    By Tom Patten in forum Alpha Five Version 4
    Replies: 14
    Last Post: 12-28-2001, 05:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •