DICTIONARY Visual Basic to HotBasic


HOME


FEEDBACK



Artwork by Don

Updated
Jan 25, 2005

HotBasic™ Compiler Copyright 2003-2004 James J Keene PhD. All Rights Reserved.

Visual Basic keywords translated to HotBasic

#If expression Then
HB: $IFDEF symbol (see Directives).

Activate, Deactivate Events
HB: For the most part, GUI events are automatically activated by the Windows OS itself or by the Object .Enabled property. Alternatively, a HB event may be set to "zero" to deactivate at run-time.

Add Method
HB: .AddItems or .InsertItem

AddFromString
HB: $INCLUDE directive

APPACTIVATE
HB: Use FORM .Enabled and/or .Visible methods

Boolean Data Type
HB: Can be any non-float numeric data type. Use BOOLEAN function to assign value.

BYREF
VB: Default argument reference method. HB: Relevant only in API calls; done automatically for arguments declared as STRING or as a defined TYPE.

BYVAL
HB: Default; BYVAL keyword is ignored.

CALL
VB: Call SUB or FUNCTION (result discarded). HB: Call SUB, but for a FUNCTION, use
MyResult = function_name[(args,etc)]

CBool, CByte, CDbl, CInt, CLng, CSng, CVar, CStr Functions
VB: Convert data types. HB: Not needed. E.g., MyLong = MySingle. HB automatically converts data type from the numeric type of the source variable or function to the destination type (see hottypes.bas).

CHDRIVE
VB: Changes drive. HB: Will be added for compatibility. Try CHDIR "c:\" where c is the desired drive.

CHR(value)
VB: Value is a Long. HB: Value any numeric data type.

ChrB and other "B" versions of string functions
HB: Not needed; use regular string functions. HB strings may contain any possible byte sequence.

Clear Method
HB: Applies to many objects (see FORM objects).

Click Event
HB: Wide variety of mouse events (e.g., see CONSOLE, FORM and MOUSE objects).

Close Method
VB: Closes or destroys a window. HB: .Close and .Destroy are different methods (see .Recreate, too) and apply to "windows" or child controls.

Collection Object
HB: LIST Object

Color Constants
HB: Same hex values.

Command, Command$ Function
VB: Returns command line arguments only. HB: COMMANDLINE$ returns entire command line. COMMAND$(0) returns executable pathname and COMMAND$(n) returns space-delimited arguments where n is 1, 2, etc.

Compiler Constants
VB: Win16 and Win32. HB: No equivalent constants; win32, pentium platforms supported.

Count Property
VB: Number of objects in a collection. HB: RESOURCECOUNT and Object properties .ItemCount and .LineCount.

CountOfLines Property
HB: .LineCount.

CreateEventProc Method
HB: See .On... Events in APPLICATION, FORM and TIMER objects.

CreateObject Function
HB: Objects created by DIM of Object qualified type (see Dimension). Some HB Objects are always available for use (CONSOLE, PRINTER, etc) and do not require a DIM or "CreateObject" statement. DECLARE for function in .ocx, .ax, etc libraries alone or within a Custom Object may also be used.

DATE
VB: Returns variant. HB: DATE$ returns string.

DDB Function
VB: Depreciation or declining balance. HB: factor * period * (cost - salvage) / life

Debug Object
VB: Output to "immediate" window. Debug.Print HB: If a GUI application, use SHOWCONSOLE first. Use PRINT

DefByte, DefInt, DefLng, DefSng, DefDbl, DefStr
VB: Associates first letter range(s) with a data type. HB: Variable names to dimension. E.g., Defint i, j, k, count, nbytes

DeleteLines Method
VB: Deletes one line or range of lines. HB: .DelItems deletes one or more items.

DELETESETTING
HB: Complete REGISTRY Object

DO
VB: Do [{While | Until} condition]. HB: Use DO or WHILE condition

ERASE
VB: Clears array. HB: MEMSET @array, array.length, 0 where array is the user symbol for a dimensioned array.

EOF Function
VB: EOF(filenumber) HB: FILE Object .EOF property

Eqv Operator
VB: Result = expression1 Eqv expression2
HB: Result = BOOL(BOOL(expression1) = BOOL(expression2))

