0% found this document useful (0 votes)
154 views

Codingg Scheme For Visual Foxpro

This document provides examples of FoxPro programming code to perform basic operations like creating program files, defining variables, accepting user input, performing calculations, and displaying output. It includes 5 programs: 1) a program to add two numbers, 2) a program to subtract two numbers, 3) a program to multiply two numbers, 4) a program to divide two numbers, and 5) a program to convert a name from lowercase to uppercase. The document demonstrates how to create FoxPro program files, write code using commands like GET, READ, and SAY, and run the programs to test them.

Uploaded by

Jessica Martinez
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views

Codingg Scheme For Visual Foxpro

This document provides examples of FoxPro programming code to perform basic operations like creating program files, defining variables, accepting user input, performing calculations, and displaying output. It includes 5 programs: 1) a program to add two numbers, 2) a program to subtract two numbers, 3) a program to multiply two numbers, 4) a program to divide two numbers, and 5) a program to convert a name from lowercase to uppercase. The document demonstrates how to create FoxPro program files, write code using commands like GET, READ, and SAY, and run the programs to test them.

Uploaded by

Jessica Martinez
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

11/06/2014--------------------------------------------FOXPRO PROGRAMMING--------

-----------------------------------
1. how to create a program file?
ans- syntax:- modify command filename->enter
ex: modi comm monami
2.extension name of program file?
ans:- .prg
3.how to create a new line?
ans:- 1.@coloum no,row no
ex: @2,3(that means to create a new line in 2nd coloum,3rd row)
keyword of programs
___________________
"say"-this defines any statement or message
"get"-to accept any value by a variable to the program
"record/read"-to accept the valu from the user and assign to process it
4.how to run any program?
ans:- syntax:- do filename
ex:- do monami
5.how to prepare a program?
ans:- a foxpro program has different parts like
1)variable declared to all as its date type
2)set the message as statement by used defined variable
3)to get assign,type "read"
4)now calculate the program
5)now print the output
6)then Run,the program.
6.how to save any program?
syntax:- ctrl+W
7)how to define a variable?
ans:- a=0 -> to define numerical variable.
b=space(enter space parameter within bracket) -> to define string variable
c={} -> to define date variable any variable started with any character.
"+" to concatenate two or more string
"str" to convert any number to string.
------------------------------------------------------program-------------------
-------------------------------------
1)
*** write a program to accept two no and display their addition
//to create the programming file type in the command box:-
modi comm monami
//write the program in the new programming window jst opened
clear->enter
a=0->enter
b=0
c=0
@2,2 say"enter 1st no=" get a
@3,2 say"enter 2nd no=" get b
read->enter //to store the formula in the computers memory
c=a+b
@4,2 say"the summation is="+str(c)
ctrl+W
//to open the work area to enter the 1st and the 2nd no on the command box write
:-
do monami
---------------------------------------------------program----------------------
---------------------------------------
2)
*** write a program to accept two no and display their substraction
//to create the programming file type in the command box:-
modi comm mona
//write the program in the new programming window jst opened
clear->enter
a=0->enter
b=0
c=0
@2,2 say"enter 1st no=" get a
@3,2 say"enter 2nd no=" get b
read->enter //to store the formula in the computers memory
c=a-b
@4,2 say"the difference is="+str(c)
ctrl+W
//to open the work area to enter the 1st and the 2nd no on the command box write
:-
do mona
--------------------------------------------------program-----------------------
--------------------------------------
3)
*** write a program to accept two no and display their multiplication
//to create the programming file type in the command box:-
modi comm rimi
//write the program in the new programming window jst opened
clear->enter
a=0->enter
b=0
c=0
@2,2 say"enter 1st no=" get a
@3,2 say"enter 2nd no=" get b
read->enter //to store the formula in the computers memory
c=a*b
@4,2 say"the multiplication is="+str(c)
ctrl+W
//to open the work area to enter the 1st and the 2nd no on the command box write
:-
do rimi
--------------------------------------------------program-----------------------
--------------------------------------
4)
*** write a program to accept two no and display their division
//to create the programming file type in the command box:-
modi comm daliya
//write the program in the new programming window just opened
clear->enter
a=0->enter
b=0
c=0
@2,2 say"enter 1st no=" get a
@3,2 say"enter 2nd no=" get b
read->enter //to store the formula in the computers memory
c=a/b
@4,2 say"the division is="+str(c)
ctrl+W
//to open the work area to enter the 1st and the 2nd no on the command box write
:-
do daliya
--------------------------------------------------program-----------------------
------------------------------------
5)PAGE 82 QUESTION NO 1
*** write a program to accept a name in lower case and convert to upper case.
//to create the programming file type in the command box:-
modi comm sona
//write the program in the new programming window just opened
clear->enter
a=space(25) //here 25 within brackets denotes the amount of character space
you want to leave to write the name in the space left according to your choice
@2,2 say"input name in lower case=" get a-->enter
read // to store the formula in the computer memory
u=upper(a)
@3,2 say"output name in upper case is="+u--->enter
ctrl+W
//to open the work area to enter the name in lower case on the command box write
:-
do sona

You might also like