basic基本命令及参数?

本分类表仅包括部分Visual Basic对初学者有用的命令,限于篇幅,如果您想了解命令的详细用法,请参看VB帮助或其它有关VB书籍。 有一点需要记住的是:不要把VB命令同VB控件的属性混淆!

一、顺序文件 随机文件 二进制 其它 I/O

二、字符串 DOS 显示 声明

三、QUICKBASIC专用命令 内存/数组 DEFCUR DEFCUR

四、循环和条件

五、图形 过程 文件类型 事件处理

六、数字 逻辑 数据类型 端口 错误处理

本分类表仅包括部分Visual Basic对初学者有用的命令,限于篇幅,如果您想了解命令的详细用法,请参看VB帮助或其它有关VB书籍。

有一点需要记住的是:不要把VB命令同VB控件的属性混淆!

------------------- ------------------- -------------------

----------

顺序文件 随机文件 二进制 其它 I/O

------------------- ------------------- -------------------

----------

OPEN WRITE# OPEN GET OPEN GET DATA RUN

CLOSE PRINT# CLOSE PUT CLOSE PUT READ CHAIN

RESET PRINT# USING RESET FIELD RESET LOCK RESTORE

INKEY$

EOF INPUT# EOF LSET EOF UNLOCK ENVIRON LPRINT

LOC LINE INPUT$# LOC RSET LOC FREEFILE ENVIRON$

TAB

LOF FREEFILE LOF MK... LOF INPUT$ SYSTEM

LOCK SEEK CV... SEEK LINE INPUT$ SLEEP

UNLOCK SEEK# LOCK SEEK# VIEW PRINT END

FILEATTR FREEFILE UNLOCK FILEATTR DATE$ STOP

FILEATTR TIME$ LPOS

TRON STICK

RND # range: int((up-lo+1)*RND +lo) TROFF STRIG

IOCTL REM

IOCTL$

------------------- ------------ -------------------

-----------------

字符串 DOS 显示 声明

------------------- ------------ -------------------

-----------------

UCASE$ CHR$ SHELL LOCATE COLOR Main Procedures

LCASE$ ASC FILES PRINT SOUND --------- ----------

LEFT$ VAL NAME CLS CLEAR DECLARE

LTRIM$ SPC KILL BEEP PLAY COMMON

RIGHT$ SPACE$ MKDIR VIEW PRINT POS OPTION BASE

RTRIM$ STR$ CHDIR WIDTH CSRLIN CONST

MID$ INSTR RMDIR DEF FN

LEN STRING$ FILEATTR STATIC STATIC

LSET SWAP DIR$ SHARED SHARED

RSET FRE DIM DIM

ENVIRON REDIM REDIM

ENVIRON$ DEFINT DEFINT

----------------------------- ------------------------ DEFSTR DEFSTR

QUICKBASIC专用命令 内存/数组 DEFCUR DEFCUR

----------------------------- ------------------------ DEFINT DEFINT

LOCAL ALIAS $INCLUDE PEEK BLOAD VARPTR DEFLNG DEFLNG

SADD BYVAL Int86 POKE BSAVE VARPTR$ DEFSNG DEFSNG

SETMEM CDECL Int86x CLEAR UBOUND VARSEG DEFDBL DEFDBL

SIGNAL COMMAND$ INTERRUPT ERASE LBOUND FRE TYPE... TYPE...

EVENT UEVENT INTERRUPTX DEF SEG

VARPTR SSEG

VARSEG

----------------------------------------------------------------------

循环和条件

----------------------------------------------------------------------

FOR i TO j STEP k WHILE cond IF__THEN__ELSE SELECT CASE

EXIT FOR - CASE __ , __

NEXT WEND - IF__THEN CASE IS cond

ELSEIF__THEN__ CASE __ TO __

DO WHILE|UNTIL cond ELSE__ CASE ELSE

EXIT DO ENDIF END SELECT

LOOP WHILE|UNTIL cond

------------------ ------------------- ------------------- -----------

图形 过程 文件类型 事件处理

------------------ ------------------- ------------------- -----------

PSET LINE SUB ... INPUT ON KEY() GOSUB

PRESET CIRCLE FUNCTION ... OUTPUT " COM() "

POINT DRAW CALL APPEND " PEN "

BSAVE PAINT GOTO RANDOM " PLAY() "

BLOAD PALETTE GOSUB BINARY " STRIG() "

PCOPY VIEW RESUME " TIMER() "

PMAP WINDOW RETURN " __ GOSUB _,_,_

SCREEN COLOR CALL ABSOLUTE " __ GOTO _,_,_

SOUND "=Numeric Exp

COM ON|OFF|STOP

------------------- --------- ------------------- ----------- --------

数字 逻辑 数据类型 端口 错误处理

------------------- --------- ------------------- ----------- --------

HEX$ RND MOD IMP AS SINGLE FIX INP ERDEV ERR

OCT$ SGN ABS AND " DOUBLE CINT OUT ERDEV$ ERL

SWAP SIN SQR OR " LONG INT WAIT ON ERROR ERROR

EXP COS LOG XOR " INTEGER CSNG

TAN LET ATN NOT " STRING CDBL ON ERROR GOTO

RANDOMIZE EQV CLNG ON LOCAL ERROR GOTO

ON ERROR RESUME NEXT

ON LOCAL ERROR RESUME NEXT

RESUME

EVENT ON

EVENT OFF

RETURN