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

Subscript Outside Defined Range 4

Status
Not open for further replies.

keepingbusy

Programmer
Apr 9, 2000
1,470
GB
Hi All

I have a form that allows a user to paste information into a memo field, Example:

Dave Jones
21 Somewhere Avenue
The Greenacres
Evergreen District
Bristol
BS12 T67

I then use the following code in the click event of a command button to copy the above into seperate fields:
Code:
ALINES(aMyArray, ORDERTEXT)
REPLACE LINE01 WITH aMyArray(1)
REPLACE LINE02 WITH aMyArray(2)
REPLACE LINE03 WITH aMyArray(3)
REPLACE LINE04 WITH aMyArray(4)
REPLACE LINE05 WITH aMyArray(5)
REPLACE LINE06 WITH aMyArray(6)
REPLACE LINE07 WITH aMyArray(7)

Most of the time there will be 7 lines of text in the memo field, but there could be anything between 5 and 8 lines.
If there isn't the exact 7 lines then an error message appears as in the thread title Subscript Outside Defined Range

Please can anyone suggest a method or way around this error?

Many thanks
Lee...

VisFox Version 6 User / Windows ME
 
Thank you Olaf and dbMark for the last posts. I agree ithas been "an enlightening discussion"

Olaf, "It's not a very well known band, was a one hit wonder here in germany in the 90ies"

Thats why I hadn't heard of them!!

Take care all
Lee....

VisFox Version 6 User / Windows ME
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top