Duplicate Labels Can Only Be Separately Compiled s (21862)



The information in this article applies to:

  • Microsoft QuickBASIC 2.01

This article was previously published under Q21862

SUMMARY

Question:

Can I use the same line numbers or line labels in different subprograms that are compiled in the same source file?

Response:

No, but you can use the same line numbers or line labels if the subprograms are separately compiled.

Line numbers and labels are local to the compiled module in which they occur. Line numbers and labels must be unique within a given compiled module. You do not need to worry about duplicate labels in separately compiled modules.

Note that using the REM $INCLUDE metacommand to include source code from a separate file is similar to putting the two sources into one file. Any files included at compile time with the REM $INCLUDE metacommand are considered as part of that module, and are included in the .OBJ file.

This information needs to be added to Section 9.2.1, "Using Line Labels", on Page 160 of the "Microsoft QuickBasic Compiler" manual for Versions 2.00, 2.01, and 3.00.

Modification Type:MinorLast Reviewed:1/8/2003
Keywords:KB21862