script line ignored

9 messages Options
Embed this post
Permalink
Lee-10

script line ignored

Reply Threaded More More options
Print post
Permalink
Hi,
I have a client that has been using one of my solution for a few years.
They have just updated their computers (PC running Vista) using 8.5 with
the Vista update. A script is used to enter the payment of an invoice.
The script includes copying the amount due and entering that amount in
the paid field along with the date and method of payment. The script
then continues to enter the paid amount into the accounting side of the
transaction identifying the method of banking (Cash/cheque/credit
card/direct to bank). For some reason the script is now, on occasions,
ignoring the command to copy the amount due but continues with the rest
of the script. So you end up with no amount in the 'paid' or banking
side of the transaction.
I did strike this phenomenon some years ago on another computer when I
had to enter an extra line 'pause and resume script' with a one second
delay immediately before the 'copy amount due' command. However, on this
occasion that isn't working. It seems that the process of the script is
jumping that one line. While it is only occurring occasionally its a
real problem. Yesterday I was able to repeat the error with a specific
invoice, however, after placing the 'pause script' line it worked fine.
Unfortunately the company called again this morning to advise that the
error has occurred again.

Any clues or has anyone else experienced this problem of the process
jumping a line in a script ?
--

Lee
Tim Mansour

Re: script line ignored

Reply Threaded More More options
Print post
Permalink
2009/7/3 Lee <[hidden email]>:
> Any clues or has anyone else experienced this problem of the process jumping
> a line in a script ?

I doubt it's "jumping" the line. If pausing (sometimes) cures the
problem it suggests an issue with syncing with the system clipboard. I
have to ask, though, where are you copying from? Using copy-and-paste
within FileMaker is unnecessary.

--
Tim Mansour <[hidden email]>
Neologica Print & Promotions (ABN 63 904 335 408)
Certified FileMaker 10 Developer
159 Commonwealth Street : Surry Hills NSW 2010 : Australia
Mobile 0405 500 846 : Sydney 02 9043 3223 : Melbourne 03 9012 7441
Lee-10

Re: script line ignored

Reply Threaded More More options
Print post
Permalink
Tim,
The table has an invoice layout which totals the products sold as an
invoice total. When a client pays the whole invoice amount the operator
selects the appropriate 'paid' button which then performs a number of
commands to record the details of the payment. One of the commands is to
place the invoiced total in an 'amount paid' field which is part of a
calculation that determines if the invoice has been paid in full. (Part
payments are also received for some invoices). It's the two lines in the
script that copy the invoice total and then pastes it in the amount paid
field where the problem occurs. When determining the problem I placed a
pause script after the copy the invoice total line and found that it was
not copying the invoice total. This was only possible as I was able to
reproduce the problem on one invoice, otherwise its not possible as the
problem is intermittent.

Lee

Tim Mansour wrote:

> 2009/7/3 Lee <[hidden email]>:
>  
>> Any clues or has anyone else experienced this problem of the process jumping
>> a line in a script ?
>>    
>
> I doubt it's "jumping" the line. If pausing (sometimes) cures the
> problem it suggests an issue with syncing with the system clipboard. I
> have to ask, though, where are you copying from? Using copy-and-paste
> within FileMaker is unnecessary.
>
>  

--
Jonathan Fletcher

Re: script line ignored

Reply Threaded More More options
Print post
Permalink
Tim is right, Lee. You should just use a Set Field script step. The  
copy-and-paste route can fail due to other things that can happen to  
the clipboard when you're not watching.

I suspect that if you use the script debugger in FM advanced and watch  
the values in the data viewer you will see that it will perform the  
paste script step but nothing gets written. This is why.

Instead try:
Set Field [ myTable::amountPaid ; myTable::invoiceTotal ]

If you absolutely must make it a two step process then do this:

Set Variable [ $amount ; myTable::invoiceTotal ]
Set Field [ myTable::amountPaid ; $amount ]

That is way more reliable than the clipboard.

You found out the hard way how unreliable copy-and-paste is.

j.



On Jul 2, 2009, at 9:06 PM, Lee wrote:

