create a list of strings?

create a list of strings?

Anonymous
Not applicable
392 Views
4 Replies
Message 1 of 5

create a list of strings?

Anonymous
Not applicable
ok, first off, i don't know vba.. i know lisp..

(list "start" "end" "end2")

easy..

but in vba, i'm lost and can't find anything that explains how this is
done (or if it can)..

my goal is to use it in this code.. (that i pulled from this NG)..
For Each NLType In LLType
ThisDrawing.Linetypes.Load NLType, "acad.lin"
Next

so how can i create a list of names and set them to the variable LLType??

TIA. (first of many questions i will end up asking)
0 Likes
393 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
[code]
Dim urArray
urArray = Array("one", "two", "three")

Dim arrayItem As Variant
For Each arrayItem In urArray
Debug.Print arrayItem
Next arrayItem

'or

Dim i As Integer
For i = 0 To UBound(urArray)
Debug.Print urArray(i)
Next i
[/code]

--
gl - Paul
"C Witt" wrote in message
news:4992341@discussion.autodesk.com...
ok, first off, i don't know vba.. i know lisp..

(list "start" "end" "end2")

easy..

but in vba, i'm lost and can't find anything that explains how this is
done (or if it can)..

my goal is to use it in this code.. (that i pulled from this NG)..
For Each NLType In LLType
ThisDrawing.Linetypes.Load NLType, "acad.lin"
Next

so how can i create a list of names and set them to the variable LLType??

TIA. (first of many questions i will end up asking)
0 Likes
Message 3 of 5

Anonymous
Not applicable
might have been clearer if I wrote.

Dim urArray
as
Dim urArray() As Variant

urArray is now a 'Variant array' from the get
go, instead of just a 'Variant'. If no type is listed,
'Dim urArray', then Variant is understood
as the default.

--
gl - Paul
"Paul Richardson" wrote in message
news:4992358@discussion.autodesk.com...
[code]
Dim urArray
urArray = Array("one", "two", "three")

Dim arrayItem As Variant
For Each arrayItem In urArray
Debug.Print arrayItem
Next arrayItem

'or

Dim i As Integer
For i = 0 To UBound(urArray)
Debug.Print urArray(i)
Next i
[/code]

--
gl - Paul
"C Witt" wrote in message
news:4992341@discussion.autodesk.com...
ok, first off, i don't know vba.. i know lisp..

(list "start" "end" "end2")

easy..

but in vba, i'm lost and can't find anything that explains how this is
done (or if it can)..

my goal is to use it in this code.. (that i pulled from this NG)..
For Each NLType In LLType
ThisDrawing.Linetypes.Load NLType, "acad.lin"
Next

so how can i create a list of names and set them to the variable LLType??

TIA. (first of many questions i will end up asking)
0 Likes
Message 4 of 5

Anonymous
Not applicable
thank you.

there should be a list somewere that compares lisp to vba.. ugh..
0 Likes
Message 5 of 5

Anonymous
Not applicable
your welcome...

your could also dimension your array as a string,
and give it a specific size as such.

Dim urArray(0 To 2) As String
urArray(0) = "one"
urArray(1) = "two"
urArray(2) = "three"


--
gl - Paul
"C Witt" wrote in message
news:4992420@discussion.autodesk.com...
thank you.

there should be a list somewere that compares lisp to vba.. ugh..
0 Likes