VFP: Learn How to Create Program (.prg) File in Visual FoxPro

VFP: Learn How to Create Program (.prg) File in Visual FoxPro

  • Blog
  • 2 mins read

In this tutorial, you will learn how to create a program (.prg) file in Visual FoxPro.

The method of creating a program (.prg) file is the same in all versions of Foxpro. Give the following command in the Visual FoxPro command window:

Command to Create Program (.prg) File in Visual FoxPro

MODIFY COMMAND myprog

or in short form:

MODI COMM myprog

In this case, a file myprog.prg will create and will open in the editor. There you can write your program. The following is an example of the .prg file in Visual FoxPro:

Visual FoxPro Program File Example

In the following program, it will set the settings for Visual FoxPro environment and will call a Form named "mmenu".

CLEAR
CLOSE ALL
SET SYSMENU TO DEFAULT
SET STATUS BAR OFF
SET HOURS TO 24
*SET STATUS BAR ON
*SET SYSMENU OFF
SET EXCLUSIVE OFF
SET AUTOSAVE ON
SET REFRESH TO 5
SET EXACT ON
SET SAFE OFF
SET TALK OFF
SET DELETED ON
SET RESOURCE OFF
** SET REPROCESS TO AUTOMATIC
SET REPROCESS TO 5
SET CENTURY ON
SET DATE british
MODIFY WINDOW SCREEN TITLE "Hotel Management" ICON FILE ".\handshak.ico"
_SCREEN.WINDOWSTATE = 2
CLOSE DATA
DO FORM mmenu
CLOSE DATA
SET SYSMENU ON
SET SYSMENU TO DEFA
ON ERRO
CLEAR
RETURN