Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Compile error.

I am a student taking Visual Basic 6.0 and when I tried to run my program, it gave me an "Invalid Outside Procedure" error
message. I have looked everywhere and cannot find what it means. Can somebody please tell me what it means. I cannot
finish my homework until I can get past this error. Thanks for the help.

Bridget Karlin

Comments

  • KDivad LeahcimKDivad Leahcim Member Posts: 3,948
    : I am a student taking Visual Basic 6.0 and when I tried to run my program, it gave me an "Invalid Outside Procedure" error
    : message. I have looked everywhere and cannot find what it means. Can somebody please tell me what it means. I cannot
    : finish my homework until I can get past this error. Thanks for the help.
    :
    : Bridget Karlin
    :

    That means you have attempted to place executable lines outside of a procedure. A procedure is defined as a Function, Sub or Property. VB help has this:
    =============
    The statement must occur within a Sub or Function, or a property procedure (Property Get, Property Let, Property Set). This error has the following cause and solution:

    An executable statement, Static or ReDim, appears at module level.

    Static is unnecessary at module level, since all module-level variables are static. Use Dim instead of ReDim at module level. To create a dynamic array at module level, declare it with Dim using empty parentheses.

    Note At module level, you can use only comments and declarative statements, such as Const, Declare, Deftype, Dim, Option Base, Option Compare, Option Explicit, Option Private, Private, Public, and Type. The Sub, Function, and Property statements occur outside the body of their procedures, but within the procedure declaration.
    =============

    Hope this helps!
    KDL
  • Justin BibJustin Bib USAMember Posts: 0

    ________ \ http://forcoder.org \ free video tutorials and ebooks about // Scratch, PL/SQL, Visual Basic, C++, JavaScript, Perl, Java, Objective-C, Go, MATLAB, C#, Python, Visual Basic .NET, R, Assembly, Ruby, Delphi, PHP, C, Swift Julia, Rust, Fortran, COBOL, Dart, Lisp, Kotlin, Apex, Erlang, Crystal, Awk, VBScript, Clojure, Scheme, Prolog, Logo, D, Lua, Bash, SAS, F#, ML, ABAP, Ada, Hack, Alice, FoxPro, Scala, Transact-SQL, LabVIEW // _____

Sign In or Register to comment.