> Tim,
> The table has an invoice layout which totals the products sold as an  
> invoice total. When a client pays the whole invoice amount the  
> operator selects the appropriate 'paid' button which then performs a  
> number of commands to record the details of the payment. One of the  
> commands is to place the invoiced total in an 'amount paid' field  
> which is part of a calculation that determines if the invoice has  
> been paid in full. (Part payments are also received for some  
> invoices). It's the two lines in the script that copy the invoice  
> total and then pastes it in the amount paid field where the problem  
> occurs. When determining the problem I placed a pause script after  
> the copy the invoice total line and found that it was not copying  
> the invoice total. This was only possible as I was able to reproduce  
> the problem on one invoice, otherwise its not possible as the  
> problem is intermittent.
>
> Lee
>
> Tim Mansour wrote:
>> 2009/7/3 Lee <[hidden email]>:
>>
>>> Any clues or has anyone else experienced this problem of the  
>>> process jumping
>>> a line in a script ?
>>>
>>
>> I doubt it's "jumping" the line. If pausing (sometimes) cures the
>> problem it suggests an issue with syncing with the system  
>> clipboard. I
>> have to ask, though, where are you copying from? Using copy-and-paste
>> within FileMaker is unnecessary.
>>
>>
>
> --


--
Jonathan Fletcher
FileMaker 9 Certified Developer
FileMaker 10 Certified Developer

Project Foreman
NewMedia Construction Co.
[hidden email]

Instigator
The BB&J Network
The "Go-To Guys" for
FileMaker Development in Louisville
www.thebbandj.net

FileMaker Louisville Blog and Podcast:
www.filemakerlouisville.posterous.com
Lee-10

Re: script line ignored

Reply Threaded More More options
Print post
Permalink
Thank you I'll try that.
Interesting it has only happened on a couple of computers when this same
script has been used for many years on dozens, probably even a 100
computers.

Lee

Jonathan Fletcher wrote:

> Tim is right, Lee. You should just use a Set Field script step. The
> copy-and-paste route can fail due to other things that can happen to
> the clipboard when you're not watching.
>
> I suspect that if you use the script debugger in FM advanced and watch
> the values in the data viewer you will see that it will perform the
> paste script step but nothing gets written. This is why.
>
> Instead try:
> Set Field [ myTable::amountPaid ; myTable::invoiceTotal ]
>
> If you absolutely must make it a two step process then do this:
>
> Set Variable [ $amount ; myTable::invoiceTotal ]
> Set Field [ myTable::amountPaid ; $amount ]
>
> That is way more reliable than the clipboard.
>
> You found out the hard way how unreliable copy-and-paste is.
>
> j.
>
>
>
> On Jul 2, 2009, at 9:06 PM, Lee wrote:
>
>> Tim,
>> The table has an invoice layout which totals the products sold as an
>> invoice total. When a client pays the whole invoice amount the
>> operator selects the appropriate 'paid' button which then performs a
>> number of commands to record the details of the payment. One of the
>> commands is to place the invoiced total in an 'amount paid' field
>> which is part of a calculation that determines if the invoice has
>> been paid in full. (Part payments are also received for some
>> invoices). It's the two lines in the script that copy the invoice
>> total and then pastes it in the amount paid field where the problem
>> occurs. When determining the problem I placed a pause script after
>> the copy the invoice total line and found that it was not copying the
>> invoice total. This was only possible as I was able to reproduce the
>> problem on one invoice, otherwise its not possible as the problem is
>> intermittent.
>>
>> Lee
>>
>> Tim Mansour wrote:
>>> 2009/7/3 Lee <[hidden email]>:
>>>
>>>> Any clues or has anyone else experienced this problem of the
>>>> process jumping
>>>> a line in a script ?
>>>>
>>>
>>> I doubt it's "jumping" the line. If pausing (sometimes) cures the
>>> problem it suggests an issue with syncing with the system clipboard. I
>>> have to ask, though, where are you copying from? Using copy-and-paste
>>> within FileMaker is unnecessary.
>>>
>>>
>>
>> --
>
>
> --
> Jonathan Fletcher
> FileMaker 9 Certified Developer
> FileMaker 10 Certified Developer
>
> Project Foreman
> NewMedia Construction Co.
> [hidden email]
>
> Instigator
> The BB&J Network
> The "Go-To Guys" for
> FileMaker Development in Louisville
> www.thebbandj.net
>
> FileMaker Louisville Blog and Podcast:
> www.filemakerlouisville.posterous.com
>

