Problem with $INCLUDE under QuickBASIC 4.0 
Author Message
 Problem with $INCLUDE under QuickBASIC 4.0

The Waite's Group "Microsoft Quick Basic Bible" has this passage in it's
Description of the $INCLUDE Metacommand:

"A file specified by the $INCLUDE metacommand must be a source-code file
that is stored seperate from the main program.  It must be an ASCII file
-- not one in BASIC Quick-load format -- and cannot contain subprograms
or functions."

I don't have QuickBASIC 4.0, but looked throught the 4.5 manuals and on
page 348 of the "Programming in BASIC" manual it says:

"There are two restrictions on using include files:

1.  Included files must not contain SUB or FUNCTION statements.
2.  Included files created with BASICA must be save with the ,A option."


Quote:

> Further to the problem with $INCLUDE metacommand in QuickBASIC 4.0
> that I have posted a few days ago, following is a little bit more
> detailed explaination:

> Supposed for example we have a main module called 'TEST.BAS'
> as follows:

> CLS
> PRINT "TEST"
> CALL TRY
> END

> REM $INCLUDE: 'TRY.BAS'

> and that the Include file 'TRY.BAS' is as follows:

> SUB TRY
> PRINT "TRY"
> END SUB

> After invoking the qb.exe and Open the Program 'TEST.BAS',
> and we try to Start the program under the Run menu, then the
> program will stop, and the word TRY after the SUB in the
> include file is high-lighted, and an error message: "Statement
> cannot occur within $INCLUDE file" will come up.

> However, if we remove the last line in the main module
> TEST.BAS, i.e., REM $INCLUDE: 'TRY.BAS', and Load the
> include module TRY.BAS with Load File... under the File menu,
> then the program will run without problem. It also will work
> fine, if we compile the program manually with bc.exe in command
> line under the DOS prompt, and than link it with link.exe into
> an EXE file.

> What is wrong? Has someone the same experience?
> Can someone be helpful to explain how can we rectify that
> problem?

> Thanks,
> Wijono

--
Best,
Bill
(Remove SPAMBLOCK from my e-mail address to reply.)
-------------------------------------------------------------
"Never trust a man who can spell a word only one way." -- Samuel Clemens
"Damn the spell checker, full speed ahead!" -- me!


Mon, 22 May 2000 03:00:00 GMT  
 Problem with $INCLUDE under QuickBASIC 4.0

Quote:

> The Waite's Group "Microsoft Quick Basic Bible" has this passage in it's
> Description of the $INCLUDE Metacommand:

> "A file specified by the $INCLUDE metacommand must be a source-code file
> that is stored seperate from the main program.  It must be an ASCII file
> -- not one in BASIC Quick-load format -- and cannot contain subprograms
> or functions."

> I don't have QuickBASIC 4.0, but looked throught the 4.5 manuals and on
> page 348 of the "Programming in BASIC" manual it says:

> "There are two restrictions on using include files:

> 1.  Included files must not contain SUB or FUNCTION statements.
> 2.  Included files created with BASICA must be save with the ,A option."


> > Further to the problem with $INCLUDE metacommand in QuickBASIC 4.0
> > that I have posted a few days ago, following is a little bit more
> > detailed explaination:

> > Supposed for example we have a main module called 'TEST.BAS'
> > as follows:

> > CLS
> > PRINT "TEST"
> > CALL TRY
> > END

> > REM $INCLUDE: 'TRY.BAS'

> > and that the Include file 'TRY.BAS' is as follows:

> > SUB TRY
> > PRINT "TRY"
> > END SUB

> > After invoking the qb.exe and Open the Program 'TEST.BAS',
> > and we try to Start the program under the Run menu, then the
> > program will stop, and the word TRY after the SUB in the
> > include file is high-lighted, and an error message: "Statement
> > cannot occur within $INCLUDE file" will come up.

