FoxPro Notes



FoxPro Notes

FOXPRO /VISUAL FOXPRO



1. FOXPRO IS CALLED RDBMS
RELATIONAL DATA BASE MANAGEMENT SYSTEMS.


- RELATIONAL MEANS RELATION BETWEEN TWO MORE DATA BASE FILE .


- ANY INFORMATION IS CALLED DATA


- A LARGE VOLUME OF DATA IS CALLED DATA BASE.


- THE HEADING ARE CALLED FIELDS
FIELDS


 
 
 



NAME ADDRESS MARKS
-------- ------------- -----------
SANTOSH 136,S.P. ROAD 85
AMIYA 214, SAKUNTALA 75
NANDITA 28, SHYAM PALLY 63
SARUP 14,D.H. ROAD 89



  





DATA





TYPES OF FIELDS MAX (WIDHT)
1. CHARACTER TYPE 254
2. NEUMERIC TYPE 20
3. DATE TYPE 8
4. LOGIC TYPE 1
5. FLOAT TYPE 20
6. GENERAL TYPE
7. CURRENCY TYPE
8. MEMO TYPE







TO CREATE A FILE OR TABLE
CREATE [SPACE] FILE NAME
CREATE THE TABLE STRUCTURE
- INPUT THE NAME OF THE FIELD
- FIELD TYPE
- FIELD WIDTH
AND INPUT THE DATA


TO SAVE THE DATA OR FILE
CTRL+W


TO DISPLAY RECORD
A. LIST
B. DISPLAY ALL
C. BROWS


TO CLEAR SCREEN
CLEAR






TO EDIT RECORD
EDIT [SPACE] RECORD NO.


EDIT RECORD 3


TO DELETE RECORD (TEMPORARY DELETION)
DELETE [SPACE] RECORD NO.
DELETE RECORED 3
** AFTER DELETION THE RECORD WILL BE MARKED WITH *




TO DELETE RECORD (PARMANENTLY)
PACK


RECALL FROM TEMPORARY DELETION
RECALL ALL
RECALL [SPACE] RECORD NO.


TO REPLACE A VALUE OF A FIELD
REPLACE A VALUE AGAINST A VALUE











TO DELETE ALL THE RECORD FROM A DATA BASE
ZAP



TO ADD NEW RECORDS
APPEND



TO OPEN A EXISITING DATA BASE
USE [SPACE] FILE NAME



TO CLOSE A DATA BASE
USE
TO RENAME A DATA BASE
RENAME [OLD FILE NAME] [SPACE] TO [NEW FILE NAME]
* FILE MUST BE CLOSE


TO DELETE A FILE
ERASE [SPACE] FILE NAME (WITH EXTENSION)




TO DISPLAY RECORD BY GIVEN CONDITION
EX :
DISPLAY RECORD, WHOES MARKS ABOVE 50


LIST FOR MARKS>50
DISPLAY ALL FOR MARKS>50
BROWS FOR MARKS >50
GO TO A PARTICULAR RECORD
GOTO [SPACE] RECORD 3


GOTO BOTTOM
GOTO TOP











CREAT A SALARY SHEET OF 5 EMPLOYEES



NAME
BASIC
DA
HRA
TA
GROSS
PF
P.TAX
E.S.I
NET

P.ROY
2400

















S.PRADHAN
2650

















C.PRADHAN
2310

















R.CHATTERJE
1445

















S. BARDHAN
1820



















CONDITIONS:
1. DA WILL BE CALCULATED @ 10% ON BASIC.
2. HRA WILL BE CALCULATED @ 20% ON BASIC
3. TA WILL BE CALCUATED @ 5% ON BASIC+DA
4. CALCULATE THE GROSS
5. PF WILL BE CALCUATED 12% ON BASIC +DA
6. ESI WILL BE CALCULATED 1.75% ON GROSS
7. P.TAX WILL BE CALCULATED ON BASIC AS FOLLOWS.
UPTO 1500 nil
1501 2000 18
2001 3000 25
3001 5000 30
5001 6000 40
6001 7000 45
7001 8000 50
8001 9000 90
9001 15000 110
15001 25000 130
25001 40000 150
40001 Above 200


