Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    New York
    Posts
    152
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Question For Loop Never Executing

    Here is the precondition: sect1.days = "MW"

    My for loop starts out like this: for (var dA:String in sect1.days)

    Why wouldn't this loop execute? -- because it isnt.

  • #2
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    379
    Thanks
    9
    Thanked 39 Times in 39 Posts
    what is the value of dA? It needs to be "M" or "W". Anything else, including "m" and "w" wont work.
    Last edited by Stooshie; 03-27-2008 at 04:10 PM. Reason: Typo
    Regards, Stooshie
    O

  • #3
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,008
    Thanks
    59
    Thanked 10 Times in 10 Posts
    Hey Stooshie Howz things up there in Dundee! Its a nice part of Scotland, but of a treck though from Glasgow


  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    New York
    Posts
    152
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Well, dA takes on those values, right? I don't need to explicitly assign a value to it because that's what the for .. in does, right?

  • #5
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    379
    Thanks
    9
    Thanked 39 Times in 39 Posts
    My bad. you are right.

    But shouldn't days be an array, or are you asking it to loop throught twice (M then W)?

    Can you give me a little more info in what you are trying to do?

    Hi nikos101. Always nice to see another programmer from Scotland.
    Regards, Stooshie
    O

  • #6
    Regular Coder
    Join Date
    Aug 2002
    Location
    New York
    Posts
    152
    Thanks
    12
    Thanked 0 Times in 0 Posts
    days is a String, which I always thought of as an array of characters, thus it is iterable. This is a concept from Java, maybe it doesn't carry over into ActionScript?

  • #7
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    379
    Thanks
    9
    Thanked 39 Times in 39 Posts
    I don't think it is the same. However here is a link to functions for that purpose:

    http://www.actionscript.org/actionsc...String_Object/

    Hope it helps.
    Regards, Stooshie
    O

  • #8
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,008
    Thanks
    59
    Thanked 10 Times in 10 Posts
    hey Stooshie know of any big projects in dundee looking for php'ers


  • #9
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    379
    Thanks
    9
    Thanked 39 Times in 39 Posts
    Nothing doing at the moment nikos101, as far as I can tell. Although I've been busy recently and not really been looking much.
    Regards, Stooshie
    O


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •