form-editor
Skill4 starsChanged 29 days agoMITView on GitHub
Guide for editing VFP forms (.scx/.sc2 files). Use when modifying forms, understanding form structure, editing form code, or working with controls and events.
In this repository3 other files it gives its agents.
- debug-helperSkill
- sql-helperSkill
- vfp-conventionsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Add/remove code lines within existing methods
- Distinctive: line 27
Add new objects to forms (buttons, textboxes, etc.)
- Distinctive: line 28
Delete objects from forms
- Distinctive: line 29
Add new methods/events to objects
- Distinctive: line 167
MANDATORY: when editing .sc2 files:
- Distinctive: line 183
If using text-based version control:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
VFP Form Editor Guide
Understanding VFP Forms
VFP forms are stored in binary .scx files (with .sct memo). For version control, many teams convert to text format using FoxBin2Prg.
| File Type | Format | Use |
.scx/.sct | Binary | VFP IDE uses this |
.sc2 | Text | Version control, Claude editing |
What AI CAN Do
- Edit code in existing procedures/methods
- Modify object properties (Caption, Value, Enabled, etc.)
- Edit .prg files completely
- Add/remove code lines within existing methods
What AI CANNOT Do
- Add new objects to forms (buttons, textboxes, etc.)
- Delete objects from forms
- Add new methods/events to objects
- Modify form structure (add containers, pages, etc.)
Reason: VFP forms have complex binary relationships that require the VFP IDE to manage correctly.
.sc2 File Structure
*-- Header
PLATFORM,UNIQUEID,TIMESTAMP,CLASS,CLASSLOC,BASECLASS,...
*-- Form Definition
CLASS,BASECLASS,OBJNAME,PARENT,PROPERTIES,PROTECTED,METHODS,OBJCODE,NAME
*-- Properties Block
Name = "myform"
Caption = "My Form (ver.1)"
Top = 0
Left = 0
Height = 600
Width = 800
...
*-- Methods Block
PROCEDURE Init
*-- Initialization code
ENDPROC
PROCEDURE cmdSave.Click
*-- Button click handler
ENDPROC
*-- Child Object Definition
CLASS,BASECLASS,OBJNAME,PARENT,...Editing Properties
Change Caption with Version
*-- Find the Caption line in Properties section
Caption = "Client Editor (ver.15)"
*-- Increment version when making changes
Caption = "Client Editor (ver.16)"Common Editable Properties
| Property | Type | Example |
Caption | String | "Save" |
Value | Varies | 0, "", .T. |
Enabled | Logical | .T., .F. |
Visible | Logical | .T., .F. |
Top, Left | Numeric | 10, 20 |
Height, Width | Numeric | 25, 100 |
FontName | String | "Segoe UI" |
FontSize | Numeric | 9 |
BackColor | Numeric | RGB(255,255,255) |
ForeColor | Numeric | RGB(0,0,0) |
ToolTipText | String | "Click to save" |
Editing Methods
Locate Method Block
PROCEDURE methodname
*-- Method code here
ENDPROCCommon Events to Edit
| Event | Fires When |
Init | Object is created |
Destroy | Object is destroyed |
Click | User clicks |
DblClick | User double-clicks |
Valid | Focus leaves (validation) |
When | Focus enters (permission) |
InteractiveChange | Value changes (interactive) |
ProgrammaticChange | Value changes (code) |
GotFocus | Focus received |
LostFocus | Focus lost |
KeyPress | Key pressed |
Refresh | Refresh called |
Button Click Example
PROCEDURE cmdSave.Click
IF THISFORM.Validate()
THISFORM.SaveData()
THISFORM.Release()
ELSE
MESSAGEBOX("Please fix errors before saving.", 48, "Validation")
ENDIF
ENDPROCForm Init Example
PROCEDURE Init
*-- Load data
IF !THISFORM.LoadData()
MESSAGEBOX("Failed to load data.", 16, "Error")
RETURN .F.
ENDIF
*-- Set defaults
THISFORM.txtName.SetFocus()
RETURN .T. && Return .F. to prevent form from opening
ENDPROCGrid DynamicProperties
Grids support dynamic coloring based on data:
*-- In form Init or grid setup
LOCAL lcBackExpr
lcBackExpr = "IIF(nstatus=1, RGB(200,255,200), " + ;
"IIF(nstatus=2, RGB(255,200,200), " + ;
"RGB(255,255,255)))"
THIS.grdData.Column1.DynamicBackColor = lcBackExpr
THIS.grdData.Column2.DynamicBackColor = lcBackExprVersion Tracking Rule
MANDATORY when editing .sc2 files:
- Find the form's Caption property
- Increment the version number
- Keep format:
"Form Name (ver.N)"
*-- Before
Caption = "Client Editor (ver.15)"
*-- After your edit
Caption = "Client Editor (ver.16)"FoxBin2Prg Workflow
If using text-based version control:
1. Developer edits .sc2 file (text)
2. Run conversion: DO foxbin2prg.prg WITH "formname.sc2"
3. Test in VFP with resulting .scx
4. Commit .sc2 to version controlCommon Form Patterns
Modal Form for Data Entry
*-- Parent form calls:
LOCAL loData
loData = CREATEOBJECT("Empty")
ADDPROPERTY(loData, "cName", "")
ADDPROPERTY(loData, "lSaved", .F.)
DO FORM frmEdit WITH loData
IF loData.lSaved
*-- Save to database
INSERT INTO clients (cname) VALUES (loData.cName)
ENDIFChild form stores in passed object:
PROCEDURE cmdOK.Click
THISFORM.oData.cName = THISFORM.txtName.Value
THISFORM.oData.lSaved = .T.
THISFORM.Release()
ENDPROCFilter/Refresh Pattern
PROCEDURE cmdFilter.Click
LOCAL lcWhere
lcWhere = "1=1"
IF !EMPTY(THISFORM.txtSearch.Value)
lcWhere = lcWhere + " AND cname LIKE '%" + ;
sql_quote(ALLTRIM(THISFORM.txtSearch.Value)) + "%'"
ENDIF
example_sql_execute("SELECT * FROM clients WHERE " + lcWhere, "qryClients")
THISFORM.grdClients.RecordSource = "qryClients"
THISFORM.grdClients.Refresh()
ENDPROCChecklist for Form Modifications
- Read the .sc2 file before editing
- Locate the correct method/property
- Make the change
- Increment version in Caption
- Run conversion tool (if using text workflow)
- Test in VFP
Resources
- FoxBin2Prg - Binary to text conversion
- PEM Editor - Enhanced property editor
- VFPX Community
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

