I found a typo in the original script.
Near the end we may read : if RuPageCount ≤ 20 then set RusDocPrice to RuPageCount * 3 --failure. Returns an initial value else if PageCount > 20 then set RusDocPrice to RuPageCount * 2 --failure. Returns an initial value end if
It must be : if RuPageCount ≤ 20 then set RusDocPrice to RuPageCount * 3 else if RuPageCount > 20 then set RusDocPrice to RuPageCount * 2 end if
In fact the three blocks of code calculating the prices may be simplified as:
if EnPageCount ≤ 20 then set EnDocPrice to EnPageCount * 4 else set EnDocPrice to EnPageCount * 3 end if if LtPageCount ≤ 20 then set LtDocPrice to LtPageCount * 3 else set LtDocPrice to LtPageCount * 2 end if
if RuPageCount ≤ 20 then set RusDocPrice to RuPageCount * 3 else set RusDocPrice to RuPageCount * 2 end if
Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) vendredi 26 mai 2017 19:05:27
|