8. NET WILL BE CALCULATED
GROSS – (PF+ESI+P.TAX)


See project


SORT
SORTING DATA ASCENDING OR DECENDING ORDER IN RESPECT TO ANY FIELDS .


syntax
SORT ON [FIELD NAME] TO [ANOTHER FILE NAME]


SORT ON ENAME TO DFA92


A NEW FILE WILL BE CREATED AND DATA WILL BE IN SORTED FORM


INDEX
INDEXING THE DATA IN ASCENDING AND DECENDING ORDER .


INDEX ON [FIELD NAME] TO [ANOTHER FILE NAME]


INDEX ON ENAME TO MMC


IN INDEX NO SEPARATE FILE WILL BE CREATED


A SUPPORTING FILE WILL BE CREATED, WHICH EXTENSION WILL BE .IDX


COPY A FILE INTO ANOTHER NAME
COPY FILE [OLD FILE NAME] TO [NEW FILE NAME]


** FILE MUST BE CLOSE
** FILE NAME SHOULD BE WITH EXTENSION.


MERGING FILES
** FILE STRUCTURE MUST BE SAME
1ST OPEN A FILE , IN WHICH DATA WILL BE MERGED.


2ND BY USING COMMAND
APPEND FROM [SOURCE FILE]




COMPOUND INDEX
INDEX CAN BE MADE INTO DIFFERENT FIELDS AT A TIME BY USING TAG


INDEX ON [FIELD NAME] TAG [NEW FILE NAME]


INDEX ON ENAME TAG ENAME
INDEX ON BASIC TAG BASIC
INDEX ON DA TAG DA






SORT
SORTING CAN ALSO BE MADE IN DECENDING ORDER


SORT ON [FIELD NAME]/D TO [ANOTHER FILE NAME]


MACRO




WIZARD




MEMORY VARIABLE


A PART OF RAM , DEFINE BY AN ALPHABETICAL CHARACTER .


A = 25
B = 26
C = A+B
HERE A , B ,C ARE MEMORY VARIABLE AND THE VALUES OF A , B, IS 25 , 26 AND VALUE OF C WILL BE THE SUMATION OF A+B


HOW TO DEFINE A MEMORY VARIABLE


= OR STORE


THIS NEUMERIC VARIABLE


A = 25


OR


STORE 25 TO A


CHARACTER MEMORY VARIABLE


A = “MONAJ SHAW”


STORE “MONAJ SHAW” TO A






MAX
DISPLAY THE MAXIMUM VALUE, OF A NEUMERIC CALCULATION.
Example
A = 25
B = 26
C = 65
? MAX (A,B,C)
MIN
DISPLAY THE MINIMUM VALUE, OF A NEUMERIC CALCULATION.
Example
A = 25
B = 26
C = 65
? MIN (A,B,C)
3. SQRT
DISPLAY THE SQRT VALUE OF NEUMERIC CALCULATION


A = 225
? SQRT (A)


4. ROUND
DISPLAY THE ROUND VALUE OF A NEUMERIC CALCULATION.

A = 75896.3663

? ROUND(A,2)







5. INT
DISPLAY THE INTERGER VALUE OF A NEMURIC CALCULATION


A = 7457585.658547


?INT(A)


6. SPACE


CREATE A SPACE BETWEEN TWO VARIABLE


A = “AMIT”
D = “DAS”


? A+D AMITDAS


?A+SPACE(2)+D AMIT DAS


7. REPLICATE


PRINT CHARACTER FOR PARTICULAR TIMES.


Y = “YOUTH”


?REPLICATE(Y,100)

“YOUTH” CHARACTER WILL BE PRINT 100 TIMES.




UPPER

SAME AS EXCEL
A = “Amit Sana”
? upper (A)


LOWER
SAME AS EXCEL


A = “AMIT SANA”


?LOWER (A)


PROPER
SAME AS EXCEL


A = “AMIT SANA”


? PROPER (A)




DISPLAY STATEMENT IN A PARTICULAR POSITION


@ 8,10 SAY “ NAME OF THE EMPLOYEES”






DISPLAY THE VALUE OF VARIABLE ON A STATEMENT


