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

scatter memvar stopped working

Status
Not open for further replies.

csr

Programmer
Jul 20, 2000
507
I have software that was written some time ago in a previous version of VFP. I am not sure of the version but it may have been as far back as Version 6. I am not attempting to rebuild it in version 9.

It chokes on this line of code: scatter memvar to aMother

I checked the help but couldn't see any obvious problem with this code.

Any thoughts on this ?



Don


 

Does it throw you an error? What exactly does it say?
Or just doesn't create an array?
 
SCATTER MEMVAR doesn't accept TO clause


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
scatter memvar to aMother

I am surprised this ever worked. The SCATTER command is either...
Code:
SCATTER TO <arrayname>
which creates an array with an element for each data field, or...
Code:
SCATTER MEMVAR
which creates a memory variable for each field. 'TO' and 'MEMVAR' are no appropriately used in the same command.

pamela
 
Tamar,
I said - SCATTER MEMVAR doesn't accept TO:
Code:
CREATE CURSOR crsTest (Fld1 I)
APPEND BLANK
SCATTER MEMVAR TO aTest &&& BOOOM
SCATTER TO aTest && YES


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 

SCATTER MEMVAR TO ..., even though shouldn't be used in the same command, doesn't throw an arror, at least in VFP6. It just ignores the MEMVAR part, and SCATTERs to an array. Justed tested again today.

Don, remove the MEMVAR part, and leave SCATTER TO ...
 
SCATTER MEMVAR changed in VFP 9.0 -- and the change is properly documented.

In VFP 8.0 and below, SCATTER MEMVAR TO <array name> did not throw an error (though didn't necessarily produce the correct result). That changed in VFP 9.0.

See Changes in Functionality for the Current Release in the VFP 9.0 Help.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Aren't we talking about VFP9 here?

As Don wrote in his first message:
I am not attempting to rebuild it in version 9.

BTW I always prefer to use: SCATTER NAME oScatName, not memvar not array, then managing is easier and this worth a few microseconds delay :)

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 

Well, as I understood it, the application "was written some time ago in a previous version of VFP...it may have been as far back as Version 6".

Looks like this application worked as is for some time (probably it was run either as EXE, or from a previous version of VFP), now stopped.

Probably Don, not trying to rebuild it in VFP9, running it in VFP9 development environment (or with VFP9 run-time files)?

Otherwise (if it was run as an executable) it would continue to work.

In this case, if he is trying to make it work without rewriting, he should probably remove the word MEMVAR. On the other hand, it may very likely be not the only place where it would have problems. Maybe it should be reinstalled with the original run-times?
 
Mea culpa. SCATTER MEMVAR TO was one of my common errors in FP2.x.

Also, I suspect where it says "not" in the original message, it's supposed to be "now."

Tamar
 
Tamar: Thank you for pointing out the NOT / NOW oversight.
I mean't to say .. I am NOW attempting to rebuild it in VFP 9.

I have since corrected the syntax of the statement and it builds fine now.

Thanks for the help from all.

Don


Don


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top