• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help with Logic
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with Logic


  • Subject: Re: Help with Logic
  • From: Deivy Petrescu <email@hidden>
  • Date: Tue, 02 Mar 2010 14:01:36 -0500

On 02/03/2010, at 13:38 , Richard Lake wrote:

> Hi all,
>
> Trying to create what would seem to me quite easy logic, but I don't want to resort to long-winded if statements so hoping someone can supply a neat solution.
>
> Basically imagine we have an array of variable size.  Every 10th item of the array I want to set a different outputstring.
>
> Outputstring could equal something like this: caraccessories_page1.html, caraccessories_page2.html, caraccessories_page3.html.
>
> So if we imagine that the array size is 97 items then the final outputstring would be caracceessories_page9.html.
>
> Within the structure I should also be able to set another string as well as the outputstring or additional code.
>
> Longwinded Quick Example:
>
> IF X IS BETWEEN 1 AND 10 OF ARRAY THEN
> 	SET OUTPUTSTRING TO "caraccessories_page1.html"
> ELSE IF X IS BETWEEN 11 AND 20 OF ARRAY THEN
> 	SET OUTPUTSTRING TO "caraccessories_page2.html"
> ELSE IF X IS BETWEEN 21 AND 30 OF ARRAY THEN
> 	SET OUTPUTSTRING TO "caraccessories_page3.html"
> ....
> etc
> yuck
> ....
> END IF
>
> The code also needs to incorporate/handle something like this: ( || signifies a quote mark )
>
> SET PAGEHANDLE TO "<a href=||blah.html||>1-10</A><a href=||blah.html||>11-20</A><a href=||blah.html||>21-30</A><a href=||blah.html||>1-40</A>||"
>
> ^^^^^  --- this can be dynamic depending on the number of items in the array
>
> And of course if the user is currently viewing 21-30 then the A link should not be clickable.
>
> Hope this makes sense and look forward to anyone's help.
>
> Rikki.
>

Rikki,
without going many of the details of your code.
Your repeat loop would be something like this

---
repeat with x from 1 to 97
if x mod 10 = 0 then set OUTPUTSTRING to "caraccessories_page"&(x div 10)&".html"
blah blah
end repeat

---

Adjust it to your needs


Deivy Petrescu
email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help with Logic
      • From: Daniel Rodrigue <email@hidden>
References: 
 >Help with Logic (From: Richard Lake <email@hidden>)

  • Prev by Date: Help with Logic
  • Next by Date: Re: Help with Logic
  • Previous by thread: Help with Logic
  • Next by thread: Re: Help with Logic
  • Index(es):
    • Date
    • Thread