--
Jonathan Fletcher

Re: script line ignored

Reply Threaded More More options
Print post
Permalink
I didn't say it didn't work. I said it was not reliable.

In some situations it may work all the time. You just can't bank on it.

j.


On Jul 2, 2009, at 10:02 PM, Lee wrote:

> Thank you I'll try that.
> Interesting it has only happened on a couple of computers when this  
> same script has been used for many years on dozens, probably even a  
> 100 computers.
>
> Lee
>
> Jonathan Fletcher wrote:
>> Tim is right, Lee. You should just use a Set Field script step. The  
>> copy-and-paste route can fail due to other things that can happen  
>> to the clipboard when you're not watching.
>>
>> I suspect that if you use the script debugger in FM advanced and  
>> watch the values in the data viewer you will see that it will  
>> perform the paste script step but nothing gets written. This is why.
>>
>> Instead try:
>> Set Field [ myTable::amountPaid ; myTable::invoiceTotal ]
>>
>> If you absolutely must make it a two step process then do this:
>>
>> Set Variable [ $amount ; myTable::invoiceTotal ]
>> Set Field [ myTable::amountPaid ; $amount ]
>>
>> That is way more reliable than the clipboard.
>>
>> You found out the hard way how unreliable copy-and-paste is.
>>
>> j.
>>
>>
>>
>> On Jul 2, 2009, at 9:06 PM, Lee wrote:
>>
>>> Tim,
>>> The table has an invoice layout which totals the products sold as  
>>> an invoice total. When a client pays the whole invoice amount the  
>>> operator selects the appropriate 'paid' button which then performs  
>>> a number of commands to record the details of the payment. One of  
>>> the commands is to place the invoiced total in an 'amount paid'  
>>> field which is part of a calculation that determines if the  
>>> invoice has been paid in full. (Part payments are also received  
>>> for some invoices). It's the two lines in the script that copy the  
>>> invoice total and then pastes it in the amount paid field where  
>>> the problem occurs. When determining the problem I placed a pause  
>>> script after the copy the invoice total line and found that it was  
>>> not copying the invoice total. This was only possible as I was  
>>> able to reproduce the problem on one invoice, otherwise its not  
>>> possible as the problem is intermittent.
>>>
>>> Lee
>>>
>>> Tim Mansour wrote:
>>>> 2009/7/3 Lee <[hidden email]>:
>>>>
>>>>> Any clues or has anyone else experienced this problem of the  
>>>>> process jumping
>>>>> a line in a script ?
>>>>>
>>>>
>>>> I doubt it's "jumping" the line. If pausing (sometimes) cures the
>>>> problem it suggests an issue with syncing with the system  
>>>> clipboard. I
>>>> have to ask, though, where are you copying from? Using copy-and-
>>>> paste
>>>> within FileMaker is unnecessary.
>>>>
>>>>
>>>
>>> --
>>
>>
>> --
>> Jonathan Fletcher
>> FileMaker 9 Certified Developer
>> FileMaker 10 Certified Developer
>>
>> Project Foreman
>> NewMedia Construction Co.
>> [hidden email]
>>
>> Instigator
>> The BB&J Network
>> The "Go-To Guys" for
>> FileMaker Development in Louisville
>> www.thebbandj.net
>>
>> FileMaker Louisville Blog and Podcast:
>> www.filemakerlouisville.posterous.com
>>
>
> --


--
Jonathan Fletcher
FileMaker 9 Certified Developer
FileMaker 10 Certified Developer

Project Foreman
NewMedia Construction Co.
[hidden email]

Instigator
The BB&J Network
The "Go-To Guys" for
FileMaker Development in Louisville
www.thebbandj.net

FileMaker Louisville Blog and Podcast:
www.filemakerlouisville.posterous.com
Steve Cassidy

Re: script line ignored

