I am having a problem with using $R.. Here is my code. var start = 3; var end = 17; var days = $A($R(start, end)); If I spit that out to the consol using console.log(days.inspect()); I get [''3'', ''4'', ''5'', ''6'', ''7'', ''8'', ''9''] Why is it stopping at 9??? setting end to anything below 10 works, but 10 and up ends at 9 ... Am I missing something?? ______________________________________________________________________ Alex Duffield --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I am having a problem with using $R.. Here is my code. var start = 3; var end = 17; var days = $A($R(start, end)); If I spit that out to the consol using console.log(days.inspect()); I get [''3'', ''4'', ''5'', ''6'', ''7'', ''8'', ''9''] Why is it stopping at 9??? setting end to anything below 10 works, but 10 and up ends at 9 ... Am I missing something?? ______________________________________________________________________ Alex Duffield --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Works for me on the Prototype site, with exactly your lines of code. However, where does that inspect() output come from? It uses *strings* instead of numbers as array members. So I suspect it does not match at all the lines of code you mentioned. My Firebug session on http://prototypejs.org says:>>> var start = 3; var end = 17; var days = $A($R(start, end)); >>> console.log(days.inspect());[3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
OK, if this hapens to any one else, make sure that your numbers are
actualy numbers (integers) and not a string..
If your number from $F(''selectID'') than it wil be a string and
not an
integer..
I used
var start = $F(''selectID'')*1
to force it to be an integer and all worked well.
______________________________________________________________________
Alex Duffield ❖ Principal ❖ InControl Solutions . http://
www.incontrolsolutions.com
On 5-Jun-07, at 12:10 PM, Alex Duffield wrote:
>
> I am having a problem with using $R..
>
> Here is my code.
>
> var start = 3;
> var end = 17;
>
> var days = $A($R(start, end));
>
> If I spit that out to the consol using
> console.log(days.inspect());
>
> I get
>
> [''3'', ''4'', ''5'',
''6'', ''7'', ''8'',
''9'']
>
> Why is it stopping at 9???
>
> setting end to anything below 10 works, but 10 and up ends at 9 ...
>
> Am I missing something??
>
> ______________________________________________________________________
> Alex Duffield
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Yes, I also noticed that inspect was showing me strings.. it turns out I was passing $R strings and not integers.. Now I know better. Thanks. ______________________________________________________________________ Alex Duffield ❖ Principal ❖ InControl Solutions . http:// www.incontrolsolutions.com On 5-Jun-07, at 12:53 PM, Christophe Porteneuve wrote:> > Works for me on the Prototype site, with exactly your lines of code. > > However, where does that inspect() output come from? It uses > *strings* > instead of numbers as array members. So I suspect it does not > match at > all the lines of code you mentioned. > > My Firebug session on http://prototypejs.org says: > >>>> var start = 3; var end = 17; var days = $A($R(start, end)); >>>> console.log(days.inspect()); > [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---