Functions, Statements, and Methods by Programming Task

2

A cura del prof. Gino Tombolini

Functions, Statements, and Methods by Programming Task

Category / Action / Functions/Statements/Methods
Arrays / Change default lower limit / Option Base
Declare and initialize / Dim, Global, ReDim, Static
Find the limits / LBound, UBound
Reinitialize / Erase, ReDim
Controlling program flow / Branch
/ GoSub...Return, GoTo, On Error, On…GoSub, On...GoTo
Exit or pause the program / DoEvents, End, Stop, Unioad
Loop / Do...Loop, For...Next, While...Wend
Make decisions / If...Then...Eise, Select Case
Converting / ANSI value to string / Chr, Chr$
Date to serial number / DateSerial, Date Value
Decimal numbers to other / Hex, Hex$, Oct, Oct$
Number to string / Format, Format$, Str, Str$
One numeric data type to another / CCur, CDbI, CInt, CLng, CSng, CStr, CVar, CVDate,Fix, Int
Serial number to date / Day, Month, Weekday, Year
Serial number to time / Hour, Minute, Second
String to ASCII value / Asc
String to number / Val
Time to serial number / TimeSerial, Time Value
Copying, cutting, and pasting / Use Clipboard object / CIear, GetData, GetFormat, GetText, SetData, SetText
Date/time / Get current date or time / Date, Date$, Now, Time, Time$
Set date or time / Date, Date$, Time, Time$
Time a process / Timer
Dynamic data exchange (DDE) / Use a Visual Basic application as a DDE client / LinkExecute, LinkPoke, LinkRequest
Use a Visual Basic application as a DDE server / LinkSend
Error trapping / Get error messages / Error$
Get error-status data / Err, Eri
Simulate run-time errors / Error
Trap errors while a program is running / On Error, Resume
File I/O / Access or create a file / Open
Close files / Close, Reset
Control output appearance / Spc, Tab, Width #
Copy one file to another / FileCopy
Get information about a file / EOF, FiieAttr, FileDate,FileLen, FreeFile, Loc, LOF, Seek
Manage disk drives or directories / ChDir, ChDrive, CurDir, CurDir$, MkDir, RmDir
Manage files / Dir, Dir$, Kill, Lock...Unlock, Name
Read from a file / Get, Input, Input #, Input$, Line Input #
Set or get file attributes / GetAttr, SetAttr
Set read-write position in a file / Seek
Write to a file / Print #, Put, Write#
Graphics / Change coordinate system / Scale
Clear run-time graphics / Cls
Draw shapes / Circle, Line, PSet
Draw text / Print
Find size of text / TextHeight, TextWidth
Load or save a picture file / LoadPicture, SavePicture
Work with colors / Point, QBColor, RGB
Manipulating objects / Arrange forms or controls on the screen / Arrange, ZOrder
Direct user input to a control / SetFocus
Display dialog boxes / InputBox, InputBox$, MsgBox

Drag and drop

/ Drag
Hide or show forms / Hide, Show
Load or unload objects / Load, Unload
Move or resize controls / Move
Print forms / PrintForm
Update the display / Refresh
Work with list boxes and combo boxes / Addltem, Removeltem
Math / General calculations / Exp, Log, Sqr
Generate random numbers / Randomize, Rnd
Get absolute value / Abs
Get the sign of an expression / Sgn
Numeric conversions / Fix, Int
Trigonometry / Atn, Cos, Sin, Tan
Printing / Control output appearance / Scale, Spc, Tab, TextHeight, TextWidth
Control printer / EndDoc, NewPage
Print / Print, PrintForm
Procedures / Call a Sub procedure / Call
Declare a reference to an extemal procedure / Declare
Define a procedure / Function...End Function, Sub...End Sub
Exit from a procedure / Exit Function, Exit Sub
Strings / Assign value / Let
Compare two strings / StrComp
Convert to lowercase or uppercase letters / LCase, LCase$, UCase, UCase$
Create strings of repeating characters / Space, Space$, String, String$
Find the length of a string / Len
Format strings / Format, Format$
Justify a string / LSet, RSet
Manipulate strings / InStr, Left, Left$, LTrim, LTrim$, Mid, Mid$, Right, Right$, RTrim, RTrim$, Trim, Trim$
Set string comparison rules / Option Compare
Work with ASCII and ANSI values / Asc, Chr$
Variables and constants / Declare variables or constants / Const, Dim, Global, Static
Get information about a variant, variable / IsDate, IsEmpty, IsNull, IsNumeric, VarType
Require explicit variable deciarations / Option Explicit
Set default data type / Deftype
Miscellaneous / Find environment variables / Environ, Environ$
Generate keystrokes / SendKeys
Get command-line arguments / Command, Command$
Cause any pending events to occur before continue / DoEvents
Run other programs / AppActivate, SheIl
Sound a beep / Beep