Claude & FoxPro Code Injection

Author: Kurt Wendt

Posted: 2026-11-25 at 15:31:26

Hey there folks,

It's been a bit quiet here lately - so, it's time I stirred up some Trouble...

OK - not exactly trouble...

So, the deal is - starting about 9-10 months ago, I started using the Claude Desktop App - instead of accessing Claude via the webpages. This made a HUGE Difference in what I was able to accomplish. And, since then - most of my time has been spent on the C# end of code - mostly in regard to converting FoxPro screens to C#.

The big game changer in using the Desktop App - is that Claude can now Directly manipulate code - to the extent that I can now literally do whole screen conversions without actually touching the C# code. But, I DO Extensive manipulation of the generated screen XAML code - to fine tune the screen layout and design. As such, I am truly doing the Vibe Coding paradigm to software development.

Now, near the beginning when I was using the desktop App - I tried something - which basically failed. That is - I was trying to have Claude directly manipulate FoxPro screen code. Since most ALL of our FoxPro ERP system is based upon Screens - with code behind them. Yes - we have some various PRG files - but, most are the typical SCX/SCT files.

What I tried to have Claude do was directly manipulate the screen code files. But, sadly - when he would attempt it - he would end up essentially corrupting the files - so the screen could no longer be opened in the FoxPro Screen designer.

So, then I started thinking of a completely different attack of the problem. That is - since Screen files (as well as Report forms) are essentially DBF file structures - I could get Claude to write a FoxPro program - which would Open up the screen like a DBF - and basically make direct updates to the various memo fields - then he could help me accelerate making changes to FoxPro screens. And, I DID get this to work. I was Even able to have him insert new controls onto a screen. For me - this was a pretty exciting breakthru. And, yes - he would write the FoxPro programs - and I essentially run them. Of course, after I would run one of these programs - I would then either open the screen in the Designer to confirm changes - or, compile the Project and run it - to test the code changes!

For anyone really interested in seeing some code of what Claude created - and I ran it to modify a screen, one example program is below!

Anyway folks - have a Happy Thanksgiving! Gobble Gobble Gobble...

-Kurt

lcForm = "c:\pako\vfp\production\forms\mfg_status40"

COPY FILE (lcForm + ".scx") TO (lcForm + "_backup.scx")

COPY FILE (lcForm + ".sct") TO (lcForm + "_backup.sct")

**************

lcForm = "U:\MPP Scrn Report\mfg_status40"

COPY FILE (lcForm + ".scx") TO (lcForm + "_backup.scx")

COPY FILE (lcForm + ".sct") TO (lcForm + "_backup.sct")

TEXT TO lcOld1 NOSHOW

SELECT ol_order_num, ol_rel_number, ol_priority, ol_rel_date, ol_end_date, ;

ol_rel_qty as ol_quantity,STR(ol_op_complete,2)+ ' /'+ STR(ol_op_count,2) AS comp_ops, ;

IIF(ol_op_complete<>0,ol_op_lastcom,0) as ol_op_lastcom ;

FROM Orelease ;

INTO CURSOR xxxlstInProcess ;

WHERE ol_part_num=mzzpartno AND ALLTRIM(ol_part_num)==ALLTRIM(mzzpartno) ;

AND ol_rel_stat='O' AND ol_priority <> 999999 ;

AND SUBSTR(ol_order_num,11,1)<>'R' AND NOT DELETED() ;

ORDER BY ol_end_date,ol_order_num,ol_rel_number

ENDTEXT

TEXT TO lcNew1 NOSHOW

* Frank B. request - Overview Rpt In Process order to match MPP In Process grid (Last Op DESC) - KHW & Claude - 11/2/26

*!* SELECT ol_order_num, ol_rel_number, ol_priority, ol_rel_date, ol_end_date, ;

*!* ol_rel_qty as ol_quantity,STR(ol_op_complete,2)+ ' /'+ STR(ol_op_count,2) AS comp_ops, ;

*!* IIF(ol_op_complete<>0,ol_op_lastcom,0) as ol_op_lastcom ;

*!* FROM Orelease ;

*!* INTO CURSOR xxxlstInProcess ;

*!* WHERE ol_part_num=mzzpartno AND ALLTRIM(ol_part_num)==ALLTRIM(mzzpartno) ;

*!* AND ol_rel_stat='O' AND ol_priority <> 999999 ;

*!* AND SUBSTR(ol_order_num,11,1)<>'R' AND NOT DELETED() ;

*!* ORDER BY ol_end_date,ol_order_num,ol_rel_number

SELECT ol_order_num, ol_rel_number, ol_priority, ol_rel_date, ol_end_date, ;

