You learn something new every day, or I did at least.
While working on a function to return an array of values, I noticed a feature I was never aware of until now. I was playing with redefining a variable from character to an array in case a character was passed to a UDF instead of an array. For example:
laFiles = ""
lnRetVal = GetFolders(@laFiles, "C:\Windows")
My UDF, GetFolders, redefines laFiles as an array and populates it with all the C:\Windows subfolders.
When I was through, laFiles was a 16x5 array. Then I typed
laFiles = "" in the command window. Instead of laFiles being an empty character variable, all the array elements were initialized to a blank character field.
So, instead of leaving all array elements defaulting to a logical false or looping through the entire array to initialize all elements, you can initialize all elements to the same value with 1 command.
I am using VFP 6 SP3, so I would be interested to know if prior versions did this and I am just late in catching on to this.
Mark McCasland
Midlothian, TX USA