View Full Version : For Loop Never Executing
03-27-2008, 11:15 AM
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.
03-27-2008, 05:10 PM
what is the value of dA? It needs to be "M" or "W". Anything else, including "m" and "w" wont work.
03-27-2008, 08:21 PM
Hey Stooshie (http://www.codingforums.com/member.php?u=60017) Howz things up there in Dundee! Its a nice part of Scotland, but of a treck though from Glasgow :)
03-27-2008, 11:00 PM
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?
03-28-2008, 03:09 PM
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.
03-28-2008, 04:07 PM
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?
03-28-2008, 04:25 PM
I don't think it is the same. However here is a link to functions for that purpose:
Hope it helps.
04-03-2008, 02:06 PM
hey Stooshie (http://www.codingforums.com/member.php?u=60017) know of any big projects in dundee looking for php'ers :)
04-03-2008, 02:25 PM
Nothing doing at the moment nikos101, as far as I can tell. Although I've been busy recently and not really been looking much.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.