Fabulous Adventures In Coding

Eric Lippert's Blog

Thirty Years of Backwards Compatibility

In response to my earlier series on error handling in VBScript, Ian Griffiths blogged that Reuben Harris noticed an interesting fact about VBScript error numbers -- a fact which I will shamelessly steal and blog about myself.

Here's the complete VBScript runtime error number table.

    5 Invalid procedure call or argument
    6 Overflow
    7 Out of memory
    9 Subscript out of range
   10 This array is fixed or temporarily locked
   11 Division by zero
   13 Type mismatch
   14 Out of string space
   17 Can't perform requested operation
   28 Out of stack space
   35 Sub or Function not defined
   48 Error in loading DLL
   51 Internal error
   52 Bad file name or number
   53 File not found
   54 Bad file mode
   55 File already open
   57 Device I/O error
   58 File already exists
   61 Disk full
   62 Input past end of file
   67 Too many files
   68 Device unavailable
   70 Permission denied
   71 Disk not ready
   74 Can't rename with different drive
   75 Path/File access error
   76 Path not found
   91 Object variable not set
   92 For loop not initialized
   94 Invalid use of Null
  322 Can't create necessary temporary file
  424 Object required
  429 ActiveX component can't create object
  430 Class doesn't support Automation
  432 File name or class name not found during Automation operation
  438 Object doesn't support this property or method
  440 Automation error
  445 Object doesn't support this action
  446 Object doesn't support named arguments
  447 Object doesn't support current locale setting
  448 Named argument not found
  449 Argument not optional
  450 Wrong number of arguments or invalid property assignment
  451 Object not a collection
  453 Specified DLL function not found
  455 Code resource lock error
  457 This key is already associated with an element of this collection
  458 Variable uses an Automation type not supported in VBScript
  462 The remote server machine does not exist or is unavailable
  481 Invalid picture
  500 Variable is undefined
  501 Illegal assignment
  502 Object not safe for scripting
  503 Object not safe for initializing
  504 Object not safe for creating
  505 Invalid or unqualified reference
  506 Class not defined
  507 An exception occurred
32811 Element not found
32812 The specified date is not available in the current locale's calendar

There are errors missing from the table -- errors which VB6 raises that VBScript never raises, like "Return without gosub" or "Bad DLL calling convention".  And there are errors added that make no sense in VB6, like "not safe for scripting".  But more or less, it's the same as the VB6 run-time error table where possible. Obviously that's for backwards compatibility reasons.

Altair BASIC was Microsoft's first product, written by Bill Gates and Paul Allen back in 1975 for the Altair 8080. (Trivia: Microsoft's corporate switchboard number 425-882-8080 is an homage to the Altair!) Here's the Microsoft Altair BASIC error table, both parser and runtime errors:

 1 NEXT without FOR
 2 Syntax error
 3 RETURN without GOSUB
 4 Out of data
 5 Illegal function call
 6 Overflow
 7 Out of memory
 8 Undefined line
 9 Subscript out of range
10 Redimensioned array
11 Division by zero
12 Illegal direct
13 Type mismatch
14 Out of string space
15 String too long
16 String formula too complex
17 Can't continue
18 Undefined user function
19 No RESUME
20 RESUME without error
21 Unprintable error
22 Missing operand
23 Line buffer overflow
26 FOR without NEXT
29 WHILE without WEND
30 WEND without WHILE
50 Field overflow
51 Internal error
52 Bad file number
53 File not found
54 Bad file mode
55 File already open
57 Disk I/O error
58 File already exists
61 Disk full
62 Input past end
63 Bad record number
64 Bad file name
66 Direct statement in file
67 Too many files

I had no idea that the chain of backwards compatibility went back to the original Bill & Paul code!  30 years of backwards compatibility -- not bad!

Published Thursday, September 09, 2004 10:12 AM by Eric Lippert
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

RichB said:

I don't want to let history get rewritten - Monte Davidoff had a big hand in the original Altair BASIC too.

See http://www.alluvialsw.com/about.html
September 9, 2004 11:37 AM
 

Norman Diamond said:

> Trivia: Microsoft's corporate switchboard
> number 425-882-8080 is an homage to the
> Altair

The last time I looked at Intel's corporate switchboard number it also ended in 8080, but it wasn't a tribute to the Altair, it was a tribute to one of the makers of a small component used in the Altair.

I also met the man whose phone number ended in 8086. His book and his Ph.D. thesis had nothing to do with hardware and no special relationship to Intel chips, but I neglected to ask what brought about that illustrious phone number.

Hmmmmm. By the way, does anyone know if the IBM z-series still uses the same ABEND codes that OS/360 used? If it does, that's 40 years. When the trusty little "IEBGENER" program (IBM's version of the Copy command but with fewer features) abended with 0C4 (one of IBM's kinds of access violation), no one believed me until I showed them.
September 9, 2004 7:27 PM
 

mike said:

I suppose it would be cranky to point out that in 30 years, error messages haven't gotten all that much more helpful. "Bad file mode" indeed. :-)
September 9, 2004 8:13 PM
 

Tim Smith said:

LOL... Good to see that old error 9 is still the "BS" error. I remember that from my old Co-Co days.

Memories, from the corner of my mind...
September 9, 2004 9:12 PM
 

Joe Grossberg said:

Some of the error codes in VBScript date back to the days when Bill Gates and Paul Allen were the...
September 13, 2004 6:45 PM
 

Ian Griffiths said:

Rich, Monte Davidoff wrote the maths package, so strictly speaking it is correct to attribute the error codes to Bill and Paul.

By the way, if you follow the link through to the interview about BASIC on The Register's web site, you'll see there's a link to another article discussing the Altair BASIC source code.

In that article it mentions that two guys named Ian Griffiths (that would be me) and Reuben Harris dug up the code and did some reverse engineering of it. So not only was I aware that Monte Davidoff wrote the maths package, I went to look at the archived copy of the source code in Harvard a few years ago...

The Register article is a little misleading - Reuben did all of the actual reverse engineering work, not me.

Sadly, the link to his work in that article is now defunct. But you can find it temporarily here: http://www.interact-sw.co.uk/altair/ and the page specifically linked to by The Register is here: http://www.interact-sw.co.uk/altair/other%20versions/ian.htm
September 27, 2004 10:15 AM
 

Jackie Goldstein's Weblog said:

September 28, 2004 8:41 PM
 

Notes from Classy's Kitchen said:

OK, they're not really consistent - but at least their BASIC error codes are....
October 7, 2004 7:15 AM
 

The Old New Thing said:

January 17, 2005 11:45 AM
 

.NET Brain Droppings said:

March 9, 2005 9:15 PM
 

James Shea said:

Most of the Z/OS abend codes '0c4, 0c1, oc7' date back to 360 machines era 'which btw does not mean 60's machines' but that the machnes perform for an entire 360 degreee circle of computing functons, which puts them near 50 years old.   What is a S0C4?  Keeping your feet warm.

December 23, 2006 2:35 AM
 

Very funny.vbs « Suspens??o de Descren??a said:

July 11, 2008 1:56 PM

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Submit

About Eric Lippert

Eric Lippert is a senior developer on the Microsoft C# compiler team. Before that he worked on the framework of Visual Studio Tools For Office. Before that, he worked on the compilers, runtimes and tools for VBScript, JScript, Windows Script Host and other Microsoft Scripting technologies. He lives in Seattle and spends his free time editing books about programming languages, playing the piano, and trying to keep his tiny sailboat upright in Puget Sound.

This Blog

Syndication


© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker