Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fast path from FoxPro 2.x DOS to VFP
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00786377
Message ID:
00786450
Views:
230
This message has been marked as the solution to the initial question of the thread.
German

This is the process we use.
1. Converting FoxPro DOS project to VFP.
	1. Copy all application directories and files from the DOS development directory to a new VFP development directory.
	2. Open the copied project in VFP. When the Visual FoxPro Converter dialog opens, uncheck "Backup files" and make
		 sure "Functional conversion" is selected. Click "Continue".
	3. Before the first form file is converted the Visual FoxPro Transporter dialog will open. Click the "Font..." button
 		and select "Arial, Regular, 10" and click "OK". Make sure "Don't ask for SCX files" is selected 
		and click "Transport".
	4. Before the first report file is converted the Visual FoxPro Transporter dialog will open. 
		Make sure "Don't ask for FRX files" is selected and click "Don't Transport". 
		Report files need to be converted one at a time later.

2. Converting FoxPro DOS startup code to VFP. This code is usually in the MainMenu Setup snippet.
	1. See the TaskTrak Main Menu Startup and Cleanup snippets. 
	2. If you have a database field, <field_name>, that is encrypted you will need to add the following line of code 
		after the database is opened so that code page translation is not used on that field.
	  		SET NOCPTRANS TO <field_name>
	3. The default in VFP is Exclusive ON, so make sure there is a "SET EXCLUSIVE OFF" before opening any databases.

3. Converting FoxPro DOS forms to VFP.
	1. Make sure that the "Windows Standard" scheme is selected on the "Appearance" tab of your Desktop Display 
		Properties dialog. Otherwise the form colors you select may not be the same on other machines. 
	2. Select "Options..." on the Tools menu. On the "Forms" tab, make sure the "Maximum Design Area" is set 
		to "800 x 600".
	3. Double click on a form in the Project Manager to open it in the Form Designer. 
		Make sure the "Show Position" command on the View menu is checked.	
		NOTE: Error loading file_record number 6. imglmage 7 <or one of its members> color source: 
			Expression evaluated to an illegal value.  
		When you receive this error open the .SCX as a dbf file and look for the color source expression 
		and change it to 4 or look at a .SCX that has been modified and check the number and replace with 
		that number in the non-working SCX.
	4. Select the form in the Properties dialog dropdown. This will usually be a computer generated name and the 
		second item in the list. 
	5. Double click on the BackColor property and select gray in the color picker dialog. 
		The BackColor should change to "192,192,192".
	6. Double click on the BorderStyle property to change it to "3 - Sizable".
	7. Click on the Icon property and enter "u:\vfp\library\graphics\cds.ico".
	8. Make sure the ControlBox, Movable and ShowTips properties are set to ".T. - True".
	9. Double click on the WindowType property to change it to "1 - Modal".
	10. Right click on the form and select "Edit" from the popup menu. You can now cleanup the form objects and 
		resize the form as necessary. Most line objects will convert to yellow. Select them and change the 
		BorderColor property to Black or "0,0,0".  Select all of the Text and Command Button objects and 
		change the AutoSize property to True. The font used in Drop Down, Radio and Command Buttons does not get 
		converted. They should be changed to "Arial, 10". Command buttons look better if they are Bold.  
		NOTE: Screens with listboxes need to be called from the spr. of the calling program.  
			If not they will not display. An example is the IMPORT.spr of the MAT application calling the 
			DISPINFO.spr. The call was placed in the load of the IMPORT.spr during the functional conversion.
	11. Double click anywhere on the form to open up a code window. Page down thru the code and look for code that 
		may cause problems in VFP. If necessary run the Tools, Beautify command. If any extended ASCII characters 
		are found, they will need to be changed. For instance, the check-mark character is often used to mark records 
		in drop-down list boxes. It will need to be changed to ">". 
	12. When determining the width of text entry fields, use the following formula for 10 point Arial.  
		24 + (ND - 1) * 6 + 2 * SC; where ND is the number of digits or characters and SC is the number of special 
		characters, such as commas, decimal points or slashes. For example, the width of a date field is 70.
	13. When you are finished, select the form again in the Properties dialog dropdown. Double click on the BorderStyle 
		property until it changes to "2 - Fixed Dialog".
	14. Tap Ctrl+W to save and close the Form Designer.
	15. Repeat steps 3 through 13 for each form.
	16. After you have cleaned up all of the forms you are ready to test them. The easiest way to do this is to close 
		the Project Manager and open the Project database (.PJX) in the Data Session window. Browse the database. 
		In the Command window type "replace exclude with .T. for type = "K". This will exclude all of the forms from 
		the project so that you can edit them when the application is running. Close the Project database and the 
		Data Session window. Open the Project in the Project Manager, build an application and run it with the Project 
		Manager still open. Make sure the Debugger is also running and that there is a watch on "PROGRAM()". 
	17. Select each menu item in turn and exercise all of the forms. If you find a form that needs some fine tuning, 
		Alt+Tab to the Debugger and look at the value of PROGRAM() to get the form name. Close the form and open it 
		from the Project Manager. Make the needed modifications, close the form and save the changes. You can now 
		exercise the form in the application and see your changes. 
	18. When you are finished fine tuning the forms. Quit the application, close the Project Manager and open the Project 
		database (.PJX) in the Data Session window. Browse the database. In the Command window type 
		"replace exclude with .F. for type = "K". This will include all of the forms in the project. 
		Close the Project database and the Data Session window. Open the Project in the Project Manager and rebuild 
		the application.