> > However, if we remove the last line in the main module
> > TEST.BAS, i.e., REM $INCLUDE: 'TRY.BAS', and Load the
> > include module TRY.BAS with Load File... under the File menu,
> > then the program will run without problem. It also will work
> > fine, if we compile the program manually with bc.exe in command
> > line under the DOS prompt, and than link it with link.exe into
> > an EXE file.

> > What is wrong? Has someone the same experience?
> > Can someone be helpful to explain how can we rectify that
> > problem?

> > Thanks,
> > Wijono

> --
> Best,
> Bill
> (Remove SPAMBLOCK from my e-mail address to reply.)
> -------------------------------------------------------------
> "Never trust a man who can spell a word only one way." -- Samuel Clemens
> "Damn the spell checker, full speed ahead!" -- me!

I don't know about other languages or versions, but in QB 4.5 include
files are not designed to handle executeable code.  They are for
Declares, Types and Commons.
The above are instructions to the compiler, and as such are considered
source code, but are not executeable code.

--
     Delhi, La.,  Gateway to:   Poverty Point  Archaeological Center
     Site of the oldest  pre-historic  civilization in North America
     Personal Home
Page:,...........HTTP://cust2.iamerica.net/cgodard          
     Business Home
Page:............HTTP://cust.iamerica.net/ggodard      
     KA5EJW  Advanced Class Ham     FCC General Class
Radiotelephone                                
     Personal ICQ Id# 3145938       TV Man Chat ICQ id# 4918275



Mon, 22 May 2000 03:00:00 GMT  
 Problem with $INCLUDE under QuickBASIC 4.0

Further to the problem with $INCLUDE metacommand in QuickBASIC 4.0
that I have posted a few days ago, following is a little bit more
detailed explaination:

Supposed for example we have a main module called 'TEST.BAS'
as follows:

CLS
PRINT "TEST"
CALL TRY
END

REM $INCLUDE: 'TRY.BAS'

and that the Include file 'TRY.BAS' is as follows:

SUB TRY
PRINT "TRY"
END SUB

After invoking the qb.exe and Open the Program 'TEST.BAS',
and we try to Start the program under the Run menu, then the
program will stop, and the word TRY after the SUB in the
include file is high-lighted, and an error message: "Statement
cannot occur within $INCLUDE file" will come up.

However, if we remove the last line in the main module
TEST.BAS, i.e., REM $INCLUDE: 'TRY.BAS', and Load the
include module TRY.BAS with Load File... under the File menu,
then the program will run without problem. It also will work
fine, if we compile the program manually with bc.exe in command
line under the DOS prompt, and than link it with link.exe into
an EXE file.

What is wrong? Has someone the same experience?
Can someone be helpful to explain how can we rectify that
problem?

Thanks,
Wijono



Tue, 23 May 2000 03:00:00 GMT  
 Problem with $INCLUDE under QuickBASIC 4.0

The

Quote:
> REM $INCLUDE: 'TRY.BAS' in test.bas should come before any executable

statements!!!!!


Tue, 23 May 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. QuickBasic (4.0/4.5) Problem (Real Mess)

2. Including a parameter with the RUN statement in QuickBasic 4.5

3. reference on including ASM in QuickBasic code?

4. Difference between QuickBasic 4.0 & 4.5

5. Need a QuickBasic 4.0 Decompiler

6. QuickBasic 4.0 Source

7. quickbasic 4.0

8. Visual Basic 4.0 Win 95 Nice Batman Mouse Effects (Code Included) - Project5.zip (0/1)

9. Visual Basic 4.0 Win 95 Calculate your hourly wage (Code Included) - Vb4-rate.zip

10. Visual Basic 4.0 Win 95 Nice Batman Mouse Effects (Code Included) - Project5.zip (1/1)

11. Which DLL includes GetUserName in NT 4.0 ?

12. VB 4.0 and NT 4.0 problems

 

 
Powered by phpBB® Forum Software