2005-06-11 12:39 AM
2005-06-14 09:08 PM
F. wrote:I just tested that idea by putting the value of TypeChar into a test parameter right before attempting the LOCK and TypeChar is being set appropriately. I tested TypeChar in other situations to make sure it was switching to other appropriate values -- it seems to be working correctly in all scenarios.
In the moment the PARAMETERS statement is executable in master script TypeChar is unequal to "D". In a later execution of the master-script, when the LOCK command would work, TypeChar is equal to "D" and the line is not executed, because the IF-THEN is not true.
2005-06-15 09:44 AM
I moved all the code that deals with PARAMETERS and LOCK to the Parameter Script -- no luck, it still misbehaves.As you mentioned, this does not help for all these problems.
I'm not sure how this squares with DNC's view that most of that stuff should be in the Master Script.As I said at other places I do not agree in this point with DNC.
If I understand this thread correctly, the Master Script is run repeatedly, where the Parameter Script is only run in certain instances. If so, it would seem that you would put it in the Parameter Script for speed, or the Master Script for constant validation.In most cases it will not remarkable decrease speed, if there are lots only once executed statements in the master. But you should not put there file access. This will decrease speed in deed.
2005-06-16 02:21 PM
2005-06-16 10:05 PM
F. wrote:I do this too, and I've observed many cases where it was needed (a problem went away), but I've never understood it. I understand that the parameters script is only executed in limited circumstances, but is it also true that PARAMETERS commands in the Master Script are ignored when in non-parameter-script circumstances?
In case the PARAMETERS-command is ignored, because the interpreter is in the "wrong" circumstance, the parameter will not be changed either.
I prefer:
val1="new value"
PARAMETERS val1=val1
2005-06-17 01:44 PM
2005-06-17 04:51 PM
2005-06-22 06:13 AM
Jay wrote:Not quite sure why the LOCK isn't working - must have something to do with the fact you are trying to lock the variable being used in the IF statement and you are changing the value of it from when you started the IF statement (just a guess!).
I have several LOCK functions in my Master Script that are meant to lock parameters depending on other values. I have at least 3 of them that won't lock the parameter. I've checked it from every angle -- spelling, punctuation, syntax, order of evaluation, extraneous code, etc. -- and nothing has solved the problem, they just will not lock. I've spent at least 3 hours trying to solve this problem.
The following code is used in a dozen places, only using different parameter names each time.
IF DCA_Deadbolt = `-` THEN
PARAMETERS DCA_Deadbolt_Qty = `-`
LOCK `DCA_Deadbolt_Qty`
ELSE
IF DCA_Deadbolt_Qty = `-` THEN
PARAMETERS DCA_Deadbolt_Qty = `1`
IF TypeChar <> `D` THEN
PARAMETERS TempVal = "HELLO" ! This line works
LOCK `DCA_Deadbolt_Qty` ! This line DOESN'T
ENDIF
ENDIF
ENDIF
The test line with TempVal works, which tells me the IF function preceeding it is working correctly. There is absolutely no reason the LOCK function shouldn't work. Is this a bug, or am I missing something? I realize it's Friday afternoon, but I can't be THAT delirious.