Reply Threaded More More options
Print post
Permalink
On Jul 3, 2009, at 5:42 PM, Jonathan Fletcher wrote:

> I didn't say it didn't work. I said it was not reliable.
>
> In some situations it may work all the time. You just can't bank on  
> it.
>
> j.

In my experience, any script steps that require a particular layout  
are prone to errors unless you explicitly go to the appropriate  
layout immediately prior. If users have access to the layout menu,  
you are almost certain to get failures at some point in time. Even if  
they don't, there are cases where you might not be on the expected  
layout for some reason.

Since copy and paste both require the fields to be on the current  
layout, do you have such explicit go to layout steps in this case?

Is the database multiuser? Another mode of failure would be a locked  
record -- locked by another user. If you have error capture set on  
but do not handle this error, it might appear as if the step is not  
working. This is another possibility.

All in all, there are quite a lot of reasons copy and paste might  
fail in scripts. A number of them might appear to be 'random'.

Steve
Lee-10

Re: script line ignored

Reply Threaded More More options
Print post
Permalink
Steve,
In my case the same script has been used in, probably, a 100 or more
solutions but only on a couple of occasions has this problem occurred.
In this latest case, the client had just updated to new PC computers
running Vista (last week). He has been running the same program for a
couple of years without this intermittent problem. It started just a
couple of days after using the new computers. I will go back and alter
the script lines to 'Set field' rather than using the copy and paste
option (same layout). There are no locked records either. Last Wednesday
I placed a 'pause script' for 1 sec immediately before the copy command
and there hasn't been a problem since. This is how I overcame it when it
first occurred some years ago on XP.

Hopefully the Set Field will change this potential issue.


Lee

Steve Cassidy wrote:

> On Jul 3, 2009, at 5:42 PM, Jonathan Fletcher wrote:
>
>> I didn't say it didn't work. I said it was not reliable.
>>
>> In some situations it may work all the time. You just can't bank on it.
>>
>> j.
>
> In my experience, any script steps that require a particular layout
> are prone to errors unless you explicitly go to the appropriate layout
> immediately prior. If users have access to the layout menu, you are
> almost certain to get failures at some point in time. Even if they
> don't, there are cases where you might not be on the expected layout
> for some reason.
>
> Since copy and paste both require the fields to be on the current
> layout, do you have such explicit go to layout steps in this case?
>
> Is the database multiuser? Another mode of failure would be a locked
> record -- locked by another user. If you have error capture set on but
> do not handle this error, it might appear as if the step is not
> working. This is another possibility.
>
> All in all, there are quite a lot of reasons copy and paste might fail
> in scripts. A number of them might appear to be 'random'.
>
> Steve
>

--
Richard S. Russell

Re: script line ignored

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

On 2009 Jul 4, at 2:33, Lee wrote:

Steve,

In my case the same script has been used in, probably, a 100 or more solutions but only on a couple of occasions has this problem occurred. In this latest case, the client had just updated to new PC computers running Vista (last week). He has been running the same program for a couple of years without this intermittent problem. It started just a couple of days after using the new computers. I will go back and alter the script lines to 'Set field' rather than using the copy and paste option (same layout). There are no locked records either. Last Wednesday I placed a 'pause script' for 1 sec immediately before the copy command and there hasn't been a problem since. This is how I overcame it when it first occurred some years ago on XP.


Hopefully the Set Field will change this potential issue.