FileAttr, FileDateTime, FileLen, etc functions
HB: Use FILEREC or FILE objects.

FILECOPY
VB: FileCopy source, destination. HB: Copy source, destination.

FOR EACH...NEXT
HB: FOR NEXT STEP

GetObject Function
VB: "application associated with the specified pathname is started and the object in the specified file is activated."
HB: {SHELL | RUN} application pathname

GETALLSETTINGS
HB: Complete REGISTRY Object

GETSETTING
HB: Complete REGISTRY Object

Imp Operator
VB: Result = expression1 Imp expression2
HB: Result = BOOL(expression1) AND NOT BOOL(expression2)

InputBox Function
VB: Prompt with user input. HB: Window with labelled EDIT and BUTTON Objects where BUTTON or Enter key causes this "dialog" to be invisible.

Item Method
Object.Item(index) syntax same in VB and HB.

LET
VB: [Let] varname = expression. HB: [Let] omitted.

Like Operator
VB: Result = string Like pattern
HB: Result = BOOL(string = pattern)

LOC
VB: Loc(filenumber). HB: FILE Object .Position property returns position of byte after last byte read or written.

LOCK, UNLOCK
HB: FILE Object .Open in Read/Write or Write mode locks file from other applications. FILE Object .Close unlocks file.

LOF Function
VB: LOF(filenumber) size of file. HB: FILE Object .Size property. Use FILEEXISTS, then FILEREC.Size if file is not open.

LOOP [{WHILE | UNTIL} condition]
HB: LOOP [UNTIL condition] or use WHILE loop.

LSET
VB: Left aligns a string padding trailing spaces.
HB: n1 = string.length: string = LTRIM$(string): n2 = string.length
IF n2 < n1 THEN string = string + SPACE$(n1 - n2)

NAME
VB: NAME oldpathname As newpathname. HB: MOVE oldpathname, newpathname or RENAME oldpathname, newpathname

Negation Operator (-)
VB: Operator in precedence order. HB: NEG (-) numeric function.

NULL
VB: Variant subtype. HB: Null string of zero length.

On expression GoSub destinationlist
On expression GoTo destinationlist
HB: Use SELECT CASE

On Error ...
HB: See .OnFPUError and hotyuk.html

OPEN
HB: FILE Object .Open method

Operator Precedence
VB: ^ * / \ MOD + - [relational] NOT AND OR XOR
HB: ^ * / \ SHL SHR MOD INV + - [relational] NOT AND OR XOR

OPTION BASE
HB: Not used; set automatically on a per subscript basis with DIM of array:
DIM a(5, 1 to 100) As LONG ' valid ranges 0 - 5 and 1 - 100

OPTION COMPARE {Binary | Text | Database}
HB: Not used; all compares are binary: IF "a" < "b" THEN PRINT "true". Also see numeric function MEMCMP.

OPTION EXPLICIT
HB: $OPTION Explicit; same as $TYPECHECK ON.

Option Private Module
HB: Not used; this is default (see PUBLIC).

OPTIONAL
HB: Not implemented in HB.

ProcBodyLine Method
VB: Excellent demo of obscuring simple ideas. HB: Organized according to tried-and-true, universally-known programming concepts -- namely, subroutines, RW object properties and functions giving numeric or string results. HB uses what you already know, without obfiscation.

PRINT #
HB: FILE Object Write methods and LPRINT statement.

PRIVATE
HB: When "module" is defined as an .obj file, in HB, all DIM items are private (see PUBLIC).

PROPERTY GET
VB: Function or read of a property. HB: Function or property without the "Property Get" hype [No objection to a little hype now and then.].

PROPERTY LET
HB: DECLARE SUB

PROPERTY SET
HB: SUB or FUNCTION setting a property free of "Property Set" hype.

PUBLIC
VB: Item accessible in all modules. HB: Called EXTERNAL and denotes dimensioned item which (1) is defined in another module or (2) is defined in the current module but is accessible in other modules. "Module" is defined as a linked .obj file. The EXTERNAL statement lists user symbols: E.g., EXTERNAL i, j, k, account, nitems

PUT
HB: FILE Object Write methods and LPRINT statement.

QueryClose Event
HB: FORM Object .OnClose event

