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

Viewing .mem files 3

Status
Not open for further replies.

PatMcLaughlin

Programmer
Dec 10, 2010
97
US
I am in the process of rewriting an old foxbase program to vb.net. In the old process, they used numerous '.mem' files. I need to see what is in these files but can find no way to open them. Can you help me out?
 
Not so easy, if you want to open them in .NET. They are binary files and you need Foxpro to read them back into memory variables. The result is memory variables are created in the state and with the names they were saved in.

Bye, Olaf.
 
In that case, you could so something like this:

First, load a fresh instance of the VFP development environment (to ensure there are no variables in existence).

Then:

Code:
SET ALTERNATE TO MyVariables.TXT
SET ALTERNATE ON
RESTORE FROM MyMemFile.MEM
LIST MEMORY LIKE *
SET ALTERNATE OFF
SET ALTERNATE TO

You will end up with a text file containing the names, data types, scope and values of all the relevant variables.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yes, warp this up in a OLEPUBLIC class and compile it as COM Server, then you may also use it at runtime in .NET

Bye, Olaf.
 
If they're really from Foxbase, you might need Foxbase to restore. The .mem file format changed somewhere along the way IIRC.
 
I use .mem files in one of my apps. It's a habit I got into on my first Foxpro job in which we used FPW 2.6a, IIRC. It's a PITA, frankly, and I've been intending for some time to move the functionality to metadata. It's so easy to look at and change metadata residing in Foxpro tables, but .mem files, well, it's a lot tougher to find out what's in them and change it, at least the way I've been doing it. I could automate the process, but I've never done so. When things get out of whack I go to a command window, change to the directory where the .mem file is stored, do a RESTORE FROM, then a DISPLAY MEMORY, change the value of the variable(s), then a SAVE TO. Really a PITA.
 
We might be making too big a deal of this. Isn't it likely that the OP simply wants to see what's in the existing MEM files, to help him understand a Foxbase app which he is rewriting for VB.NET? If that's right, he won't need an automated solution, nor a way of actually opening the files from with the .NET app.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
That's right, Mike. But if you don't have Foxpro (anymore), you couldn't do RESTORE.

Pat asked several times here, but since the last questions rather were from the perspective of .NET and about DBFs and OLEDB Provider, VFP may have been sold already.

Bye, Olaf.
 
Thanks to all, as always I am amazed by your knowledge and willingness to share! I am humbled that Olaf remembers me so accurately from previous posts! Mike, your code was right on... I have saved it to my help files for later use when needed again, and Dan was right on when he pointed out I needed to be using the FoxBase program... Foxpro 7 could not read the .mem files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top