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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subsript range error

Status
Not open for further replies.

ts04

Technical User
Jun 14, 2004
69
NL
Hi!

I have used the text-lookup funtion to add some data to the report from an ini-file. I use the following code:

if {@R&D} <> "" then
if
TextLookupLine ("Planned_Stock.ini",{@R&D}) <> ""
then
Split((TextLookupLine ("Planned_Stock.ini",{@R&D})),"=")[2]

The ini-file looks like this:

A1=0911
AB1=0203
AC1=0211
ACB1=0213
AG1=0206
AGB1=0206
AM1=0237
AM3=0831

The following error occurs when running the report:

Error: A subscript must be between 1 and the size of the array
It shows that @R&D is filles with the value "A1" but the funtion which should extract the value from the text file is "expired"

What can I do to make this work. I got it to work earlier, I must have changed something without knowing.

Thanx in advance!

Tanja
 
Thought I just responded to this...

if {@R&D} <> "" then
if
TextLookupLine ("Planned_Stock.ini",{@R&D}) <> ""
and
ubound( Split((TextLookupLine ("Planned_Stock.ini",{@R&D})),"=")) > 1
then
Split((TextLookupLine ("Planned_Stock.ini",{@R&D})),"=")[2]

-k
 
Try:

if {@R&D} <> "" then
if TextLookupLine ("Planned_Stock.ini",{@R&D}) <> ""
and
ubound(Split((TextLookupLine ("Planned_Stock.ini",{@R&D})),"="))>1
then
Split((TextLookupLine ("Planned_Stock.ini",{@R&D})),"=")[2]

-k
 
Try:

if {@R&D} <> "" then
if
TextLookupLine ("Planned_Stock.ini",{@R&D}) <> ""
and
ubound( Split((TextLookupLine ("Planned_Stock.ini",{@R&D})),"="))>1
then
Split((TextLookupLine ("Planned_Stock.ini",{@R&D})),"=")[2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top