Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ruby-india] lbound & ubound equivalent in Ro

Expand Messages
  • Martin DeMello
    ... If you describe what lbound and ubound do, even people without an ms technologies background can help :) ... assuming you mean in a view:
    Message 1 of 2 , Oct 27, 2006
      On 10/13/06, nitinuprit <nitinuprit@...> wrote:
      >
      > hi everyone,
      >
      > can anybody from MS technologies background tell me the equivalent of
      > LBound & UBound functions in Rails?

      If you describe what lbound and ubound do, even people without an ms
      technologies background can help :)

      > Also, how do we write the following VBScript loop in Rails:
      >
      > For i = LBound(x) To UBound(x)
      > ...
      > Next

      assuming you mean in a view:

      <% LBound(x).upto(UBound(x)) do |i| %>

      bunch of code that can use i as a variable

      <% end %>

      in normal ruby code it's just

      LBound(x).upto(UBound(x)) do |i|
      whatever
      end

      martin
    Your message has been successfully submitted and would be delivered to recipients shortly.