59742000 creating a program
TRANSCRIPT
-
7/29/2019 59742000 Creating a Program
1/3
Creating a Program
Submitted by admin
on 28 September, 2009 - 11:13
PROGRAMA Program is a set of instructions used to achieve the desired output.
To create new program or to edit the existing one.MODI COMMOR MODIFY COMMAND
NOTE command
If ignore the particular line or command, NOTE can be used at the beginning of
that line.
Comment Line
To add comments to the right of the Programming code , use &&Clear All Command
This command is used to closes all databases files and releases all active memoryvariables, arrays menus or popup.
Input / Output command
? | ?? | ??? [expr1?]? - To print the expression in new line
?? - To print the expression in the same line
??? - The Output will going to the printer
Example:
? "Hellow!"
Sample ProgramNOTE prg for just print something on the screenClear && To Clear the Screen or previous outputs
?"Welcome"
?"Hellow!"?? " World...!"
??? "Thank you
Writing Programs* FoxPro has powerful built-in editor for writing and editing.
* It can be invoked from the command window by using the MODIFY COMMAND.
Syntax:
MODIFY COMMAND
Example:
Modify Command journal
(This program will automatically save with the extension .PRG)Press CTRL + W - To save and close the program window
Executing Program
Programs can be executed by DO command.
-
7/29/2019 59742000 Creating a Program
2/3
Syntax:
DO
Example:Do journal
When compile the executed file the FoxPro creates an object code program with .FXP
extension. If there are any errors, creates a file an .ERR extension.INPUT commandIt is used to accept Numeric input from the user and store it into a memory variable.
Syntax:INPUT [] TO
Example:
Store 0 to eno
INPUT "Enter your Enrollment No : " TO eno
? Eno
ACCEPT commandIt is used to accept character input from the user and store it into a memory variable.
Syntax:ACCEPT [] TO
Example:Store space (15) to NAM
ACCEPT "Enter the Name: " to NAM? "Entered name: NAM
Example 2clearSET TALK OFF
Accept "Enter your nane :" to nam
Input "enter your Age : " to age
Accept " enter your city :" to citAccept "Enter your Mail id : " to mail
? "******************************************"
? "NAME :: " ,nam? "AGE :: " ,age
? "CITY :: " ,cit
? "MAIL ID:: " ,mail? "******************************************"
Setting/restoring the environmentEvery FoxPro program includes all commands required to establish the working
environment and restore it to its prior state before the program terminates execution. This
is achieved by issuing some set.
Set notify on/off
Enables the display of certain system messages.
Set talk windowDirectors the display of system messages to an user-defined window instead of
the system window. Sets notify should be ON.
-
7/29/2019 59742000 Creating a Program
3/3
Set deleted on/offProcesses records marked for deletion.