agentleFS
GSG-DevsGSG-Devs/claude-vfp-skills/skills/form-editor/SKILL.md

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.

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
  1. Distinctive:

    Add/remove code lines within existing methods

    line 23
  2. Distinctive:

    Add new objects to forms (buttons, textboxes, etc.)

    line 27
  3. Distinctive:

    Delete objects from forms

    line 28
  4. Distinctive:

    Add new methods/events to objects

    line 29
  5. Distinctive:

    MANDATORY: when editing .sc2 files:

    line 167
  6. Distinctive:

    If using text-based version control:

    line 183

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 TypeFormatUse
.scx/.sctBinaryVFP IDE uses this
.sc2TextVersion 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

PropertyTypeExample
CaptionString"Save"
ValueVaries0, "", .T.
EnabledLogical.T., .F.
VisibleLogical.T., .F.
Top, LeftNumeric10, 20
Height, WidthNumeric25, 100
FontNameString"Segoe UI"
FontSizeNumeric9
BackColorNumericRGB(255,255,255)
ForeColorNumericRGB(0,0,0)
ToolTipTextString"Click to save"

Editing Methods

Locate Method Block

PROCEDURE methodname
    *-- Method code here
ENDPROC

Common Events to Edit

EventFires When
InitObject is created
DestroyObject is destroyed
ClickUser clicks
DblClickUser double-clicks
ValidFocus leaves (validation)
WhenFocus enters (permission)
InteractiveChangeValue changes (interactive)
ProgrammaticChangeValue changes (code)
GotFocusFocus received
LostFocusFocus lost
KeyPressKey pressed
RefreshRefresh called

Button Click Example

PROCEDURE cmdSave.Click
    IF THISFORM.Validate()
        THISFORM.SaveData()
        THISFORM.Release()
    ELSE
        MESSAGEBOX("Please fix errors before saving.", 48, "Validation")
    ENDIF
ENDPROC

Form 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
ENDPROC

Grid 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 = lcBackExpr

Version Tracking Rule

MANDATORY when editing .sc2 files:

  1. Find the form's Caption property
  2. Increment the version number
  3. 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 control

Common 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)
ENDIF

Child form stores in passed object:

PROCEDURE cmdOK.Click
    THISFORM.oData.cName = THISFORM.txtName.Value
    THISFORM.oData.lSaved = .T.
    THISFORM.Release()
ENDPROC

Filter/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()
ENDPROC

Checklist 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.