Joke Collection Website - Public benefit messages - Kneeling: Common Commands of VF6.0
Kneeling: Common Commands of VF6.0
First, the main command:
Second, common functions
Third, the main program statements
First, the main command:
1, create
Function: Create a new table.
Format: Create [|? Note that the command characters can take the first four characters, and then they can be omitted, that is, CREA.
, the same below; Parentheses indicate that parameters are optional; The pipe symbol indicates that only one of the two parameters can be selected and cannot be the same.
When to choose, the same below. )
Description: File refers to the file used to establish VFP database. Dbf extension, and add a question mark after the command, indicating that the system will
pop music
Dialog box asking the user to enter the name of the table to be created. If you don't add a file name or question mark to the command, a dialog box will pop up.
ask
Enter the name of the table you want to create.
2. Modify the structure
Function: Displays the file structure of the table and allows you to modify the structure of the table.
Format: modifying the structure
Note: The structure of the table file can only be displayed or modified after using the USE command to open the table file.
3. Add
Function: Append records at the end of the current table (whether there are records in the table or not) (in the current table, it refers to the table currently in use).
Format: Append [Blank]
Note: Adding a blank parameter after the APPEND command means adding a blank record at the end of the current table. No blank ginseng
When counting, it means adding a record at the end of the current table and asking the user to input the corresponding field content.
4. Insert
Function: Insert a new record in the middle of the table file.
Format: Insert [Before] [Blank]
Description: INSERT inserts a record after the current record;
INSERT BEFORE inserts a record before the current record;
Insert Before Blank Inserts an empty record before the current record.
5. browse
Function: It is mainly used to open the browsing window, consult the table file and make modifications at the same time.
Format: browse
6. Use
Function: Open and close table files.
Format: Use []
use
Description: The previous command is used to open the specified table file. If there are memo fields in the table, open the corresponding table at the same time.
about
Remarks file (. Fpt file); The latter command closes the currently open table file.
7. List and display
Function: Display the content, structure or status of the table. dbf)。
Format: list | display [off] [< [] [field] <; Expression table > [while <; Conditions >] [for <; situation
& gt]
[print | save to file < file >]
List | Show Structure to Print | To File < File >]
List | Display Status [Print | to File < File >]
Description: The command with OFF parameter indicates that the record number is not displayed, and the range specifies which records to operate, including:
record
What record number, the next n records from the current record, and all records from the rest of the current record to the end of the file.
Records, all
All the records. If no range is selected, the implied range is all; ; FIELDS are followed by field names separated by commas.
minute
Separated. WHILE is followed by conditions, and FOR is followed by conditions. The difference is that if the conditions after WHILE are met, the search will stop;
After ...
Standard Finds all records that meet the standard. TO PRINT and tofile respectively indicate that the results will be displayed on the printer.
dump
And output the display result to a file. The DISPLAY command requires the user to press any key to continue the display after the recording is displayed in full screen.
, and at
In this command, if the range is omitted, only the current record will be displayed. Format, the following two commands are to display the table structure (
Structure) and working STATUS.
8. Positioning of records
Function: Use the record pointer to locate the record.
Format: Go to record n | Top | Bottom
n
Skip [+|-]
Note: The first command is also called absolute positioning, where record n is positioned to record n and TOP is positioned to record 1.
BOTTOM locates the last record. The second command navigates to the nth record, where n is a numeric value. The third command is also called.
Relative determination
Bit, which moves N records forward (-) or backward (+) based on the current record. If this option is not selected, the record pointer will be returned by default.
Move the record.
9, modify and edit
Function: Display the fields to be edited or modified.
Format: change | edit [] [field < field name table >; ][WHILE & lt; Conditions >] [for <; Conditions >]
10, browse
Function: Opens the Browse window for users to browse or modify records.
Format: Browse [field; ]
1 1, replace
Function: Replace the contents of the corresponding field in the command with the value of the expression.
Format: replace [] < Field1>; Use< expression1>; [,< field 2 > Use < expression 2 >] [for <; deprive
Works >
][WHILE & lt; Conditions >]
12, delete, package, exchange and recall
Function: Mark the records to be deleted, delete all, delete all records, and cancel the selected table records.
about
Delete the flag.
Format: delete [] [while <; Conditions >] [for <; Condition >] (special case: delete file.
File name. DBF,
This command deletes the specified table file)
package
vitality
Memories [<; Scope >] [for <; Condition >] [while <; Conditions >]
13, sorting and indexing
Function: Create a new table file with records arranged in a new physical order, and represent the current table according to keywords.
The value of
Arranged from small TO large, stored in a file, and specified the index file name or the identifier of the composite index file after to.
Format: sort by ON< field name1> [/A] [/C] [/D][, < field name 2 > [a] [/c]
[/D]] ...
[ascending | descending] [<; Scope >] [for <; Condition >] [while <; Condition >] [field & lt field table >]
Index keyword expression on< > to< file name >
Index keyword expression on < > tag < distinguished name > [of < File name >] [for <; Conditions >]
Note: in the 1Command, /A sorts by field name in ascending order, /D sorts by field name in descending order, and/c ignores case and only pays attention to words.
Symbol type
For keywords, ascending and descending means ascending and descending respectively. Command 1 creates a. dbf table file, which is the first one.
2 commands
Create one. Idx single index file, and the third command creates a. cdx composite index file.
14, use < table file name > index < index file name list >; , set the index to and the order to.
Function: Open the index file, open the index file, and change the main index while opening the table file.
Format: use index < index file name list >;
Set the index to [<; Index file name list >; ]
Set the order to [<: Index file name >] (special case: REINDEX command: reindex)
15, search, search, locate, continue
Function: The first two commands, FIND and SEEK, locate the contents of keywords in the table where the index file has been established.
And fate
The first record in a row with the same string. After using USE to open the table file, the latter command directly queries the fields in the table.
Content.
Format: find |< string >
SEEK & lt emoticon >
Positioning [<: Scope >] [for <; Condition >] [while <; Conditions >]
continue
Note: The difference between the FIND command and the SEEK command is that the former is followed by a string, while the latter is followed by an expression. Use the positioning command.
find
After matching records, you can use the CONTINUE command to search the rest of the table to find other matching records.
16, counting
Function: Count the number of qualified records in the current table file.
Format: count [] [for <; Condition >] [while <; Condition >] [Recipient < memory variable name >; ]
Note: Memory variable names can be any characters except parameters.
17, total
Function: Accumulate all or specified numeric fields or numeric expressions composed of specified fields of the selected records in the current table.
And ...
Format: sum[][ numerical value] [to < Memory variable list >; ][FOR & lt; Condition >] [while <; Conditions >]
18, average
Function: display all or part of numeric fields and their expressions of the selected records in the current table on average.
Format: average[][ numerical value] [to < Memory variable list >; ][FOR & lt; Condition >] [while <; deprive
Piece > ]
Second, common functions
1, mathematical function
Functional usage
ABS(& lt; Numerical expression >) absolute value, |x|
Ceiling (< numerical expression >) > = the smallest integer of independent variable.
EXP(& lt; Numerical expression >) to the e power, e=2.7 1828.
Floor (< numerical expression >) < = the largest integer of the independent variable.
INT(& lt; Numeric expression >) rounding the independent variable.
Log (< numerical expression >) natural logarithm of independent variable, ln x
log 10(& lt; Numerical expression >) common logarithm of independent variable, LG X.
MAX(& lt; The expression1>; , < expression 2 >) the maximum value of two values.
MIN(& lt; The expression1>; , < expression 2 >) the minimum value of two values.
MOD(& lt; Numerical expression1>; , < numerical expression 2 >; ) find the remainder
Rand ([<; Numerical expression1>; ]) returns a pseudo-random number
Circle (< numerical expression1>; , < numerical expression 2 >; ) Rounds the first argument.
Sign (< numerical expression >) The sign of the independent variable.
SQRT(& lt; Numerical expression >) square root (positive root)
2. String operation function
Functional usage
& amp& lt memory variables >; Used to replace the contents of a memory variable.
LEN(& lt; String expression >) returns the number of characters in a string expression.
Space (< numerical expression >) generates spaces.
SUBSTR(& lt; String expression >,< numerical expression n>[,< numerical expression L>]) finds a substring from the specified word.
A string with a total length of l starting from the nth string expression.
Lower (< string expression >) converts string letters to lowercase letters.
UPPER(& lt; String expression >) converts string letters into uppercase letters.
TRIM(& lt; String expression >) removes trailing spaces from strings.
ASC(& lt; String expression >) returns the ASCII code of the leftmost first character of a string expression.
CHR(& lt; Numeric expression >) converts numeric expressions into characters.
In (< string expression1>; , < string expression 2 >; [,< numerical expression n<]) determines that the string expression 1 is in the character.
The position in string expression 2, where n is the number of occurrences of the string expression.
STR(& lt; Numeric expression > [,< Numeric expression L & gt][, < Numeric expression n>] converts a numeric value into a string, and l is a numeric value.
The total length of the expression, where n is the number of decimal places.
VAL(& lt; String expression >) converts a numeric string into a number.
Type (< expression >) detects the data type of the expression value.
LTRIM(& lt; String expression >) deletes the space to the left of the string.
RTRIM(& lt; String expression >) deletes the right space of the string.
Left (< string expression >, < numerical expression n<) takes the left part of the string, where n is the number of characters returned.
Right (< string expression >, < numerical expression n<) takes some characters on the right side of the string, and n intercepts the number of characters from the right side.
3. Table (. Dbf) operation function
Functional usage
BOF([& lt; Workspace code or alias >]) look-up table file startup function
EOF([& lt; Workspace code or alias >]) table file end test function
RECNO([& lt; Workspace code or alias >]) tests the current record number of the current or specified workspace table.
Deleted ([<; Workspace code or alias >]) Record deletion test function
File (< "string" >) tests the function of the file.
DBF([& lt; Workspace code or alias >]) Detection table of file name function
4. Date and time functions
Functional usage
DATE () queries the current date function of the system.
Time ([<; Numerical expression >]) Check the current time function of the system.
Year (< date expression > | < date time expression >; ) Appointment by Date function
Month (< date expression > | < date time expression >; ) check the month function from the date
CMONTH(& lt; Date expression > | < Date time expression >; ) Check the month name function by date.
Day (< date expression > | < date time expression >; ) Check the daily functions of the current month from the date.
Dow Chemical (< date expression > | < date time expression >; [,< numerical expression >]) The function of finding the day by date.
CDOW(& lt; Date expression > | < Date time expression >; ) find the day name function from the date.
DTOC(& lt; Date expression > | < Date time expression >; ) date to character function
CTOD(& lt; String expression >) string into the date function.
CTOT(& lt; String expression >) returns a date-time value function.
TTOC(& lt; Date time expression >; ) returns a character value.
5. Display and print position function
Functional usage
The ROW () function is used to determine the position of the line where the cursor is located.
COL () function for judging the position of cursor column.
Because of the base ([<; Numerical expression >]) detects the ASCII code function corresponding to the user's keystroke, and the numerical expression is in seconds.
be pressed for time
6. Other functions
Functional usage
DISKSPACE () is a function that returns the number of bytes available in the default disk drive.
OS () function to detect the operating system name.
VERSION () returns the VFP version number.
Third, the main program statements
1, conditional judgment statement
Format: (1) If
< command statement group >;
ENDIF
Description: If the condition is true, each statement in the command statement group will be executed; otherwise, these command statements will be skipped and not executed.
And execute the statement after ENDIF.
(2) if < condition >
& lt command statement group 1 >:
other
< command statement group 2 >:
ENDIF
Description: If the condition is true, the command statement group 1 is executed; otherwise, the command statement group 2 is executed.
(3) If < condition1>;
If < condition 2 >
& lt command statement group 1 >:
other
< command statement group 2 >:
ENDIF
...
other
& lt command statement group N>
ENDIF
Description: Nested selection for multiple conditions.
(4) Make a case
Case & lt condition1>;
& lt command statement group 1 >:
Case & lt condition 2>
< command statement group 2 >:
Case < condition 3 >
< command statement group 3 >:
...
...
Case & lt condition N>
& lt command statement group N>
[Otherwise]
[& lt; Command statement group n+ 1 >:]
Close the case
Description: judge the conditions in turn and switch to the execution of the command statement group with true conditions. When all the conditions are not true, if there is
Otherwise, execute the command statement group N+ 1, otherwise, execute the statement after ENDCASE.
2. Loop statement
Format: (1) do while
< command statement group >;
[circulation]
< command statement group >;
[exit]
< command statement group >;
Endor
Description: Judge whether the condition is true or not. If true, repeat the command statement group in the loop body until the condition is false, and end.
follow
The ring.
(2) scanning
< command statement group >;
End scan
Description: Establish a loop to execute the command statement groups in the table, and perform operations on each record until the table text.
piece
Until the record is over.
Description of common functions of using VFP
1, numerical operation function
Example result of function operation
Find the square root SQRT(9) 3
INT(x) takes the integer INT(3. 14) 3.
Circle (x) Circle (3.14159,4) 3.1416.
MOD(x, y) Find the remainder of x divided by y mod (25,4)1.
MAX(x, y) Find the maximum value of x, y Max (7,8) 8.
MIN(x, y) Find the minimum value of x and y MIN( 1, 2,3)1.
2. Character operation function
Example result of function name operation
Uppercase (s) lowercase letters uppercase (abc) ABC
Lowercase (s) uppercase letters lowercase (ACD) acd
Find the length of the string LEN ("China 1") 7.
In the AT(S 1, S2) of the string S2, look for the string S 1 AT("H ","China ") 2.
SUBSTR(S, i, n) gets n characters SUBSTR('TECHNOLO', 3,3 3) CHN from the i-th character in the S string.
LEFT(S, n) takes n characters from the left of the string S, LEFT ("China people ",4) China.
RIGHT(S, n) takes n characters from the right of the string S =' 12345'.
Right (South, 3) 345
SPACE(N) generates n spaces "total"+space (2)+"123", and the total is123.
TRIM(S) deletes the space at the end of the name of the string trim ("name").
ALLTRI(S) deletes all spaces in the string ALLTRIM ("Li Li") Li Li.
STUFF(S 1, N 1, N2, S2) replaces N2 character STUFF ("Now", 2,
1, "e") new
& replace P="G2 "with macro
Use & ampp Use G2
3, date and time function
Example result of function name operation
DATE () Find the current date () 20011112.
DATETIME () Find the current date and time Datetime () 20011112/0: 22: 33am.
YEAR(D) Find the year YEAR(DATE()) 200 1.
MONTH(D) Find the month (numerical value) Month (datetime ())11.
Find the month (character) month (date and time ()) 1 1 month.
Found the date DAY(DATE()) 12.
DOW(D) Find the day of the week (numerical value) DOW(DATE()) 1.
CDOW(D) Find the day of the week (English) CDOW(DATE ()) Sunday
TIME(D) Find the current time TIME(DATE()) 10:20:38am.
4. Data type conversion function
Example result of function name operation
ASC(S) Find the ASCII code ASC("what") 87 of the first string.
CHR(N) Find the character CHR(87) w of ASCII code.
The value of STR(R, l, d) is converted into characters, where l is the length and d is the decimal place X=3. 14 15.
STR(X,6,2) 3. 14
The VAL(S) string is converted into the numerical value VAL(" 123") 123.00.
CTOD(S) string CTOD ('11/01/2002')11/2002 so far.
DTOC(D) date is converted into string dtoc (date ())11/01/2002.
DTOS(D) converts the date into Japanese string dtos (date ()) 200211kloc-0/.
CTOT(C) string is converted to date and time ctot (11/200210: 30: 50am)11/065438+.
DTOT(D) date type is changed to date and time dtot (date ())1/25/200100: 001am.
TTOC(T) date-time type is changed to character type ttoc (datetime ())11/25/200100: 001am.
TTOD(T) date-time type is changed to ttod (datetime ())11/25/2001.
IIF(LE, E 1, E2) logic judgment IIF(A & gt;; 0, "Yes", "No") Yes
5. Detection function
Example result of function name operation
RECNO () detects the current record number RECNO() 1.
RECCOUNT () detects the current record count RECCOUNT() 12.
BOF () starts recording BOF() 1.
EOF () Last record EOF() 12
FOUND () returns the found search result (). T t。
ROW () returns the current row coordinate ROW() 1.
COL () returns the current column coordinate col 1.
SYS(N) returns the system status. SYS( 13) is online.
The back wave of the Yangtze River pushes the front wave, and the front wave dies on the beach.
2005-09- 18 2 1:46
Report a post
Copy post
Add as essence
Single-rod shielding
Post-evaluation
Use props
Jian xing Tian Xia
Title: Little Soldier
Grade: Forum Wanderer
Item code: 148
Integral: 786
Sect: Wuxue Sect in the Pearl River Delta
Registration: 2nd floor of QQ on August 5th, 2005.
Everyone should go and see more. If you have any questions, just let me know if you can help me. QQ5396437。
The back wave of the Yangtze River pushes the front wave, and the front wave dies on the beach.
2005-09- 18 2 1:47
Report a post
Delete a single post
Copy post
Add as essence
Single-rod shielding
Post-evaluation
Use props
How bright the moonlight at home is! ├ News observation ├ Information release ├ Being in a foreign country ├ Activity area ╋ Life and entertainment ├ Fashion ├ Health ├ Audio-visual front ├ Pictures flying all over the sky ┅ Interactive communication ┅. ├ Archives ├ Working Group Moderator's House 2 2 11Page1Page
Quick reply:
Publish expression
Paragraph format common format title 1 title 2 title 3 title 4 title 5 title 6 title 7 formatted address font typeface bold italic imitation song style young round new song style thin Arial black Courierdana wide Latin Wingdings font size 1234567.
Pagination: 1/7, * * 49 1234567.
Display signature content limit: bytes.
send a text message
what can I do?
The theme I published
The theme I participated in.
Basic data modification
User password modification
Contact information modification
User short message service
Edit buddy list
User collection management
Personal file management
Today's post legend
Legend of the subject number
Legend of total posts
Online legend
Online situation
User group online legend
File set browsing
Browse photos gallery
Quick browsing
Music collection browsing
Movie collection browsing
Greeting card sending
Shanghai ICP Bei 05028498
Supported by Dvbbs version 7. 1.0.
Copyright? Wuxueren.Com in 2004-2005
The page execution time is 0. 17 188 seconds, and there are 3 data queries.
- Previous article:How can the US delegation's refund application be successful?
- Next article:How to save the phone number on Huawei mobile phone card?
- Related articles
- What region does the +86 in front of the mobile phone number come from? Urgent request
- Happy family reunion in the Spring Festival of 2022 _ 100 sentence Family reunion in the Spring Festival
- Will you receive a text message when you buy a ticket for WeChat Cat's Eye movie?
- If imessage is not enabled on the other iphone, can I receive SMS?
- Is it illegal to send text messages to consumers privately?
- Solution to the problem that mobile phone can't receive verification SMS.
- So far, all the episodes with silly bell powder in Runningman had better have a simple explanation, thank you!
- What happens if I cancel my mobile phone card without my ID card?
- When will Taiyuan Express Transfer Station resume?
- China Bank Personal Short Message Notification Uplink Service Signing Processing Channel