A cura del prof. Gino Tombolini 1 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 LinkExecute, LinkPoke, LinkRequest DDE client Use a Visual Basic application as a LinkSend DDE server Error trapping Get error messages Error$ Get error-status data Err, Eri Simulate run-time errors Error Trap errors while a program is On Error, Resume running 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 Arrange, ZOrder screen A cura del prof. Gino Tombolini 2 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 Addltem, Removeltem boxes 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 Declare procedure 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 LCase, LCase$, UCase, UCase$ letters Create strings of repeating Space, Space$, String, String$ characters 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 Asc, Chr$ values Variables and constants Declare variables or constants Const, Dim, Global, Static Get information about a variant, IsDate, IsEmpty, IsNull, IsNumeric, VarType variable Require explicit variable Option Explicit deciarations 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 DoEvents before continue Run other programs AppActivate, SheIl Sound a beep Beep A cura del prof. Gino Tombolini 3 A cura del prof. Gino Tombolini 4 A cura del prof. Gino Tombolini 5