Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lost Array Elements on a redimension
Message
From
03/04/2000 11:21:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Lost Array Elements on a redimension
Miscellaneous
Thread ID:
00354325
Message ID:
00354325
Views:
44
I am passing an array by reference to a method which strips a comma delimted string of random length into its component parts and adding each one to the array.

This method has been in use for over 6 months as a component of a number of systems.

The problem in the latest system is that each DIMENSION of the passed array resets all the existing elements to .F.

I reproduce the same effect from the command line. Below is an example of what i am doing, I would be grateful if anyone could let me know if they have come across this or are aware of any environment setting that would cause a re-DIMENSION to clear an array's elements.

Many thanks in advance,


Ben Sugden

I.e.
*-- Method passing Array
LOCAL lcString
lcString = "Element1, Element2, "... ", Elementn"

DIMENSION laContents[1]

THIS.PopulateArray(@laContents, lcString)


*-- THIS.PopulateArray Method, receives array
LPARAMETERS taReferredArray, tcString

*-- Code to strip string and loop for each section
FOR lnCount = 1 TO lnSections
DIMENSION taReferredArray[lnCount] && Here is where the issue occurs
taReferredArray = lcStrippedValue
ENDFOR
Ben Sugden

"Remember to enjoy hunting - and that means relishing the search for the product that has never been advertised or placed handily at the front of the shop; Life begins on the uppermost shelf, avoid guide books and top 10's like the plague." - Ramsey Dukes
Next
Reply
Map
View

Click here to load this message in the networking platform