We're all stuck with trouble-shooting from time to time, and it can be maddening. The biggest pitfall is when you're looking at your own work, trying to figure out what went wrong. Everything LOOKS just fine. (Well, it should. That's why you put it there in the 1st place.) But what it really is is not "fine" but "familiar", therefore "comfortable". Sometimes going away, doing something entirely different, then coming back later and looking at it with fresh eyes will make the error pop out at you where it hadn't before.

Better than that is getting someone else (guaranteed to have a fresh set of eyes) to review your work for you. That's why, whenever any of the non-profit groups I work for gets a new staff person (something that happens with distressing regularity in the chronically underfunded world of non-profits), I gush all over how valuable this person will be to the database, because he or she will be able to view it fresh, without preconceived ideas or the workarounds that all the veterans have long since taken for granted. "Take notes!" I enthuse. "If something seems odd, or poorly explained, or more work than it should be, or counter-intuitive, WRITE IT DOWN. Keep a notepad handy for that very purpose. Nobody else here is as valuable as YOU are in trouble-shooting this program." Yes, I make a big fuss over it, because that way they'll actually DO it. And the feedback is invaluable.

The most memorable trouble-shooting job I ever had was when I was serving as a TA for a computer-programming course back in the Dark Ages. One student came to me with a printout of what looked like a perfectly workable program that just wasn't doing the job, and he couldn't figure out why. Neither could I. Finally, after half an hour of progressive frustration, I tried something desperate. I went down the hall to the physics lab and got a magnifying glass. I said "We're gonna look this program over line by line, word by word, up close and personal, until we find the problem." Sounds nuts, right? But it gave a certain rigor to the examination, a certain distancing from the gestalt, as we ignored the forest and looked at each tree individually. And that's how we found the word where he'd typed "0" instead of "O".

Whenever you're working with electronics and something goes haywire, the standard trouble-shooting technique is to swap out the components in the chain, 1 at a time, until the problem goes away, then look more closely at whatever you just took out, because that's probably where the fault lies.

In logic, there's a well known fallacy called "post hoc ergo propter hoc" (Latin for "after that, therefore because of that"). This is the fallacy that gives rise to most superstitious behavior. For instance, a pigeon is pecking randomly around the inside of a cage when the daily feeding arrives down a tube. In the tiny little pigeon brain, whatever it was pecking at before the food arrived was what MADE the food arrive. So, next time the pigeon's hungry, it goes over and pecks at that thing again. Nothing happens the 1st 20 times or so, but eventually the food arrives again, and the behavior is reinforced. A superstition is born.

Now, while "post hoc ergo propter hoc" is a fallacy in LOGIC (where you're looking for absolute reliability, a la syllogisms), it's actually a pretty good way to go when trouble-shooting, where you're looking for probability, not certainty. Something (like a database script) isn't doing what it used to do? Well, what else have you changed recently? At the very least, that's a good place to begin looking for the CAUSE of the changed behavior. That's exactly what Lee did here, and the thing that sprang most readily to his mind was a transition in operating systems.

But perhaps that wasn't the ONLY thing that changed. Which leads to a fallacy of a different sort, the "correlation-causation" fallacy. Scientists and statisticians are constantly warned (and about half the time actually remember) that "correlation is not causation". The reason it's so hard to keep this in mind is that you can't have causation WITHOUT correlation. That is, correlation is a NECESSARY condition to demonstrate causation; it just isn't SUFFICIENT to do so.

An example leaps to mind from a beginning stat class. We were given 2 data sets — (1) per-capita milk consumption and (2) death rate due to cancer — for about 150 countries (fewer of them then) and told to run a Pearson's correlation coefficient for them. It turned out to be pretty impressive, something like 0.65, which meant that they were strongly positively correlated. As one went up, so did the other; as either went down, so did the other. "What can we learn from this?" the instructor asked. Naturally, somebody in class (not me, I'm relieved to recall) went with the obvious: "Drinking milk causes cancer?".

No, as it turns out, that's a false shortcut across the canyon. What you have to do is walk back up the trail until you come to a point of common ancestry from which the 2 trails diverge, 1 going down each side of the canyon. In my stat-class example, that point of common ancestry is economic prosperity. If a society is well off, it can afford the livestock infrastructure that enables many of its people to drink milk well past infancy. A prosperous society can also afford the sort of medical care that enables many of its people to live well into old age. And cancer is predominantly a disease of the elderly.

So I try to recall that, whenever B and C have happened fairly close together and C is bad, it's not necessarily B's fault. It might be a shared ancestor (A). Or even just a coincidence. But, as a practical matter, B's a good place to start looking; just don't get fixated on it.

Finally, there's the matter of trouble-shooting computer hardware. Here I take a totally pragmatic approach. Restart. If it solves the problem, I don't particularly CARE what caused it. Chalk it up to cosmic rays or something. Short of being able to rerun reality, I'll never know, so I don't fret over it.