Microsoft KB Archive/195514

= FIX: Error Loading File When Converting a 2.6 Form in VFP 6.0 =

Article ID: 195514

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q195514



SYMPTOMS
When you open a converted 2.6 form in Visual FoxPro 6.0, the following error message appears if the converted 2.6 form has a radio button control or a line object:

Error Loading File - record number...ColorSource: Expression evaluated to an illegal value.



CAUSE
The value three (3) is assigned to ColorSource for both the option group control and the line object during the conversion. A ColorSource property of three is invalid for both of the controls in Visual FoxPro 6.0.

Invisible buttons have this problem, too.

Shape objects might also have this problem.



RESOLUTION
There are at least three methods for resolving this problem. They are listed below.

NOTE: Before attempting any of these resolutions, back up your files.

Method 1

 * 1) Open up the form file (.scx) as a table.
 * 2) Go to the Properties column of the offending record, and change the ColorSource value from three to four.

For further information, refer to step 4 in the following Steps to Reproduce Behavior section.

Method 2
This method works for Invisible Buttons as well as Option Groups.

Modify the Convert.app as follows:

NOTE: The source code for Convert.app is located in the ..\VFP98\Tools\Convert folder.  Open the Convert.pjx and click the Other Files tab. Under Text Files, open the convert file. This is a header file (.h) that defines constants used in the Convert.app.  Search for I_DEFCOLORSOURCE. Your search should find the following line: #DEFINE I_DEFCOLORSOURCE  3&& default color source  Change the 3 to a 4, and save and close the file. Rebuild the Convert.app from the Project Manager. Copy the new Convert.app to the ..\VFP98 folder. Be sure to verify that the _converter system memory variable points to the correct file. You can also check this in the Options dialog box by clicking the File Locations tab and looking at the path listed under Converter.</li></ol>

Method 3
Use the Visual FoxPro Transformer application.

NOTE: This is probably the best solution because other aspects of converted forms can be changed with the Transformer, many forms at one time. The Transfrm.app is located in the ..\VFP98\Tools\Transfrm folder.

Note that as the Help file states:

"The Transformer is not supported by Microsoft Support Services either electronically or via telephone."

To learn more about the Transformer, go to the Transformer topic in Visual FoxPro Help. "Help Transformer," without quotes, typed in the Command window should bring it up.

To use the Transformer to resolve the problem described in this article, follow these steps after doing a Functional conversion on the form(s): <ol> Run the Transfrm.app. It might be easier to copy it to the VFP98 directory first and use DO HOME+"transfrm.app" to start it.</li> On the Files tab, add your .scx file or the directory that contains the .scx files that need transformed.</li> In the Rules tab, fill in the following:

Property: colorsource

Value: 4

Files: *.scx

Classes: OptionGroup

</li> Click Add to add this rule. Do the same for Invisible Buttons and Line and Shape objects if the converted forms contain them.</li> To save these rules for use at a later time, click the save button and type a table name.</li> On the Log tab, deselect the Create Log Only check box and click Transform.</li> The converted form(s) should now open without errors.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3 for Options Groups.

This problem was not corrected for Invisible Buttons.

For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol> In FoxPro for Window 2.6, create a screen, place a radio button on the screen, and save the screen.</li> Open the 2.6 screen in Visual FoxPro 6.0. When Visual FoxPro prompts you for a conversion, select functional conversion.</li> After conversion, the following error message appears:

Error loading file - record number 5. opgOpt1 .ColorSource: Expression evaluated to an illegal value.

</li> To open the form in Visual FoxPro 6.0, open the .scx as a table with the USE command, for example:

USE myscreen.scx.

</li> In the command window, perform a BROWSE, go to the Properties column of the offended record (as described in the error message), and double- click to open the memo window.</li> Change the ColorSource value from 3 to 4.</li> Save the changes, and close the table.</li> Open the form in Visual FoxPro 6.0.</li></ol>

Keywords: kberrmsg kbbug kbfix kbmisctools kbcontainer kbctrl kbvs600sp3fix KB195514

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.