Grasshopper

algorithmic modeling for Rhino

Iam trying to do something with VB, every single letter I write is a problem ;]

 

and this is so lame question, but can somebody help me ?

why this does not work ?

 

Dim l1 As Integer = x    

Dim l2 As Integer = y    

While l1 = l2      

l1 = l1 + 1      

print(l1)    

End While

 

obviously x and y are input values. 

Views: 353

Replies to This Discussion

Is the Input a List ? If not the condition l1 = l2  will be only existing once. The next Data from x or y will execute the Script again so Looping is Not possible. Maybe you just want an if( x == y) { A = y + 1; } Else {A = y;} sorry c# i do Not Know how to use vb
Is the Input a List ? If not the condition l1 = l2  will be only existing once. The next Data from x or y will execute the Script again so Looping is Not possible. Maybe you just want an if( x == y) { A = y + 1; } Else {A = y;} sorry c# i do Not Know how to use vb

i have 2 integers (x and y), x is smaller than y. i want to print every x + 1 till it reach y. so if x is 10 and y is 15 the outputed list should be : 

10

11

12

13

14

15

 

thats what i want to achieve :D

Ok ...
In c#:
List temp = New List ();
For ( int i = x; y >= i; i++)
{
temp.add(i);
}
A = temp;

maybe it Works
List
"List < double .>"

Typing

 

While (x<=y)

print(x)

x+=1

End While

 

works and return the expected list of results in the Out output.

You probably thought that the While loop would stop when x=y.

Strangely enough, it will  loop while x=y.   

And if x<>y, well it will not loop at all  =)

thank you for help, it works now ! ;]

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service