Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Reserved Words Full List

Status
Not open for further replies.

YoshiCD

Programmer
Feb 24, 2001
96
ES
Here's a complete list as provided by MS on some obscure location of their website!

[tt]
Abs Access AddItem AddNew Alias And Any App AppActivate Append AppendChunk
Arrange As Asc Atn Base Beep BeginTrans Binary ByVal Call Case CCur CDbl
ChDir ChDrive Chr Chr$ CInt Circle Clear Clipboard CLng Close Cls Command
Command$ CommitTrans Compare Const Control Controls Cos CreateDynaset CSng
CStr CurDir$ Currency CVar CVDate Data Date Date$ DateSerial DateValue Day
Debug Declare DefCur CefDbl DefInt DefLng DefSng DefStr DefVar Delete Dim
Dir Dir$ Do DoEvents Double Drag Dynaset Edit Else ElseIf End EndDoc EndIf
Environ$ EOF Eqv Erase Erl Err Error Error$ ExecuteSQL Exit Exp Explicit
False FieldSize FileAttr FileCopy FileDateTime FileLen Fix For Form Format
Format$ Forms FreeFile Function Get GetAttr GetChunk GetData DetFormat GetText
Global GoSub GoTo Hex Hex$ Hide Hour If Imp Input Input$ InputBox InputBox$
InStr Int Integer Is IsDate IsEmpty IsNull IsNumeric Kill LBound LCase
LCase$ Left Left$ Len Let Lib Like Line LinkExecute LinkPoke LinkRequest
LinkSend Load LoadPicture Loc Local Lock LOF Log Long Loop LSet LTrim
LTrim$ Me Mid Mid$ Minute MkDir Mod Month Move MoveFirst MoveLast MoveNext
MovePrevious MoveRelative MsgBox Name New NewPage Next NextBlock Not Nothing
Now Null Oct Oct$ On Open OpenDataBase Option Or Output Point Preserve
Print Printer PrintForm Private PSet Put QBColor Random Randomize Read ReDim
Refresh RegisterDataBase Rem RemoveItem Reset Restore Resume Return RGB Right
Right$ RmDir Rnd Rollback RSet RTrim RTrim$ SavePicture Scale Second Seek
Select SendKeys Set SetAttr SetData SetFocus SetText Sgn Shared Shell Show
Sin Single Space Space$ Spc Sqr Static Step Stop Str Str$ StrComp String
String$ Sub System Tab Tan Text TextHeight TextWidth Then Time Time$ Timer
TimeSerial TimeValue To Trim Trim$ True Type TypeOf UBound UCase UCase$
Unload Unlock Until Update Using Val Variant VarType Weekday Wend While
Width Write Xor Year ZOrder
[/tt]

Hope this Helps!

Regards,


yoshiweb.gif


"I'm an idealist. I don't know where I'm going but I'm on the way." — Carl Sandburg, 20th-century American poet and writer
 
That list is not complete with respect to VB6. Right off, I see three intrinsic functions missing - InStrRev, Join and Split.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Cajun Centurion,

Thanks for the input.

I apologise for the deficiencies (spelling?) in this list, but don't shoot the messenger! :)

List was retrieved from MS.

Regards,

yoshiweb.gif


"I'm an idealist. I don't know where I'm going but I'm on the way." — Carl Sandburg, 20th-century American poet and writer
 
YoshiCD, Why didn't you just continue with thread222-657317. Now people have to bounce betwenn the two threads.

If you didn't see the first one then I apologize, but check out the post anyway.

Thanks and Good Luck!

zemp
 
Zemp,
I apologise, i did see it.
However, the site wouldn't let me reply to it. The "Your Reply" box didn't show up and the options at the top of the thread weren't there. they only showed "Read New Posts"

I've been experiencing a few probs accessing tek-tips in my browser. Maybe this was the prob.

Sorry Again,

Regards,

yoshiweb.gif


"I'm an idealist. I don't know where I'm going but I'm on the way." — Carl Sandburg, 20th-century American poet and writer
 
Only problem is ... it ain't so.

Try this

Dim AddItem As String
AddItem = "ABC"
List1.AddItem AddItem
Msgbox AddItem

works fine ... so it may be a reserved word when referred to as a method (e.g. List1.AddItem) but VB doesn't seem to have any problems with it as a variable. Haven't checked but I suspect that most of (all?) the words in the list that are not part of the VB language but are rather Properties, Methods or Events of VB objects will work the same way.
 
if you use a proper naming convention you'll never need to worry about reserved words.

this is an issue which seems to raise hackles (especially my own). i have seen "professional" applications which would have benefitted from this advice.

i digress. why use "Access" when "strAccess" or "sAccess" or "Access%" will convey what you want - and more - without any possibility of conflict?

is there a reason that i have overlooked for the conscientious convention-follower to worry about reserved words?

gusset
 
The postion taken by MS in its VB Programmer's Guide is:

A restricted keyword is a word that Visual Basic uses as part of its language. This includes predefined statements (such as If and Loop), functions (such as Len and Abs), and operators (such as Or and Mod).

For More Information For a complete list of keywords, see the Language Reference.


However, the Language reference doesn't contain a special section nor an appendix on Reserved Words.

From which we may deduce that every caption from #Const till ZOrder together with appendices B (Data Types) and C (Operators). These captions include as Golom suspected Methods, Properties and Event names. We can therefore argue that they too are reserved words, certainly within the context of their respective objects.

In the extreme we may include captions from the VB Controls Reference (Part 2 of the Programmer's Reference). And on top of that why not include the whole bunch of methods and properties from MS Office??

I think trying to capture a list of Reserved Words is an academic exercise but a doomed effort. Certainly as the list may be extended (sometimes reduced) by future releases.

I would (and I do most times) stick to gusset's suggestion: Use MS's coding conventions as described in the same Programmer's Reference. As long as MS doesn't use them for their own convenience (no irony intended) you're on the safe side




_________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
 
The reason that I started the original Thread that Yoshi has continue is because I am teaching students about reserved words. Although I agree with Golom, Gusset and rvBasic, you have to take into account Procedure names. If you had a procedure that was going to load a picture then you could not call the procedure LoadPicture because it just wont work.

Private Sub Form_Load()
Call LoadPicture("c:\example.bmp")
End Sub

Private Sub LoadPicture(mypicture As String)
Me.Picture = LoadPicture(mypicture)
End Sub

Rest assured that I will be teaching them correct naming conventions!!!

Thanks for all your input though.


Greg Palmer

----------------------------------------
Any feed back is appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top