So i am using a sample project file or hello world program and the file contains
--verbose
--keep-files
--list=samp.lst
No where it it that explains what these are, what they do, and other options that may be put in.
Thank you
Richard
Project file question
Re: Project file question
There is a section of the manual that describes compiler options, one of which is an option to specify a project file. The description of that option explains that a project file may contain, in addition to the names of the files in the project, compiler options. The compiler options are distinguished by beginning with two dashes, e.g. --verbose.rich wrote:No where it it that explains what these are, what they do, and other options that may be put in.
So, you'll find the descriptions of the compiler options that you named, along with all other compiler options, in chapter 10 of the ZBasic Reference manual.
http://www.zbasic.net/doc/ZBasicRef.php?page=161
It may be preferable to use the PDF version of the manual since you can search in it for the various options.
http://www.zbasic.net/doc/ZBasicRef.pdf
P.S. I just noticed that the table of contents of both the HTML and PDF versions of the manual don't match the actual content beginning with chapter 8. I'll try to get this fixed.
- Don Kinzer
Yes. You put the names of all the modules comprising your project in the project file. If you ever have a project that includes C and/or assembly language files, those file names also go in the project file.rich wrote:I have two modules, so i put both names in the project file.
As described in the manual, the compiler options, generally speaking, should appear before any of the module names.
In most cases, it doesn't matter but it does have an effect. The first module listed in the project file is considered to be the "main" module and it must contain the Sub Main().rich wrote:Does the order matter?
The names of the generated files (including, importantly, the .zxb file) are based on the name of the "main" module. So if, for example, the first named module is mytest.bas the generated executable file will be named mytest.zxb.
The other difference between the "main" module and all the others is that some Option directives may only appear in the "main" module. Read the information about the various Option directives in section 2.3.1 of the ZBasic Reference Manual.
www.zbasic.net/doc/ZBasicRef.php?page=18
You don't need to prefix the subroutine/function name with the module name (in most cases). The compiler discovers what public procedures are available among all the modules of a project and will determine which one is being invoked.rich wrote:Given that the subs in the second module are declared public, how do i call them?
The rare case of when the module name prefix is needed would be if the main module has a private subroutine with the same name as a public subroutine in another module like this:
Code: Select all
//---- Module A.bas ----
Sub Main()
Call myTestSub()
Call B.myTestSub()
End Sub
Private Sub myTestSub()
End Sub
//---- Module B.bas ----
Public Sub myTestSub()
End Sub
- Don Kinzer