QB64 Phoenix Edition
I'm working on an old MS-DOS thingy... - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: I'm working on an old MS-DOS thingy... (/showthread.php?tid=3880)



I'm working on an old MS-DOS thingy... - KlamPs - 08-23-2025

Hey all!




I haven't been around here for a while. I have been working on an "old DOS" (or, I'd like it to compile to be used in DOS on Virtualbox) a little like DOSSHELL, or Norton Desktop, just to see if I can do it. But on all of the modules including the Main, I'm getting this error:




[Image: Screenshot-2025-08-22-172617.png]


RE: I'm working on an old MS-DOS thingy... - FCS_coder - 08-23-2025

If those INCLUDES are older files, they probably have SUBs defined in them.  QB64 wants things ordered:

Variables
Main progrm code
SUBs

New INCLUDE libraries accomplish this by spitting thing out in two files, TYPES, etc in the first and the SUBS, etc in the second.  When you use the library, you INCLUDE the declartions file at the top, have your code, then INCLUDE the library code at the end. 

What are the libraries, and do they have style QB64 INCLUDE files?


RE: I'm working on an old MS-DOS thingy... - hsiangch_ong - 08-25-2025

more accurately.  qb64 cannot use "include" files that were meant for quickbasic.  or maybe for freebasic.

this is because qb64 requires non-executable code at the top.  type... end type declarations must be at the top of the program.  before any variable is declared with dim or redim.  could have type... end type declaration inside a subprogram but right below the sub/function header and parameter list.  and before any executable code of the subprogram.  data statements must be after any executable code of the main program.  and before any sub/function definition.

there are some pratfalls with using chain and common shared.  therefore in qb64 you should avoid them.  if you really need to share data between two qb64 programs.  you must use a temporary file.