A = “AMIT SANA”


@ 8,10 SAY “ ENTER NAME :”


AMIT SANA WILL BE DISPLAYED ON THE RIGHT SIDE OF THE STATEMENT “ENTER NAME”


@ 8,10 SAY “ENTER NAME:” +SPACE(2)+(A)




STR


CONVERT THE NEUMERIC VALUE INTO CHARACTER.


N = 855266


@ 8,10 SAY “ENTER NUMBER” +STR(N)




ASSIGN NEUMERIC /CHARACTER VARIABLE
BLANK VARIABLE


A =0


OR


STORE 0 TO A




CHARACTER VARIABLE


A =SPACE (25)


OR


STORE SPACE (25) TO A


@ 8,10 SAY “ENTER NAME:” GET A
READ




LOOP

1. CONDITIONAL STATEMENT


DECESION MAKING STATEMENT




IF <CONDITION>
-STATEMENT
ELSE
- STATEMENT
ENDIF


Example


INPUT A NUMBER , IF THE NUMBER IS GREATER THAN EQUALTO 50 , THE MASSAGE WILL DISPLAYED “RIGHT NUMBER” AND IF THE NUMBER IS LESS THAN 50 . MASSAGE WILL DISPLAYED “WRONG NUMBER”


SOLVE

A PROGRAM FILE WILL BE WRITTEN IN FOX PRO


FROM COMMAND WINDOW


MODI COMM <FILE NAME>


N =0
@ 8, 10 SAY "ENTER NUMBER :" GET N
READ
IF N >=50
@ 12,12 SAY "RIGHT NUMBER"
ELSE
@ 12,12 SAY "WRONG NUMBER"
ENDIF


TO SAV E THE PROGRAMME FILE
CTRL+W




TO RUN THE PROGRAMME FILE


DO <FILE NAME>


CONTROL STATEMENT OR
LOOP


2. MULTIPLE CONDITION


DO CASE
CASE <CONDITION 1>
-STATEMENT 1
CASE <CONDITION 2>
- STATEMENT 2
CASE <CONDITION 3>
- STATEMENT 3
CASE <CONDITION 4>
- STATEMENT 4
OTHERWISE
- STATEMENT
ENDCASE


Example


INPUT A NUMBER, AND THE GRADE AS FOLLOWING

NUMBER GRADE
BELOW 271 FAIL
272 – 359 3rd Div
360 –479 2nd Div
480 – 599 1st Div
ABOVE 600 STAR


SEE PROGRAM SSR.PRG

3. CONTINIOUS LOOP


DO WHILE <CONDITION>


LOOP


ENDDO


Example


WRITE A PROGRAM, DISPLAY THE ODD NUMBERS FROM 1 – 100




4. LOOP WORKING FOR A SPECIFIC NUMBER OF TIME


FOR I = 1 TO 100
- STATEMNT


ENDFOR


PROGRAM EXAMPLE


FOR I = 2 TO 100 STEP 2
? I
ENDFOR





1. WRITE A PROGRAM OF PAYROLL SYSTEM


FIELDS ARE AS FOLLOWES


NAME
BASIC
DA
TA
HRA
GROSS




CONDITIONS AS FOLLOWS
1. DA WILL BE CALCULATED 10% OF BASIC
2. TA WILL BE CALCULATED 2 % BASIC +DA
3. HRA WILL BE CALCULATED 5% OF BASIC+DA
4. GROSS WILL BE CALCULATED TOTAL OF BASIC +DA+TA+HRA


SEE SAL.PRG




2. WRITE A PROGRAM, INPUT A NUMBER WHETHER TH E NUMBER IS ODD OR EVEN


SEE ODD.PRG










3 . WRITE A PROGRAM , WHAT WILL BE TEMP. OF F.SCALE , IF THE TEMP. OF CENT. GR. SCALE IS 100



SEE TEMP. PRG




4. WRITE A PROGRAM , CALCULATE THE SIMPLE INTEREST OF A INVESTEMNT , OF SPECIFIC PERIOD. AND A SPECIFIC INTEREST RATE


SEE INTEREST.PRG










Post a Comment

0 Comments