hi - i am very new to grasshopper but somehow got into vb - i need to
1) define a string
2) add dynamically to the string from a for loop
3) print the string
i think it goes something like this:
Dim myString As String
Dim i As Integer
for i = 0 to 9
addString (", " (" & i & "))
Print(myString)
unfortunately my addString command doesnt exist - and this doesnt work - does anyone have an idea? i would like the list to be one long line separated by commas
i have a list of 9 values that i want to position in a string as a boolean true or false
the entire length of the string is 264
the 9 values are positions where the number should be 1 (true)
i think i should be doing something like this:
there is a inputList coming into the VB unit (otherwise called a). this is the list of 9 values.
Dim i As int32
Dim n As int32 'n is my temp value for true
Dim knitList(264) As int32
For i = 0 To Len(inputList)
n = inputList(i)
knitList(n) = 1
Next
' i should now have a list with 264 values with 9 true statements in it
' i now want to change the list into a string separated with commas
Dim knitList as New List(Of Int32)
For j as int32 = 0 To 263
knitList.add(0) 'first fill your list with all 0s
Next
For i as int32 = 0 To inputList.Count-1 'i is declared right here, don't declare it before
Dim n as int32 = inputList.Item(i) 'n is temporary, so keep it within the loop
knitList.RemoveAt(n) 'now remove all the values you want to replace
knitList.Insert(n,1) 'now fill in the ones where you removed stuff
Next