Foxpro commands - Part 2

Submitted by Karthikeyan on

14. Navigation with Records

GO or GOTO both do the same things in Foxpro.

GO TOP

Used to move the record pointer at the first record.

GO BOTTOM:

Used to move the record point at the last record.

Go

To go to a particular record

Syn:- GO <recordno>

Eg:- GO 8

Go to record 8

SKIP

- To skip number of records

e.g. To skip 3 records - SKIP 3

15. To List the records

LIST - To list the records in screen, not in window

It can be used with condition as below:

LIST for val(price) > 100

LIST itemname, price+20

- This command lists item name with price rupees 20 added. The changes are applied only to the view, it not saved in database.

LIST product, price*2

- price is multiplied with 2.

16. To view the records as manipulatable view

BROWSE - To browse the records

BROWSE NOEDIT  - To browse the records in read only view, The records can be marked for deletion using Ctrl + T shortcut

BROWSE NODELETE - To avoid deleting while browsing the records

17. To display current record number

?RECNO()

18. To display the dbf files in the current directory

DIR

19. Hide or Show heading in list view

SET HEADINGS OFF

SET HEADINGS ON

20. Printing

SET PRINT ON

- This command sends the out put to printer

- To stop this use the command SET PRINT OFF

SET PRINTER TO LPT1

- To set the output printing port to LPT1

21. Handling date and date format

To display current system date

?DATE()

To set century on to display year in 4 digits.

SET CENTURY ON

SET CENTURY OFF

To set date format

dd/mm/yyyy   => SET DATE BRIT

mm/dd/yyy   => SET DATE AMERICA

yyyy/mm/dd  => SET DATE JAPAN

22. Replace command

To replace the content of the specified field in the database table. i.e., This command can be used to remove the data in the particular field (nullifying / empty a field)

e.g.

 REPLACE fieldname WITH ""

- To replace with null value

REPLACE fieldname WITH {  /  /  }

- To replace the date field with null value

 

REPLACE ALL QUANTITY WITH 0

- Replaces the data in the quatity fied with 0 in all the records.

REPLACE ALL PRICE WITH PRICE+50

- Adds 50 to the price field.

23. Blank

To blank some or all the fields in the current record.

BLANK

- To blank all the fields in the current record

BLANK FIELDS <field1>, <field>

- To blank specified fields in the current record

Comments

Monali Patil

May 15, 2017 - 15:55

can anyone please having pdf or link about report generation in foxpro please provide here if anyone having..i need very badly..

felix daniel

Jul 12, 2016 - 16:25

how to get the data from the foxpro 2.6 database while typing (like mobile search)

Karthikeyan

Feb 13, 2016 - 18:42

In reply to by Akash1000

It removes unnecessary out put. i.e., command results It is just like @echo off in batch files.
Try it yourself with SET TALK ON, you can get better understanding.

Akash1000

Feb 13, 2016 - 18:21

why do you type SET TALK OFF while creating program? What does it do actually?

Recommended :
FoxPro e-Book
  1. FoxPro Programming Quick Reference e-Book (New! Revised Edition)