ol_rel_qty as ol_quantity,STR(ol_op_complete,2)+ ' /'+ STR(ol_op_count,2) AS comp_ops, ;

IIF(ol_op_complete<>0,ol_op_lastcom,0) as ol_op_lastcom, ol_op_lastcom AS raw_lastcom ;

FROM Orelease ;

INTO CURSOR xxxlstInProcess ;

WHERE ol_part_num=mzzpartno AND ALLTRIM(ol_part_num)==ALLTRIM(mzzpartno) ;

AND ol_rel_stat='O' AND ol_priority <> 999999 ;

AND SUBSTR(ol_order_num,11,1)<>'R' AND NOT DELETED() ;

ORDER BY raw_lastcom DESC

* EndChg - KHW & Claude - 11/2/26

ENDTEXT

TEXT TO lcOld2 NOSHOW

SELECT ol_order_num, ol_rel_number, ol_priority, ol_rel_date, ol_end_date, ;

ol_rel_qty as ol_quantity,STR(ol_op_complete,2)+ ' /'+ STR(ol_op_count,2) AS comp_ops, ;

IIF(ol_op_complete<>0,ol_op_lastcom,0) as ol_op_lastcom ;

FROM Orelease ;

INTO CURSOR xxxlstInProcess ;

WHERE ol_part_num=mzzpartno AND ALLTRIM(ol_part_num)==ALLTRIM(mzzpartno);

AND ol_rel_stat='O' AND ol_priority <> 999999 ;

AND NOT DELETED() ;

ORDER BY ol_end_date,ol_order_num,ol_rel_number

ENDTEXT

TEXT TO lcNew2 NOSHOW

* Frank B. request - Overview Rpt In Process order to match MPP In Process grid (Last Op DESC) - KHW & Claude - 11/2/26

*!* SELECT ol_order_num, ol_rel_number, ol_priority, ol_rel_date, ol_end_date, ;

*!* ol_rel_qty as ol_quantity,STR(ol_op_complete,2)+ ' /'+ STR(ol_op_count,2) AS comp_ops, ;

*!* IIF(ol_op_complete<>0,ol_op_lastcom,0) as ol_op_lastcom ;

*!* FROM Orelease ;

*!* INTO CURSOR xxxlstInProcess ;

*!* WHERE ol_part_num=mzzpartno AND ALLTRIM(ol_part_num)==ALLTRIM(mzzpartno);

*!* AND ol_rel_stat='O' AND ol_priority <> 999999 ;

*!* AND NOT DELETED() ;

*!* ORDER BY ol_end_date,ol_order_num,ol_rel_number

SELECT ol_order_num, ol_rel_number, ol_priority, ol_rel_date, ol_end_date, ;

ol_rel_qty as ol_quantity,STR(ol_op_complete,2)+ ' /'+ STR(ol_op_count,2) AS comp_ops, ;

IIF(ol_op_complete<>0,ol_op_lastcom,0) as ol_op_lastcom, ol_op_lastcom AS raw_lastcom ;

FROM Orelease ;

INTO CURSOR xxxlstInProcess ;

WHERE ol_part_num=mzzpartno AND ALLTRIM(ol_part_num)==ALLTRIM(mzzpartno);

AND ol_rel_stat='O' AND ol_priority <> 999999 ;

AND NOT DELETED() ;

ORDER BY raw_lastcom DESC

* EndChg - KHW & Claude - 11/2/26

ENDTEXT

USE (lcForm + ".scx") EXCLUSIVE ALIAS scxedit

LOCATE FOR UPPER(ALLTRIM(objname)) == "CMDOVERVIEWRPT" AND UPPER(ALLTRIM(parent)) == "MFG_STATUS40"

IF NOT FOUND()

USE

WAIT WINDOW "cmdOverviewRpt not found - no changes made"

RETURN

ENDIF

lnHit1 = OCCURS(lcOld1, scxedit.methods)

lnHit2 = OCCURS(lcOld2, scxedit.methods)

IF lnHit1 <> 1 OR lnHit2 <> 1

USE

WAIT WINDOW "Old code matches: Change 1 = " + TRANSFORM(lnHit1) + ", Change 2 = " + TRANSFORM(lnHit2) + " (need 1 each) - no changes made"

RETURN

ENDIF

REPLACE methods WITH STRTRAN(STRTRAN(methods, lcOld1, lcNew1), lcOld2, lcNew2)

USE

COMPILE FORM (lcForm + ".scx")

WAIT WINDOW "Overview Rpt order changed and form recompiled"

RETURN

©2026 Kurt Wendt