4. Converting FoxPro DOS reports to VFP. Converting FoxPro DOS reports to VFP is the most time consuming part of moving 
		an app from DOS to VFP. The following procedure should make it easier.
	1. Make sure all Reports in the Docs section of the Project Manager are excluded and that the Reports directory 
		is in the app path command. Then, build a Win32 executable file.
	2. Start FoxPro DOS and open the original DOS version of the app. As you convert each report you will need to know 
		if the DOS version is printed in portrait or landscape and how many columns wide it is.
	3. Start the Win32 Executable version of the app that you built in step 1. 
	4. You will need to look at the DOS version or the report and the screen or program that generates the report to 
		determine if it is printed in compressed type. If it is you will need to select "Arial, Regular, 8" for the 
		Transport type style. Otherwise, "Arial, Regular, 10" should work.
	5. Select a report to convert from the VFP Project Manager. The Visual FoxPro Transporter dialog will open. 
		Click the "Font..." button and select the appropriate font and click "OK". Click "Transport".
	6. When the form is opened, select "Page Setup" from the "File" menu. In the Page Setup dialog make sure 
		"Printable Page" is selected and that the left margin is zero. This will allow you to use the entire white 
		area of the Report Designer. Click on "Print Setup" to change the page orientation. Click "OK". Make as many 
		corrections as you can to the report and tap Ctrl+W to save and close the report.
	7. In the Win32 Executable, select the form from the menu and open it in the Previewer.
	8. Make a note of any corrections that need to be made, right click and select "Print Report to File" from the menu.
	9. When the Print to File dialog is open, tap Alt+Tab to return to the VFP Project Manager. Open the report in the 
		Report Designer, make the corrections and tap Ctrl+W to save and close the report. 
	10. Tap Alt+Tab to return to the Win32 Executable. Select "Cancel" in the Print to File dialog and the corrected 
		report will be displayed.
	11. Repeat steps 8, 9 and 10 until the Report is correct and Close the Previewer.
		NOTE:  Check the environment of the report to see what databases are opened by the report. Remove them and 
		open the database using code (if the dbf is needed). Run the old report and the new report checking that the 
		data is the same.

5. Miscellaneous Notes
	1. FoxPro DOS only uses the first 10 characters of Function and Procedure names. In VFP they can be up to 254 characters. 
		In DOS if the name is defined with more than 10 chars and called with 10 chars, it is not a problem. When the 
		code is converted to VFP the short name will not be defined.
	2.  Use the ROUND() function where division or multiplication is performed. 
		There was a problem in FoxProWin rounded and VFP did not.
	3.  Sometimes a screen may not be converted during the conversion process.  Open it with Modify Screen and it will 
		ask if you want to convert it. Proceed with the functional conversion.
	4.  IF you get a SOURCE NOT FOUND in the debugger, right click at the bottom of the Project Manager - Project Info - 
		Project and check Debug info.
	5.  The logon path was not included in the project, so the path was not accepted.  Right click on Path at the bottom 
		of the Project Manager- Project Info and if the Included box is not checked click in the 
		"UPDATE NATIVE CODE PAGES" AND MARK LOGON INCLUDED.  Check OK and rebuild the app.  Run the app. 
		It should run OK.
	6.  When a list box has a row source type of 2 or 6 (Alias or Fields), programmatically recreating the cursor/table 
		once the form has been loaded can generate the error "cannot access the selected table".  
		This error is intermittent and appears to be caused by VFP detecting that the cursor/table is not available 
		during the rebuilding of it. A work-around for this is to change the list box to have a row source type of 3 or 4 
		(SQL statement or Query) and call <listbox>.Requery() when the contents need to be changed.  This allows VFP to 
		handle the recreation of the cursor/table. The form code may need to be modified so that the cursor/table 
		population can be written as a query or SQL statement.
	8.  When the control source variable for a control on a form unexpectedly becomes undefined, a report by the same 
		name may be the cause. When a report is run using REPORT FORM PREVIEW, VFP creates an object by the name of 
		the report (minus the frx extension). If a form control's control source variable is of the same name, the 
		object replaces the variable while the report is diplayed.  Once the report is finished, the object is destroyed 
		and the variable is not changed back to the simple data type of the control source variable's. Instead, the control 
		source variable becomes undefined until the control is accessed and a value is set again. A work-around is to 
		rename the control source variable or the report so that they have different names.
>Hello:
>
>I've a big and complex accounting and POS system developed in FoxPro 2.5 DOS.
>
>The system is perfectly worthily in functionality, but I'm needing to port to Windows to adequate to the "modern times".
>
>I've experience with VFP, framworks, objects and so, but I can't find a fast path from FoxPro DOS to VFP. The automatic tools of VFP (when a FoxPro project is opened) don't makes a good work.
>
>Does exist some other alternative to not reprogram all the things?
>
>TIA and Best Regards.
Dennis Lindeman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform