Skip to main content

Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

If I remember right Rumba scripting does not support dynamic arrays so you would have to declare the array with the number of elements you want. The script below will loop through your string and put each element into the array

Sub Main

dim strArray(4) as string

dim result as string

for i = 1 to 4

StrParse  "NA,Ok,TL,JK",",",i,result

strArray(i) = result

'msgbox(strArray(i))

next i

End Sub


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

If I remember right Rumba scripting does not support dynamic arrays so you would have to declare the array with the number of elements you want. The script below will loop through your string and put each element into the array

Sub Main

dim strArray(4) as string

dim result as string

for i = 1 to 4

StrParse  "NA,Ok,TL,JK",",",i,result

strArray(i) = result

'msgbox(strArray(i))

next i

End Sub


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

Hi Naveen, Hi elcron,

Rumba scripting does support dynamic arrays, it also support the Preserve keyword. Here is some sample code to demonstrate how one can split a string using InStr

Sub Main

dim strArray() as string

dim result as string

dim i as Integer

dim count as Integer

i = 1

      count = 1

       ReDim strArray(count)

myString = "NA,Ok,TL,JK"

Do while InStr(i, myString, ",") > 0

result = Left (myString,InStr(i, myString, ",")-1)

myString = Right (myString, Len(myString)-InStr(i, myString, ","))

strArray(count-1) = result

count = count 1

ReDim Preserve strArray(count)

i = i 1

Loop

strArray(count-1) = myString

For i = 0 to UBound(strArray)-1

Msgbox strArray(i)

Next i

End Sub


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

Thanks a lot


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

Thanks a lot


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

It helped me thanks


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

It helped me thanks


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

Thats really good to know, thanks. The CHM file I have for scripting must be out of date. On declaring an array it reads "Ways to Declare an Array

Rumba Scripting Language does not support Dynamic arrays. "


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

Hi elcron,

My chm says the same and I'm on 9.4.

However, if you <F1> in the Script editor and check the ReDim command, it's stated in there.

Note, it says nothing about the Preserve option, but it works. If you leave it out, you will lose your member values.


Please help me,

I want to parse entire string delimiter "," and store each word in an Array

Used Split and StrParse function to parse it

Below are the code snippet used :

Dim strArray() As String

StrArray() = Split("NA,Ok,TL,JK",",")

This code gives an error

example-2

StrParse ("NA,Ok,TL,JK",",",3,Result)

In this,limitation is I cannot parse and get all the words

this gives only TL because item reference is 3

What should be the item reference number to get all the words.

Please provide me the code snippet.


#Rumba

Hi elcron,

My chm says the same and I'm on 9.4.

However, if you <F1> in the Script editor and check the ReDim command, it's stated in there.

Note, it says nothing about the Preserve option, but it works. If you leave it out, you will lose your member values.