I am having a problem with the following script. Using FM 6 on Mac OS 9.
The script is supposed to check if the user has properly entered the correct
publication and an issue number that is greater than zero. The publication
must be entered as either Condo Source or New Homes, any other variation is
unacceptable.
Example:
Condo Source
12
Result: No problem
Example
New Homes
12
Result: This result is not recognized as valid and loop cycles, asking you
to re-enter the correct data. If you hit enter again without changing
anything or simply enter inthe exact same information, it passes the exit
loop test and life goes on. In short it passes the exit loop test only after
the second cycle.
I think the problem is the second "or" statment in the exit loop. This
statement/expression is not being evaluated until the loop cycles the second
time. I'm not sure what to do about this other then separate Issue and
Publication into separate loops entirely.
As always, your thoughts are appeciated greatly.
---------------------------Start script
Show Custom Message["Enter Publication and Issue", "PublicationHoldField",
IssueHoldField"]
If["Status(CurrentMessageChoice = 1"]
if["IssueHoldField <= 0 OR not Exact("Condo Source", PublicationHoldField)
or not Exact("New Homes", PublicationHoldField)"]
Loop
Show Custom Message["Enter Publication and Issue", "PublicationHoldField",
IssueHoldField"]
Exit Loop if["IssueHoldField > 0 AND
Exact("Condo Source",PublicationHoldField) or
Exact("New Homes", PublicationHoldField))
or
Status(CurrentModifierKeys)= 13"]
End Loop
End If
End If
---------------------------End script
PublicationHoldField and IssueHoldFields are global fields holding text and
numbers respectively.
|
|
0
|
|
|
|
Reply
|
pcourterelle
|
9/15/2004 6:03:17 AM |
|
You just need to enter some parenthesis so FileMaker knows in what order
to evaluate your 'exit loop if' statement:
(IssueHoldField > 0 AND
(Exact("Condo Source",PublicationHoldField) or
Exact("New Homes", PublicationHoldField))) or
Status(CurrentModifierKeys)= 13
pcourterelle wrote:
> I am having a problem with the following script. Using FM 6 on Mac OS 9.
> The script is supposed to check if the user has properly entered the correct
> publication and an issue number that is greater than zero. The publication
> must be entered as either Condo Source or New Homes, any other variation is
> unacceptable.
>
> Example:
> Condo Source
> 12
> Result: No problem
>
> Example
> New Homes
> 12
> Result: This result is not recognized as valid and loop cycles, asking you
> to re-enter the correct data. If you hit enter again without changing
> anything or simply enter inthe exact same information, it passes the exit
> loop test and life goes on. In short it passes the exit loop test only after
> the second cycle.
>
> I think the problem is the second "or" statment in the exit loop. This
> statement/expression is not being evaluated until the loop cycles the second
> time. I'm not sure what to do about this other then separate Issue and
> Publication into separate loops entirely.
>
> As always, your thoughts are appeciated greatly.
> ---------------------------Start script
>
> Show Custom Message["Enter Publication and Issue", "PublicationHoldField",
> IssueHoldField"]
>
> If["Status(CurrentMessageChoice = 1"]
>
> if["IssueHoldField <= 0 OR not Exact("Condo Source", PublicationHoldField)
> or not Exact("New Homes", PublicationHoldField)"]
>
> Loop
> Show Custom Message["Enter Publication and Issue", "PublicationHoldField",
> IssueHoldField"]
>
> Exit Loop if["IssueHoldField > 0 AND
> Exact("Condo Source",PublicationHoldField) or
> Exact("New Homes", PublicationHoldField))
> or
> Status(CurrentModifierKeys)= 13"]
>
> End Loop
> End If
> End If
> ---------------------------End script
>
> PublicationHoldField and IssueHoldFields are global fields holding text and
> numbers respectively.
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California
FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance
|
|
0
|
|
|
|
Reply
|
Howard
|
9/15/2004 7:21:30 AM
|
|
In article <BD4AEF08.2565%pcourterelle@telus.net>, pcourterelle
<pcourterelle@telus.net> wrote:
> I am having a problem with the following script. Using FM 6 on Mac OS 9.
> The script is supposed to check if the user has properly entered the correct
> publication and an issue number that is greater than zero. The publication
> must be entered as either Condo Source or New Homes, any other variation is
> unacceptable.
>
> Example:
> Condo Source
> 12
> Result: No problem
>
> Example
> New Homes
> 12
> Result: This result is not recognized as valid and loop cycles, asking you
> to re-enter the correct data. If you hit enter again without changing
> anything or simply enter inthe exact same information, it passes the exit
> loop test and life goes on. In short it passes the exit loop test only after
> the second cycle.
>
> I think the problem is the second "or" statment in the exit loop. This
> statement/expression is not being evaluated until the loop cycles the second
> time. I'm not sure what to do about this other then separate Issue and
> Publication into separate loops entirely.
>
> As always, your thoughts are appeciated greatly.
> ---------------------------Start script
>
> Show Custom Message["Enter Publication and Issue", "PublicationHoldField",
> IssueHoldField"]
>
> If["Status(CurrentMessageChoice = 1"]
>
> if["IssueHoldField <= 0 OR not Exact("Condo Source", PublicationHoldField)
> or not Exact("New Homes", PublicationHoldField)"]
>
> Loop
> Show Custom Message["Enter Publication and Issue", "PublicationHoldField",
> IssueHoldField"]
>
> Exit Loop if["IssueHoldField > 0 AND
> Exact("Condo Source",PublicationHoldField) or
> Exact("New Homes", PublicationHoldField))
> or
> Status(CurrentModifierKeys)= 13"]
>
> End Loop
> End If
> End If
> ---------------------------End script
>
> PublicationHoldField and IssueHoldFields are global fields holding text and
> numbers respectively.
You could be right, it looks like it's that 'End Loop' test with the OR
playing up - although there looks like a typo above with a missing /
extra bracket somewhere there.
With your line you've got a test of:
If A and B or C or D
which FileMaker will read as (A and B) or C or D.
ie. Issue > 0 and Publication = "Condo Source
or Publication = "New Homes"
or ModifierKey = 13
When what you really want is:
If A and (B or C) or D
or written even more readably as:
If (A and (B or C)) or D
{You could even spell it out in full as (A and B) or (A and C) or D.}
Putting in the extra brackets to ensure the correct testing order means
what get something like this:
Exit Loop If[(
(IssueHoldField > 0)
AND
(Exact("Condo Source",PublicationHoldField)
OR Exact("New Homes", PublicationHoldField))
)
OR Status(CurrentModifierKeys)= 13]
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
|
|
0
|
|
|
|
Reply
|
Helpful
|
9/15/2004 7:50:37 AM
|
|
Howard, Harry;
I agree that the problem is ensuring FM reads the exit loop as
A or
(B or C) or
D
Where (B or C) is considered a distinct value from A or D.
I played with the parentheses as you recommended and in other
configurations as well, but no change. I am going to separate the entire
loop into two parts, one for checking whether or not the Issue is greater
than zero and a second loop for checking the publication entered. Of course
if they introduce a third publication I will have to revist this issue.
FYI I am using FM6 on Mac OS9
in article 10kfrc0q4bdcuaa@corp.supernews.com, Howard Schlossberg at
howard@antispahm.fmprosolutions.com wrote on 9/15/04 1:21 AM:
> You just need to enter some parenthesis so FileMaker knows in what order
> to evaluate your 'exit loop if' statement:
>
> (IssueHoldField > 0 AND
> (Exact("Condo Source",PublicationHoldField) or
> Exact("New Homes", PublicationHoldField))) or
> Status(CurrentModifierKeys)= 13
|
|
0
|
|
|
|
Reply
|
pcourterelle
|
9/16/2004 1:49:34 AM
|
|
Ok, here's one solution. I created a standard calculation field called
RolloverValidityTest with the following parameters:
If(
Exact("Condo Source", PublicationHoldField) xor
Exact("New Homes", PublicationHoldField), "True",
"False"
)
This transfers part of the exit loop script to a calculation field that
displays either True or False. The simplified exit loop now tests if
IssueHoldField > 0 AND RolloverValidityTest = "True" before exiting loop.
Not the greatest solution but it works. If you have other ideas why the
orginial didn't work,I'd appreciate the post.
thanks for the input
phil courterelle
in article 150920041950377207%helpful_harry@nom.de.plume.com, Helpful Harry
at helpful_harry@nom.de.plume.com wrote on 9/15/04 1:50 AM:
> In article <BD4AEF08.2565%pcourterelle@telus.net>, pcourterelle
> <pcourterelle@telus.net> wrote:
>
>> I am having a problem with the following script. Using FM 6 on Mac OS 9.
>> The script is supposed to check if the user has properly entered the correct
>> publication and an issue number that is greater than zero. The publication
>> must be entered as either Condo Source or New Homes, any other variation is
>> unacceptable.
>>
>> Example:
>> Condo Source
>> 12
>> Result: No problem
>>
>> Example
>> New Homes
>> 12
>> Result: This result is not recognized as valid and loop cycles, asking you
>> to re-enter the correct data. If you hit enter again without changing
>> anything or simply enter inthe exact same information, it passes the exit
>> loop test and life goes on. In short it passes the exit loop test only after
>> the second cycle.
>>
>> I think the problem is the second "or" statment in the exit loop. This
>> statement/expression is not being evaluated until the loop cycles the second
>> time. I'm not sure what to do about this other then separate Issue and
>> Publication into separate loops entirely.
>>
>> As always, your thoughts are appeciated greatly.
>> ---------------------------Start script
>>
>> Show Custom Message["Enter Publication and Issue", "PublicationHoldField",
>> IssueHoldField"]
>>
>> If["Status(CurrentMessageChoice = 1"]
>>
>> if["IssueHoldField <= 0 OR not Exact("Condo Source", PublicationHoldField)
>> or not Exact("New Homes", PublicationHoldField)"]
>>
>> Loop
>> Show Custom Message["Enter Publication and Issue", "PublicationHoldField",
>> IssueHoldField"]
>>
>> Exit Loop if["IssueHoldField > 0 AND
>> Exact("Condo Source",PublicationHoldField) or
>> Exact("New Homes", PublicationHoldField))
>> or
>> Status(CurrentModifierKeys)= 13"]
>>
>> End Loop
>> End If
>> End If
>> ---------------------------End script
>>
>> PublicationHoldField and IssueHoldFields are global fields holding text and
>> numbers respectively.
>
> You could be right, it looks like it's that 'End Loop' test with the OR
> playing up - although there looks like a typo above with a missing /
> extra bracket somewhere there.
>
> With your line you've got a test of:
>
> If A and B or C or D
>
> which FileMaker will read as (A and B) or C or D.
> ie. Issue > 0 and Publication = "Condo Source
> or Publication = "New Homes"
> or ModifierKey = 13
>
>
> When what you really want is:
>
> If A and (B or C) or D
>
> or written even more readably as:
>
> If (A and (B or C)) or D
>
> {You could even spell it out in full as (A and B) or (A and C) or D.}
>
>
> Putting in the extra brackets to ensure the correct testing order means
> what get something like this:
>
> Exit Loop If[(
> (IssueHoldField > 0)
> AND
> (Exact("Condo Source",PublicationHoldField)
> OR Exact("New Homes", PublicationHoldField))
> )
> OR Status(CurrentModifierKeys)= 13]
>
>
>
>
> Helpful Harry
> Hopefully helping harassed humans happily handle handiwork hardships ;o)
|
|
0
|
|
|
|
Reply
|
pcourterelle
|
9/16/2004 4:31:15 AM
|
|
|
4 Replies
155 Views
(page loaded in 0.156 seconds)
Similiar Articles: Problem with script - "The input character is not valid..." - comp ...I created a file with extension *.m When I try to use this file I obtain the following message: ??? Error: File: /home/user/plik.m Line: 5 Column:... Need help figuring out how to write the script for this problem ...Need help figuring out how to write the script for this problem. Follow Problem with "Send Event" Script Step - comp.databases.filemaker ...I'm having problems with the "Send Event" script step in FileMaker Pro 8 Advanced (running on Windows XP). I am using the following three script ste... Problems with Using CutePDF Writer to copy the text in a script ...Thanks for these links. Unfortunately as you have already indicated some are old, one of them seem to do interesting stuff with scripts, but did not seem to ... Logon Script using IFMEMBER - Windows 7 PROBLEM! - comp.os.ms ...I hope this is the right forum for a question like this. I've done days worth of reading and haven't found a solution to this yet... So here's th... IE problem with open.window - comp.lang.javascriptI am quite new to javascript, and don't seem to find the problem with stupid internet explorer. The script works fine in safari and mozilla. I search... Problems with reading PDF via VBScript - comp.text.pdfHi everyone, I'm trying to read the number of pages from a .PDF-document. I have over 200 pdf-documents and want to make an inventory. I have tried... Weird nohup issues - comp.unix.solarisSounds like a problem with some of the commands in the script. The script itself is getting started fine, it would appear, since some of the commands within the script ... compare alphanumeric number with integer problem - comp.lang ...Compare strings as integers - comp.unix.solaris compare alphanumeric number with integer problem - comp.lang ..... Basic :: Getting Only The Integer From An ... problem about convert utf8 to gbk - comp.lang.javascript ...hi all, i need to covert the utf8 character to gbk,is that possible?Any idea will be appreciate. ... How to troubleshoot script errors in Internet ExplorerDescribes how to troubleshoot the following script error: "Problems with this Web page might prevent it from being displayed properly. In the future, you ... How to Fix Script Error Problems With Firefox | eHow.comA "Warning: Unresponsive script" dialog box appears when a page takes too long to load. It's helpful because by stopping the script, you may be able to avoid an ... 7/21/2012 7:36:12 PM
|