foxpro imfoxpro important portant notes

Upload: rssishere

Post on 02-Jun-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    1/22

    FOXPRO

    DBMSstand for Data Base Management System. In this system you can create files, reports, labels etc.The database is the collection of records related to person. The DBMS packages are Dbase III plus,

    Dbase IV, FoB!S", Fo#ro etc.

    Fo#ro is a database management system. It means that using this soft$are $e can handle thedata in different $ay. The acti%ity include in DBMS system are

    &' (reate a database or format structure to store data.

    )' !dd records in database.*' Modify records, "dit records.

    +' Search particular records.

    ' !rrange records in particular order -ascending or descending order.

    /' Delete records0' Delete Database or modify structure.

    1' #repare 2eports and 3abels.

    The three important terms are

    &' Field :-It is the unit or information related to person. 4r it is a heading of column in database.)'Record :-It is the collection of fields or a complete ro$ of table is called record.

    *' Database :-The collection of records is called file.

    1] Creating File in FoxPro

    (reate5 To create file in fopro use command (2"!T" command $indo$ $ith file name.Synta56Create e.g.

    Create data

    ! structure dialog bo appear on screen7ere enter field names, there datatype -datatype means type of data you all$oed for that field for e.g.

    number or character or date enter $idth of field -space allo$ed and if necessary enter decimal number.!fter this select 48 button or press (trl9: to sa%e and eit form structure bo, a message display to;Input record no$ -yumeric &= )=Float &= )=

    Date =1 =1

    3ogical =& =&Memo &= in dbf file unlimited bytes

    ?eneral &= in dbf file unlimited bytes

    In Fo#ro there are different data types are a%ailable. These are

    &' Character :-!llo$ed alphabets -! to @, a to A number -= to and special character and space.

    )' Numeric :-!llo$ed digits -= to and decimal point also contain 9 or 6 sign.*' Float :-Same as >umeric.

    +' Date:-the date data type use to define or enter date %alue.

    ' Memo :-The memo data type is same as character data type ha%ing unlimited $idth./' Geeral :-it is use for 43" obCect.

    Rules !or ami" !ield

    &' Field name must start $ith character or underscore - character.

    )' Field name can be up to &= char.

    *' Space is not allo$ed in field name.

    +' Duplicate field name is not allo$ed.

    )' Use Command5This command is use to open an eisting file and also to close current file.

    Syta# :- Ese File name'

    e.g. to open data fileEse Data

    1

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    2/22

    $% &pped

    This command is use to add ne$ recordsSynta

    Append [blank]

    [from ][filed ]

    [for ]

    e.g.&' to add records in append $indo$

    use data

    !ppend

    )' To add blank record $ithout opening append $indo$append blank

    *' To add ne$ records in a current file from file name ;student;

    append from student

    +' To add only though records ha%ing city ;shegaon; of ;student; fileappend from student for city G ;shegaon;

    +' Bro'se:This command is most popular or useful in Fo#ro $hich let you to add ne$ records, delete

    records or modify records in bro$se $indo$.

    Syta#:-

    Bro$se Scope'

    Fields Hfieldlist'

    For Hep3'

    :hileHep3'noappend' nomodify'

    nodelte' noedit'

    e.g&' To open bro$se $indo$

    Bro$se

    )' To bro$se only fields Title author and cost onlybro$se fields Title,!uthor,(ost

    *' To bro$se only records ha%ing cost greater than *==

    bro$se all for cost *==

    +' To bro$se records but not able to add, modify or delete records in bro$se $indo$bro$se all noappend nodelete nomodify

    ' (ist :- this command use to list reocrds on screen, file or to send out put to printer

    Syta#:-List [off] [scope]

    [field ]

    [for] [While]

    e.g.

    &' To list all records

    list

    )' To list records $ithout record number

    3ist off

    *' To list record only & to *

    go toplist net *

    +' To list only fields title and cost

    3ist fields title,cost

    ' To list only record of author ". Balgurus$ami

    3ist all for authorG;".balgurus$ami;/' To list only title and author of title Fo#ro

    3ist fields title, author for title G ;Fo#ro;

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    3/22

    ' Display :-this command use to Display reocrds on screen, file or to send out put to printer

    Syta#:-

    Display off' scope' field Hfield list'

    forHep3'

    :hileHep3'e.g.

    Display5 to display only current record

    To Display all records

    Display all

    To Display records $ithout record number

    Display off

    To Display record only & to *

    go top

    Display net *

    To Display only fields title and cost

    Display fields title,cost

    To Display only record of author ". Balgurus$ami

    Display all for authorG;".balgurus$ami;

    To Display only title and author of title Fo#ro

    Display fields title, author for title G JFo#roK

    )% Delete : - This command is use to mark records for delete. Syta#56 Delete scope'

    field Hfield list'

    forHep3'

    :hileHep3'e.g.

    To Delete all records

    Delete all

    To Delete record only & to *

    go top

    Delete net *

    To Delete only record of author ". Balgurus$ami

    Delete all for authorG;".balgurus$ami;

    *% Recall:-This command is use to recall records marked for delete.

    Syta# 56 2ecall scope'

    field Hfield list'

    forHep3'

    :hileHep3'

    e+"+

    To 2ecall all recordsEse studDelete for cityGKShegaonK

    2ecall all

    To 2ecall record only & to *

    Ese stud

    Delete allgo top

    2ecall net *

    To 2ecall only record of author ". Balgurus$ami

    3

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    4/22

    2ecall all for author G ;".balgurus$ami;

    1' Pac,:- This command is use to delete records permanently marked for delete.

    Syta#56 #acke.g. delete all record.

    use stud L pack

    ' ap:- This command is use to delete all record permanently of currently open .dbf file.e.gTo delete all record of data file

    use dataAap

    &=' Go to:- This command lets you to mo%e record pointer in a dbf file.

    Syta#:-

    e.g

    use studgoto *

    &&' (ocate :-This command is use to search the record seuentially that matches gi%en epression.3ocate seuentially search the current table for the first record that matches a logical epression. The

    table doesnNt ha%e to be indeed.If locate find the record it display itNs 2ecord no else place the record pointer to "4F.

    Syta#:-

    3ocate scope'For Hep3

    :hileHep3'

    e.g

    To locate records ha%ing city shegaon

    use stud

    3ocate all for city G ;shegaon;

    To locate all record bet$een *=== to /===

    3ocate all for salary G *=== .and. salaryHG/===

    &)' Cotiue 56 (ontinue command is used after 34(!T" succeeds in finding a record, to continue the

    34(!T" operation. (4>TI>E" mo%es the record pointer to the net record for $hich the logical

    epression specified in the pre%ious 34(!T" e%aluates to true H.T.

    &*' SOR. 56 Sort command sort the current table and outputs the sorted data to a ne$ table.

    Syta#:-

    S42T T4 Hfile 4> Hfield&

    ascending' descending'

    scope'for Hep3'

    $hileHep3'

    Hfile $hen a table is sorted a ne$ table is created

    Hon Hfield& you must include a name of a field

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    5/22

    Ese lib

    Sort to abc on title fields title, author, cost

    /0% 1de#:-This command is used to arrange the records in ascending or descending order. There are

    t$o types of indeing compound indeing -.cd containing multiple entries called tag and simple inde

    -id containing single inde entry.Syta#Inde on Hfield ep

    to Hid file'4- return itNs record number, F4E>D- return .T. and "4F-

    return .F.If S"T >"!2 is 4> and find is unsuccessful, the record pointer is positioned immediately after the

    closest matching record.

    e.guse lib

    inde on Title tag a additi%e

    find ;Fo#ro for :indo$s;

    &/' S223:- S""8 command is similar to FI>D search record in inde table. In this epression

    is allo$ed.e.g.

    use lib

    inde on cost tag a

    cG)*+seek c

    &0' S2. COMM&NDSa S"T ST!TES 4> O 4FF 5

    Display or remo%e Status bar.

    b S"T (34(8 4> O 4FF 5

    S"T (34(8 T4 H24: ,H(43EM>'

    Determine $eather or not Fo#ro display the system date and specify itNs location. 4n the screen. -totalnumber on screen is )+ and column is 1= '

    e.g.

    set clock onset clock to &),*=

    c S"T (">TE2P 4> O 4FF 5

    5

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    6/22

    Determine $eather or not Fo#ro displays the century portion of date epression in four digits or t$o

    digits.

    d S"T B"33 4> O 4FF

    Turn the computer bell on or off and set the bell attributes.

    syntaS"T B"33 4> O 4FF

    S"T B"33 Hfreuency,Hduration'

    Freuency is bet$een & to &==== hertA!nd duration is bet$een & to &

    e.g.

    S"T B"33 4>

    S"T B"33 T4 &)=== , &)

    e S"T D"3"T"D 4> O4F

    Specify $eather or not fopro processes records marked for deletion 4r a%ailable for use in other

    commands

    f S"T T!38 4> O 4FFDetermine $eather or not fopro display command reasult

    g S"T "S(!#" 4> O 4FFDetermine $eather or not pressing the "scape key interrupts program and command eecution.

    h S"T 7"!DI>? 4> O 4FF

    Set 7eading specifies $eather a field name is displayed as a column heading output of a%erage,calculate, display, list and sum.

    i S"T >"!2 4> O 4FFDetermine $eather the record pointer is positioned after FI>D or S""8 unsuccessfully search for a

    record.

    C S"T S!F"TP 4> O 4FF

    Determines $eather or not Fo#ro display a $arning before o%er$riting an eisting file.

    k S"T "Q!(T 4> O 4FFSpecifies rules used $hen comparing strings of different lengths.

    l S"T D!T" T4' !M"2I(!> O!>SI OB2ITIS7 O F2">(7 O ?"2M!>

    O IT!3I!> O R!#!> O ES! O MDP

    O DMP O PMDEse this command to set the format used to display date epressions. 7ere are the settings and the

    resulting date epressions.

    2esulting date format

    Setting Format!merican mm

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    7/22

    m S"T (!22P 4>o$ set the relation as56

    7

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    8/22

    select 1

    use emp2c

    index on code to codeselect 3

    use emp2(

    index on code to code1select 1

    set relation to code into emp2(

    bro&se fields code4name4emp2(/post4emp2(/salar.

    % S"T E>IE" 4>

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    9/22

    command $ill not affect this function it al$ays displayed in 8888 format.

    Syta#:-

    8*A-67

    e.g. P"!2-U=&

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    10/22

    2eturns56 =.)

    +ip' the (alue returned b. A+A:6 7 can ran)e from 'pi3 throu)h =pi3 6 '1/DDB to 1/DDB7/ +he numeric

    (alue returned b. A+A:6 7 is in radians/

    /COS56:- 2eturns the cosine of a numeric epression.

    Syta#:-CO%67

    e.g. cos-+2eturns.*

    +ip'the (alue returned b. CO%6 7 ran)es bet&een '1 and 1/ is )i(en in radians/

    D7 D.OR56:-(on%erts the %alue of a numeric epression gi%en in degrees to an

    eui%alent %alue in radians.

    Syta# :-$+O-67

    e.g. DT42-&1=

    2eturns56 *.&+

    12XP56 :-2eturns the %alue of eX $here is a specified numeric epression.

    The %alue of e, the base of natural logarithms, is approimately ).0&1)1.

    Syta#:-*E67

    e.g. "Q#-)

    2eturns56 0.*

    =6 F(OOR56:- 2eturns the nearest integer that is less than or eual to the specified

    numeric epression.

    Syta#:-FLOO-67

    e.g56 F3442-&,=

    2eturns56 &

    e.g. F3442-6&.

    2eturn56 6)=

    +,%' FLOO-6 7 rounds a positi(e number &ith a fractional portion do&n to the inte)er portion of the number4

    and rounds a ne)ati(e number &ith a fractional portion do&n to the next lo&est inte)er/

    />6 1N.56:- "%aluates a numeric epression and returns the integer portion of theepression.

    Syta# :-,:+67

    e.g. 56 I>T-)=.

    2eturns56 &

    //6 M&X56:- 2eturns the epression $ith the highest !S(II or numeric %alue or the

    latest date from a list of character, numeric or date epressions.

    Syta# :-9AE64 [4 /// ]7

    e.g. ma-&),)),&=

    2eturns56 ))

    /86 M1N56:- 2eturns the epression $ith the lo$est !S(II or numeric %alue or theearliest date in a list of character, numeric or date epressions.

    Syta# :-9,:64 [4 ///]7

    e.g. min-&=,,1

    2eturns56 1

    /$6 RO4ND56:-2eturn a numeric epression rounded to a specified number of decimal

    places.

    Syta#:--OU:$64 7

    e.g. 24E>D-&./,)

    2eturn56 )=.==

    +ip ' if the number is )reater than 4 then 1 is added to the pre(ious number/

    /06 R.OD56:- (on%erts a numeric epression that represents radians to an eui%alent%alue in degrees.

    Syta# :--+O$67

    e.g. 2T4D-*.&+&/

    2eturns56 &1=.==

    & S?R.56:- 2eturns the suare root of the specified numeric epression.

    Syta# :- %G-+67

    e.g. S2T-&)&

    2eturn 56 &&

    /)6 @&(56:- 2eturns a numeric epression from a specified character epression

    composed of numbers. Syta#:-HAL67

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    11/22

    e.g. aGW&)W

    V!3-a

    2eturn56 &).==

    C&R&C.2R F4NC.1ONS

    & &((.R1M56:- 2eturns the specified character epression $ith leading and trailing

    blanks remo%ed.

    Syta#:-ALL+-,967

    e.g. WK7"334 F2I">DK,!33T2IM-J T7IS IS T"ST J,K eampleK

    2eturn56 7"334 F2I">D T7IS IS T"ST eample.

    +ip' ALL+-,96 7 remo(es leadin) and trailin) blanks from the specified character expression and returns the

    trimmed expression as a character strin)/

    ) &SC56:- 2eturns the !S(II code for the leftmost character in a character epression.

    Syta# :-A%C67

    e.g. !S(-YaW

    2eturns56 0+ip'*(er. character has a uniIue A%C,, (alue in the ran)e from to 3/

    *&.56:- 2eturns the beginning numeric position of the first occurrence of a character

    epression or field $ithin another character epression or field, counting from the leftmost character.

    Syta#:- A+64 [4 ]7

    7ere ,Hep(& 6 is the character $hose position you $ant to see.

    Hep()6 is the tet in $hich you $ant to search.

    Hep>6 is the number of occurrence.

    e.g.56 at-Y!W,WD!T! #4I>TW,)

    2eturn56 +

    + CR56:- 2eturns the character associated $ith the specified numeric !S(II code. Syta# :- C0-67

    e.g. (72-0

    2eturn56 a

    1S&(P&56:-2eturns true -.T. if the leftmost character in the specified character

    epression is an alphabetic characterZ other$ise, false -.F. is returned.

    Syta# :-,%AL0A67

    e.g. IS!3#7!-J&)data pointK

    2eturns56 .F.

    *6 1SD1G1.56:-2eturns true -.T. if the leftmost character of the specified character

    epression is a digit -=Z other$ise, false -.F. is returned. Syta#:-,%$,J,+67

    e.g. ISDI?IT-J&) data J

    2eturn56 .T.

    1 1S(OTK

    2eturn56 .T.

    />6 (2F.56:-2eturns a specified number of characters from a character epression,

    starting $ith the leftmost character.

    Syta#:-L*F+64 7

    e.g. 3"FT-J data pointK,*

    2eturn56 dat

    //6 (2N56:-2eturns the number of characters in a character epression.

    Syta# :-L*:67e.g. 3">-Jdata pointK

    11

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    12/22

    2eturn56 &=

    /86 (OK F4Q#24KK

    2eturn56 7"334 F2I">D :"36(4M" T4 3"!2>

    /*6 S.4FF56:-2eturns a character string by replacing a specified number of characters

    in a character epression $ith another character epression.

    Syta# :- %+UFF64 4 4 7e.g. STEFF-JI ha%e a bigger elephantK,&=,/,KbigK

    2eturn56 I ha%e a big elephant

    7ere, 'Is the string in $hich you $ant to replace the character.

    'is the starting position of tet.

    ' is the number of character upto $hich you $ant to replace the

    character.

    ' is the ne$ tet $hich you $ant to put in string.

    /A6 S4BS.R56:-2eturns a specified number of characters from the gi%en character

    epression or field. Syta#:- %U%+-64 [4 ]7

    . e.g. SEBST2-JFopro is DBMS packageK,&&,+2eturn56 DBMS

    7ere, 'The character epression from $hich characters are etracted is .

    'starting position of character , $here character etraction be

    begins.

    'specifies the number of characters to be etract from the

    character epression.

    /=6 .R1M56:-2eturns the specified character epression $ith all trailing blanks

    remo%ed. T2IM- is identical to 2T2IM- .

    Syta#:- +-,967

    e.g. 56 ;7"334 F2I">DS; ,T2IM-;:"36(4M" ;,; T4 3"!2>;

    2eturn56 7"334 F2I">DS :"36(4M" T4 3"!2>

    8>6 4PP2R56:-2eturns the specified character epression in upper6case.

    Syta#:- U*-67

    e.g. 56 E##"2-Jdata pointK2eturn56 D!T! #4I>T

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    13/22

    F1(2 M&N1P4(&.1ON COMM&NDS

    & COP9 .O :-(opies the contents of the current table?

    U%* *9

    CO8 +O E8M FO- C,+8"#%0*JAO:# A:$ %ALA-8>"?

    (opy only fields name,city,dob,course

    U%* %+U$

    CO8 +O E8M F,*L$% :A9*4C,+84$O4COU-%*

    ) COP9 S.R4C.4R2 :- (opies the structure of the current tablee$ 3abel dialog in Fo#ro for :indo$s.

    Syta#:-

    C-*A+* LA*L []

    e.g.C-*A+* LA*L %+U$*:+

    tip ' the extension of LA*L file is.LBX.+o Open the label 9O$,F8 LA*L command

    is used/

    0 CR2&.2 SCR22N:-4pens a Screen Design $indo$.

    Syta#:-

    C-*A+* %C-**: []

    e.g. C-*A+* %C-**: E8M

    tip' the extension of screen is.SCX/ +o opend screen file 9O$,F8 %C-**: command

    13

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    14/22

    is used/

    1 D2F1N2 D (!S" $hose associated conditional statement e%aluates to true -.T..

    Syta#:-

    $O CA%*

    CA%*

    [CA%*

    ///CA%*

    ]

    [O+0*-W,%*

    ]

    *:$CA%*

    &+ DO

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    15/22

    [LOO]

    [*E,+]

    *:$$O

    & 2X1.:-"its a D4 :7I3", F42 or S(!> loop.

    Syta#:-*E,+

    &/FOR2NDFOR:- "ecutes the commands after F42 and before ">DF42 $ithin

    a loop a specified number of times.

    Syta#:-

    FO- " +O [%+* ]

    [*E,+]

    [LOO]

    *:$FO- :*E+

    e.g.

    F42 mcount G & T4 &= mcount

    ">DF42

    &0 1F2ND1F:-It is (onditional statement $hich eecutes a set of commands basedon the logical epression.

    Syta#:-

    ,F

    [*L%*

    ]

    *:$,F

    e.g.(34S" D!T!B!S"S

    ES" customer

    34(!T" F42 cityGK!843!K

    IF F4E>D-

    N(ompany5 N 9 company

    "3S" N(ondition N 9 temp 9 N $as not found N

    ">DIF

    ES"

    &1 FO4ND56:-2eturns true if (4>TI>E", FI>D, 34(!T" or S""8 is successful.

    Syta#:-FOU:$6[ ]7

    e.g. ES" STED

    ST42" = T4 mcount

    34(!T" F42 (4E2S" G N!D(SS!!N

    D4 :7I3" F4E>D-

    mcount G mcount 9 &

    (4>TI>E"

    ">DD4

    :!IT :I>D4: NTotal student form !D(SS!! course5 N Z

    9 3T2IM-ST2-mcount >4:!IT

    & 1NP4.:- Inputs data from the keyboard into a system memory %ariable or an arrayelement.

    Syta#:-

    ,:U+ [] +O

    e.g. Input J"nter >umber !K To !!

    )= &CC2P.:- !ccepts character string data from the screen.

    Syta#:-

    ACC*+ [] +O

    e.g. !ccept J"nter the name56J to name

    )& G2.:- (reates an editing region. Syta#:-

    15

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    16/22

    T J*+

    [FU:C+,O: ]

    [,C+U-* ]

    [FO:+ [4 ]]

    [%+8L* ]e.g.T1343 )et name pictur T# font arial#41P st.le ,#

    read

    )) R2&D:- !cti%ates obCects created $ith \ ... ?"T and \ ... "DIT commands.

    )* S&9:-Displays output at a specified ro$ and column position.

    Syta#:-

    T %A8

    [FU:C+,O: ]

    [,C+U-* ]

    [%,M* 4 ]

    [FO:+ [4 TK style JBIK

    )+G2.5Chec, Bo#6:- Pou can create the control buttons. To create check bo

    you reuired the numeric %ariable

    Syta#:- T4 )et m(ariable FU:C+,O: VC #e.g. ST42" = T4 (7

    \*,+ ?"T (7 FE>(TI4> J[( !DDK

    2eturn56 !DD

    +ip' .ou can use ,C+U-* insteade of FU:C+,O: like T?4? )et ch ,C+U-* TVC A$$# the value of check

    ox i! 1 "hen it i! checked other"i!e #.to define hot ke. $%# si)n is used before the charcter/

    )G2.-5Radio butto6:- 2adio button reuired numeric or character %ariable.

    Syta#:- T4 )et m(ariable FU:C+,O: V-RR//#e.g. ST42" = T4 (7

    \*,+ ?"T (7 FE>(TI4> J[2 ]H!DDZD]H"3"T"K

    2eturn56 - !DD

    - D"3"T"

    )/ G2.-5Push Butt+6:- Same as radio button . Syta#:- T4 )et m(ariable FU:C+,O: V-RR//#

    e.g. ST42" = T4 (7

    \*,+ ?"T (7 FE>(TI4> J[ 48Z(!>("3K

    2eturn56 H48 H(!>("3

    tip' ,f the button &ants to displa. horiNontall. the use 0 &ith V like\*,+ ?"T (7 FE>(TI4> J[ 7 48Z(!>("3K it display like H48 H(!>("3

    by default it is %aritically placed.

    )0 G2.-5Popup656 To create the popup control you need numeric or character

    %ariable. Pou use E symbol as the function code or E as picture code.

    Syta#:- :- T4 )et m(ariable FU:C+,O: RR//#

    e.g. ST42" = T4 (7

    \*,+ ?"T (7 FE>(TI4> JX?raduateZMB!ZB!K

    tip' to acti(ate the check box4radio buttion4popup4push button -*A$ or -*A$ C8CL*

    command is used/

    )1 D2F1N2 M2N4:- (reate a menu bar. Syta#:- $*F,:* 9*:U

    [A- [A+ L,:* ]]

    [,: [W,:$OW] ]

    ) D2F1N2 P&D :create a pad on a user define bar .

    Syta#:- $*F,:* A$ OF -O9+

    [A+ 4]

    [K*8 ]

    *= ON P&D :- Specifies the menu popup or menu bar that is acti%ated $hen you choose

    a specific menu pad.

    Syta#:- O: A$ OF [AC+,HA+* OU AC+,HA+* 9*:U ]

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    17/22

    *& ON S2(2C.1ON P&D :-Specifies a command that eecute $hen you choose a

    specific menu bar pad.

    Syta#:- O: %*L*C+,O: A$ OF

    *) &C.1@&.2 M2N4:-Display and acti%ate the menu. Syta#:-AC+,HA+* 9*:U

    &hat i! 'e'o field( )o" it "ork!(Memo field used to store the long tetual information. Suppose $e considered that you need to create a

    dbf ha%ing information as bookname, authourname, L booksummary. 7ere $e store

    bookname,authourname in character field, but $e canWt use the character field for summary, because character

    field canWt be $ider than )+ character. So you use the9*9O

    field for storing the summary.

    :hen a memo field used $ith in database file ,the actual information in memo field stored in auiliary

    database file. Fopro automatically create the auiliary file -.fpt $hen you create the memo field in dbf.

    For eample if you create a database file like data/dbfha%ing memo fieldfopro create t$o files data.dbf

    L data.fpt $hich is auiliary file.

    &D@&N.&G2 o! M2MO F12(D:- ! memo field occupies only &= bytes of space in database record. Pou

    can store any amount of tet for each record.

    !s actual data for the memo field stored in auiliary file, the siAe of main dbf

    2educed.

    2teri" Data 1 Memo FieldTo entered data in memo field, ensure that the cursor is positioned in the memo field L press X7ome or

    X#gdn. If you ha%e a mouse you can double6click on JmemoK.

    This opens the $indo$ for entering the tet for memo field for the record. !fter you entered the

    information press X: to close the &indo&/ 4r selectFile Xclose from foxpro menu/

    Fopro returns you to editappendbro&se $indo$, no$ you see that JmemoK $ill change to JMemoK .

    9emo indicate that it contain the data $hereas memo indicate that it canWt contain the data.

    In this $ay you can entered the data in memo field.

    Li!ting *e'o Field:hen you gi%eL,%+ command to display the content of field on screen, it canWt display the content from

    9emo field/To display it you must type the name of that field

    e/)/ list b2name4a2name4summar.. By default $idth of memo field is = character. This default $idth can be

    changed through the %*+ 9*9OW,$+0command.

    For e/)/ %*+ 9*9OW,$+0 +O 3

    L,%+ OFF 2:A9*4A2:A9*4%U99A-8

    &hat +! Re,ort Lael! +n Fox,ro.Esing 3IST command you canWt gi%e the presentable output form also it donWt ha%e the facility to include

    page title,page number,date,headings etc. you canWt also apply the format to the tet. But fopro gi%es the facility

    as 2"#42T to create the presentable output form.

    Feature! f Fox,ro Re,ort!: ! page title can be gi%en to the report.

    !ny field epression can be placed any$here in detail line.

    Descripti%e tet can also include in the page.

    2eport title can be print on e%ery page.

    The report can ha%e the page footer that print6 tet,field,%ariable,function to display the information.

    The data in the report can be grouped. #rint style-bold,italic,underline,color can be gi%en to tet.

    (alculation such as sum,a%erage,maimum,minimum can be performed on numeric field.

    )o" /o Create /he Re,ortTo create the report C-*A+* -*O-+ command is used.

    Tip56 before creating report open the data base file for $hich you $ant to create the report.Synta56 (2"!T" 2"#42T H>!M"

    When .ou )i(e the command (2"!T" 2"#42T command it open the &indo& &ith the )i(en name S

    extension .fr.for e/)/D!T!.F2Q

    +he screen di(ided into three parts '

    )head' used to displa. the report titled4column headin) or description/

    17

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    18/22

    $etail' used to displa. the field information that &ill actuall. form the report/

    )foot' used to displa. the fooer information that &ill appear on each pa)e/

    Creati" ?uic, Report

    When .ou )i(e the (2"!T" 2"#42T command .ou &ill see the -*O-+ menu is added to

    the foxpro menu/ For Iuick report '17 Click on -eportmenu it displa. the menu options /

    37 From this select uick 2eport it displa. the report la.out6Column4Form la.out7 select an.

    one S click on OK/:o& .ou &ill see the format on .our &indo&/

    Preie'i" .he Report

    Foxpro anable .ou to pre(ie& the report before printin)/Click on2"#42Tmenu then select#!?" #2"VI":.

    Sai" .he Report

    +o sa(e the report press W or select Sa%eform File menu/

    Geerati" .he Report:o& .ou can )enerate the report usin) -*O-+ FO-9 command .ou can specif. the report

    format file /e.g. ES" STED

    2"#42T F42M STED">T

    8ou can also see the report in page6by6page (ie&/ +o use this mode add the clause -*H,*W to2"#42T F42Mcommand/For e.g. 2"#42T F42M STED">T #2"VI":

    Priti" .he Report

    8ou can also print the report on printer b. addin) the clause +O -,:+*- to -*O-+ FO-9

    command/ ,t displa. report on screen as &ell as printer/

    For e.g. 2"#42T F42M STED">T T4 #2I>T"2:o& .our printer print the report/ ,f printer on then it print the report other&ise )i(e the error messa)e/

    ,f .ou donYt &ant to see the report on screen )i(e>4(4>S43" as

    e.g. 2"#42T F42M STED">T T4 #2I>T"2 >4(4>S43"

    Priti" Selected Report

    8ou can also print the selected report usin) F42 clause/ As

    2"#42T F42M STED">T F42 (ITP GK87!M?!4>K

    Sa%ing The 2eport Into Tet File

    +he report )enerated &ith the 2"#42T F42M command can be sa(e the record in other textfile/

    For e.g. ES" STED

    2"#42T F42M STED">T T4 FI3" STED.TQT

    Creati" .he Custom Report

    8ou can also create the custom report/ %teps to create the report'1/ Open the DBFfile S )i(e the command(2"!T" 2"#42T STED">T

    3/ ,t displa. the &indo& in#g7ead)i(e the title of report as 9ark sheet of student#/

    ?/ +hen mo(e the cursor to next line S )i(e the column name as :A9*4 COU-%*CF4C4FOE-O4%A$4O-ACAL +O+AL4*-4-*%UL+4J-A$*/

    @/ +hen mo(e the cursor to the D"T!I3 line S press F to open the field expression box a)ain press

    ">T"2 button/ :o& it displa. the -eport *xpr/ box select the field name from field list at left side/S select 48.A)ain select 48.

    Tip56 you can press X: instead of selecting 48 button.

    / ,n this &a. .ou can select the other fields &hich .ou &ant/

    P/ +hen mo(e the cursor to#gFoot S t.pe D!T"56 to displa. current date press F to displa. the fieldexpre/ box S a)ain press ">T"2 button/ From this select the Date-from date function/ S press X:

    t$o times.

    D/ :o& to see the report press XI or select2"#42T6#!?" #2"VI":.

    Shortcut 3ey 1 Report

    Ke. 9eanin)

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    19/22

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    20/22

    8ou can print the selected records as

    ES" STED

    3!B"3 F42M STED">T F42 2"SE3T GK#!SSK

    2#plai the di!!erece bet'ee 2X1. 7 (OOP commad i do 'hileeddo

    +he normal procedure to exit the $O W0,L* ^*:$$O statement is &hen the specified

    condition becomes false/0X+/There is another $ay to terminate the loop using

    "QIT command $ithin D4 :7I3" _">DD4statement. :hen fopro encountered the "QIT

    command ,no more commands from the loop is

    eecuted. It eit the loop L eecuted the statement

    net to the ">DD4 statement. The "QIT commandis normally used in IF _">DIF statement.

    For e/)/For e/)/

    %tore to x4sum4. store to x4.4sum$o &hile x#ET J">T"2 P4E2 S!3!2PK T4 S!3!2P

    IF S!3!2P*===

    K P4E2 S!3!2P IS M42" T7!> *===K

    ">DIF:hen you run this program fopro prompts you if you entered the salary greater than *===

    other$ise it display no message.

    IIF- ^ The IIF- function, that is also same as IF.."3S"..">DIF. This function return oneepression if the condition true, return the T2E" statement other$ise F!3S" statement. Both these

    epression specified $ithin IIF-.

    %.ntax' IIF-(4>DITI4>,T2E" ST!T"M">T,F!3S" ST!T"M">TFor e/)/

    5,,F6salar.>?4#salar. more than ?#4#salar. less than ?#7

    if the condition is true then 4#salar. more than ?# is executed other&ise

    salar.less than ?# executed/

    Di!!erece bet'ee FOR 2NDFOR 7 SC&N 2NDSC&N

    F42...">DF42 eecutes a set of statements $ithin a loop a specified number of times. !memory %ariable or array is used as counter to specifiy ho$ many times the statement eecuted

    inside the loop. (onsider the follo$ing prog.

    ST42" = T4 >EM

    LP

    LOOP is another statement usedin DO WHILE ..ENDDOstatement. LOOP is specifedithin I! "ENDI!. When #o$proencountered the LOOPcommand%the contro& pass to theDO WHILE statement%theremainin' commands( upto

    ENDDO ) can*t e$ecuted. It a'ain

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    21/22

    F42 >EM6 & T4 &=

    S2T->EM

    ">DF42By default F42...">DF42 increments the %ariale by &.ho$e%er if you $ant to increaseDS(!>56Mo%es the record pointerthrough the current DBF file L eecute theblock of commands for each record that meets the specified condition/

    %.ntax'

    S(!> S(4#"'F42 Hep3'

    344#'

    "QIT'

    ">DS(!>For e/)/

    ES" address

    !(("#T J">T"2 (ITP56J T4 M(ITP

    S(!> F42 (ITPGM(ITP>!M"

    (ITPDIST

    ">DS(!>

    Di!!erece bet'ee 1ND2X 7 SOR.

    1ND2X SOR.

    &. It arrange the record in inde file. &. It sort the records in ne$ DBF file.). It reuired less memory as it arrange ). It reuired same memory as the

    e$ data $ill not be update. $hen added.

    %.ntax' %.ntax'

    I>D"Q 4> field,field,_' to id file' S42T T4 filename' 4> field,_'

    T!? cd file'ascending`EI(8 S(2"">

    or you can press XF to add field. It display the field epr. bo , to input the tet select H?et.. or to display

    list select HSay.. then select the field L press X: t$o times. In this $ay you can select the fields you $ant .

    To generate the code select #24?2!M`?">"2!T" option from it display the screen generate bo select

    the appropriate option L select ?">"2!T".

    !fter this press X: L to eecute the screen gi%e the command

    $O %+U$/%-

    It display the screen .

    &hat i! RB0( 0x,lain it "ith exa',le(

    2B" means 2elational uery By "ample. uery means the process of etracting specified

    information from file

  • 8/11/2019 Foxpro ImFoxpro Important portant Notes

    22/22

    of data. Pou can also create the specified condition using0AH,:J option. To runD operator. Pou donWt specify the operator you Cust select the net

    field. To sa%e the uery press X:. To eecute the uery gi%e command

    $O %+U$/G-8in command $indo$.

    D"Q 4> >!M" T!? >!M"It create structural compound inde file $ith name STED.(DQ.