Raise Method
HB: SHOWMESSAGE and numeric function MESSAGEBOX

REM
Same in VB and HB for comments including use of single quote character.

Remove Method
HB: Object .DelItems method

RESET
VB: Updates and closes all files. HB: Use FILE object .Close method for each open file.

Resize Event
HB: FORM Object .OnResize event

RESUME
VB: Resumes execution after an error-handling routine is finished. HB: Your code determines program flow (see APPLICATION.OnFPUError). For VB "RESUME line", use "Goto line" where line is a statement label.

RND[(number)] Function
HB: If number argument is present, result is integer from 0 to number. RND alone returns number between 0 and 1. Note: INT(RND * 256) similar to RND(255).

RSET
Please see LSET

SAVESETTING
HB: Complete REGISTRY Object

SEEK
VB: Current read/write position within a file. HB: FILE Object RW .Position property.

SENDKEYS
VB: Sends one or more keystrokes to the active window as if typed at the keyboard. HB: Use SENDMESSAGE function to send WM_KEYDOWN with key data to active window.

SET
HB: Not used; DIM does all. E.g., DIM object_name As Object where Object is a HB qualified type including Custom Objects. Note $DEFINE below comments out SET statements.

SetFocus Method
HB: FORM Object .Focus method

SLN Function
VB: Straight-line depreciation. HB: (cost - salvage) / life

Spc Function
VB: Spc(n) returns n space characters. HB: Space$(n)

StartUpPosition Property
HB: FORM Object .Center method and .Left, .Top, .Width and .Height properties.

STATIC
VB: Procedure variable has permanence. HB: Same as DIM; in SUB/FUNCTION procedures, all DIM variables automatically have permanence from one procedure call to another and are LOCAL.

STOP
HB: PAUSE statement (precede with SHOWCONSOLE in GUI applications).

StrComp Function
HB: Use IF ... THEN or MEMCMP.

Tab[(n)] Function
VB: Move to column n. HB: Tab = tab character; no argument.

TIME Function
VB: Returns variant(Date). HB: TIME$ returns time string.

TIMER Function
VB: Seconds elapsed since midnight. HB: Seconds since boot up.

TRUE Keyword
VB: -1 HB: 1

UNLOAD
VB: Unload object. HB: FORM Object .Destroy method. Regarding VB LOAD, see FORM Object DIM or .Recreate method.

UserForm Object
HB: FORM Object

VAL(string) Function
VB: Returns the numbers contained in a string as a numeric value. HB: Returns number based on valid string argument.

Value Property
HB: Not used; what else would it be? E.g., MyForm.Position, not MyForm.Position.Value

VARTYPE Constants
HB: Different than VB; see VARTYPE numeric function.

VBE Object, VBProjectsCollection, Windows Collection, CodePanesCollection, CommandBarsCollection, etc
HB: As a gift to software writers, there is none. Ah, the sweet taste of freedom. Most of the above are HB qualified types or could be $INCLUDE files, Custom Objects and/or function declarations and definitions.
Hint: Guess what the above VB items do to your REGISTRY.

Version Property
HB: R only VERSION Object returns OS version values.

WHILE...WEND
HB: WHILE...WEND or WHILE...END WHILE

WRITE #
HB: FILE Object Write methods and LPRINT statement.

$DEFINE #CONST CONST
$DEFINE #ELSEIF [[[EDIT THIS]]]
$DEFINE #ELSE $ELSE
$DEFINE "#END IF" $ENDIF
$DEFINE "AS ANY" As DWORD 
$DEFINE ASCB ASC
$DEFINE CURDIR CURDIR$
$DEFINE "LOG(" LN(
$DEFINE LCASE LCASE$
$DEFINE LEFT LEFT$
$DEFINE LTRIM LTRIM$
$DEFINE MID MID$
$DEFINE MSGBOX MESSAGEBOX
$DEFINE RIGHT RIGHT$
$DEFINE RTRIM RTRIM$
$DEFINE SET "'SET"
$DEFINE STR STR$
$DEFINE TRIM TRIM$
$DEFINE UCASE UCASE$

Copyright © 2004 James J. Keene PhD
HotBasic™ is a trademark of James J Keene
Original Publication: Aug 22, 2004