Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split Function Won't work on Variable.

Status
Not open for further replies.

ctau

IS-IT--Management
Feb 8, 2000
34
0
0
US
I am pulling one line from a text file that is delimited by |. After I pull it in I want to divide it up into variables. I am using the split function but I can only refrence the first element in the array.


Input #ITEM_FILE, strLINE
STRING_ARRAY = Split(strLINE, "|")

if I say STRING_ARRAY(1) I get an out of range error but
String_ARRAY(0) gives me what it should.

Ctau
 
You didn't show the code where you defined the variable STRING_ARRAY. Whenever I use the Split function I define this variable as a Variant, since it returns an array. I never have a problem with it. Also your array is going to be 0 based unless you're using Option Base 1.

Drop the String_ARRAY on the Watch window when the program is in break mode and open up the variable and see what's in it. This might help shed some light on the problem. Snaggs
tribesaddict@swbell.net
Enter any 11-digit prime number to continue...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top