Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GATHER FROM ArrayName MEMO bug
Message
From
03/08/2000 17:09:50
 
 
To
03/08/2000 16:43:22
Paul Mender
Mender Software Development
Edgewater, Colorado, United States
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00400647
Message ID:
00400727
Views:
17
Right. Because it's expecting all the values from one field to be in one element.
If you try to get the value of an array by simply accessing the array like any other variable, you only the first element of the array.
dimension lax(2)
lax[1] = "One"
lax[2] = "Two"
? lax
** output is "One"
Which is what happens when you GATHER from an array created by ALINES()
e.g., the gather and replace here do the same thing - give you the first element only:
alines(lax, memofield)
gather fields memofield from lax memo
replace memofield with lax
likewise, they do the same thing here - this time, they give you the whole field:
dime lax(1)
lax[1] = alltrim(memofield)
gather fields memofield from lax memo
replace memofield with lax
because the first element has the value right out of the memo field, which includes the carriage returns
So SCATTER TO is basically a shortcut for
dimension ladata(fcount(),1)
for ji = 1 to fcount()
  ladata[ji,1] = eval(field(ji))
endfor
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform