Compiler setup
Compiler setup
In Zeus, I have my compiler command line set up as:
c:\pfw236\pfw.exe include $FN
The "include" means to include or compile $FN, which, I think, is the current file.
This works well. In Zeus, when I say "Compile," it brings up the compiler and compiles the current file.
However, if I then change some code in the file in Zeus and then again say, "Compile," it does not work. It simply makes an error sound, and nothing happens.
But if I close the compiler and then go back to Zeus and say, "Compile," it works fine.
How might I get around this without always having to close down the compiler? Can Zeus be implemented to send the file to the compiler over and over again? Or, each time that I say "Compile," can it bring up a new instance of the compiler?
Thank you.
c:\pfw236\pfw.exe include $FN
The "include" means to include or compile $FN, which, I think, is the current file.
This works well. In Zeus, when I say "Compile," it brings up the compiler and compiles the current file.
However, if I then change some code in the file in Zeus and then again say, "Compile," it does not work. It simply makes an error sound, and nothing happens.
But if I close the compiler and then go back to Zeus and say, "Compile," it works fine.
How might I get around this without always having to close down the compiler? Can Zeus be implemented to send the file to the compiler over and over again? Or, each time that I say "Compile," can it bring up a new instance of the compiler?
Thank you.
The compiler feature is designed to work the way you describe, so itHow might I get around this without always having to close down the compiler? Can Zeus be implemented to send the file to the compiler over and over again?
sounds like something in the Zeus configuration is not quite correct.
It looks like your command line is correctly defined. One thing to check is that if the file being compiled contains white spaces then make sure you use "$fn" rather than $fn.
To help debug the compiler feature just do the following:
- Options, Editor Options menu
- Go to the General section
- Check the Help debug tools, macros and executables option.
The tricky part to correctly configuring the compiler relates to the fact that Zeus can pick up the compiler command line from many different locations. To help with this configuration the compiler output window should contain a line of output similar to one of these:
Code: Select all
--------------Configuration: A Project - Release--------------
Code: Select all
--------------Configuration: A Project - Debug----------------
Code: Select all
Using document type compiler options....
There is no reason why Zeus can not be made to to work the way you describe, but if you find that this reply does not fix the probelm, post the compiler outputs produced for the working and failing cases.
Cheers Jussi
Hello,
The file will compile only if I use $fn. If I try to use "$fn", the file will not compile at all.
I have set up the compiler command line using Options/Document Types/Forth Documents.
So, using $fn: with the compiler not running: in Zeus, if I say, "Compile," the compiler comes up and the file compiles ok, and the Zeus compiler output reads:
---------------------------------------------------------------------------
Zeus for Windows Programmers Editor - Version 3.93d
Copyright (c) Xidicone Pty Ltd 1993-2004. All rights reserved.
---------------------------------------------------------------------------
**** Unregistered Software. To be used for evaluation purposes only. ****
---------------------------------------------------------------------------
Debug: Changed to the 'c:\pfw236\user\' directory supplied
Debug: Command: c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
--------------------Configuration: <default settings> - Release--------------------
Using document type compiler options....
Debug: Command Line: C:\WINNT\system32\cmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
Debug: Started Process ID: 0x684
Then, with the compiler still running, if I say "Compile" again in Zeus, the file does not compile, there is an error sound, and the compiler output reads the same as before:
---------------------------------------------------------------------------
Zeus for Windows Programmers Editor - Version 3.93d
Copyright (c) Xidicone Pty Ltd 1993-2004. All rights reserved.
---------------------------------------------------------------------------
**** Unregistered Software. To be used for evaluation purposes only. ****
---------------------------------------------------------------------------
Debug: Changed to the 'c:\pfw236\user\' directory supplied
Debug: Command: c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
--------------------Configuration: <default settings> - Release--------------------
Using document type compiler options....
Debug: Command Line: C:\WINNT\system32\cmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
Debug: Started Process ID: 0x684
If I use the above Command Line:
C:\WINNT\system32\cmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
from the Start/Run of Windows 2000, it brings up the compiler and compiles the file just fine, and I can repeat it with no problems. Each repeat brings up a new instance of the compiler.
In the Forth Document Type settings in Zeus, I have simply specified the Compiler Command Line as:
c:\pfw236\pfw.exe include $fn
I have not specified anything for any of the other lines (Lines Regex, etc.) on the page.
Please clarify. I like this editor, but I am probably doing something unconscious here. Thank you.
Robert
The file will compile only if I use $fn. If I try to use "$fn", the file will not compile at all.
I have set up the compiler command line using Options/Document Types/Forth Documents.
So, using $fn: with the compiler not running: in Zeus, if I say, "Compile," the compiler comes up and the file compiles ok, and the Zeus compiler output reads:
---------------------------------------------------------------------------
Zeus for Windows Programmers Editor - Version 3.93d
Copyright (c) Xidicone Pty Ltd 1993-2004. All rights reserved.
---------------------------------------------------------------------------
**** Unregistered Software. To be used for evaluation purposes only. ****
---------------------------------------------------------------------------
Debug: Changed to the 'c:\pfw236\user\' directory supplied
Debug: Command: c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
--------------------Configuration: <default settings> - Release--------------------
Using document type compiler options....
Debug: Command Line: C:\WINNT\system32\cmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
Debug: Started Process ID: 0x684
Then, with the compiler still running, if I say "Compile" again in Zeus, the file does not compile, there is an error sound, and the compiler output reads the same as before:
---------------------------------------------------------------------------
Zeus for Windows Programmers Editor - Version 3.93d
Copyright (c) Xidicone Pty Ltd 1993-2004. All rights reserved.
---------------------------------------------------------------------------
**** Unregistered Software. To be used for evaluation purposes only. ****
---------------------------------------------------------------------------
Debug: Changed to the 'c:\pfw236\user\' directory supplied
Debug: Command: c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
--------------------Configuration: <default settings> - Release--------------------
Using document type compiler options....
Debug: Command Line: C:\WINNT\system32\cmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
Debug: Started Process ID: 0x684
If I use the above Command Line:
C:\WINNT\system32\cmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
from the Start/Run of Windows 2000, it brings up the compiler and compiles the file just fine, and I can repeat it with no problems. Each repeat brings up a new instance of the compiler.
In the Forth Document Type settings in Zeus, I have simply specified the Compiler Command Line as:
c:\pfw236\pfw.exe include $fn
I have not specified anything for any of the other lines (Lines Regex, etc.) on the page.
Please clarify. I like this editor, but I am probably doing something unconscious here. Thank you.
Robert
Then, with the compiler still running, if I say "Compile" again in Zeus, the file does not compile, there is an error sound, and the compiler output reads the same as before:
When Zeus makes a sound does the status bar (located at the bottom left) show this message text

I think what is happening is the pfw.exe is not closing down, so Zeus thinks the compile is still running."The spawn failed as there is another spawn that is still active."
You can check this by right clicking on the Windows Task Bar and selecting the Task Manager option. You should then see the pfw.exe in the processes list.
Cheers Jussi
Yes, this is exactly what is happening. When the error occurs, the Zeus status bar says "The spawn failed as there is another spawn that is still active." And, in Windows Task Manager, pfw.exe is still running.
Nevertheless, I would still like to compile files from Zeus, and it would be convenient to do so without having to manually shut down the compiler each time, i.e., simply bring up a new instance of the compiler when I say "Compile."
For instance, using the Boxer text editor, I can do this wthout any problem, so I know it is possible. In Boxer, the compiler command line is:
C:\PFW236\PFW.EXE include $Filepath
So --- is there some way to accomplish this? Would it help if I asked the compiler people any questions?
Thank you.
Nevertheless, I would still like to compile files from Zeus, and it would be convenient to do so without having to manually shut down the compiler each time, i.e., simply bring up a new instance of the compiler when I say "Compile."
For instance, using the Boxer text editor, I can do this wthout any problem, so I know it is possible. In Boxer, the compiler command line is:
C:\PFW236\PFW.EXE include $Filepath
So --- is there some way to accomplish this? Would it help if I asked the compiler people any questions?
Thank you.
When you run the compile inside Boxer, does the Windows Task Manager show that pfw.exe is still running even after the compile has completedFor instance, using the Boxer text editor, I can do this wthout any problem, so I know it is possible. In Boxer, the compiler command line is: C:\PFW236\PFW.EXE include $Filepath

It is possible to change Zeus to allow this, but doing so is only hiding the problem. The reason Zeus can not start another compile is because the first compile has not finished. Starting another compiler would just mean there would then be two, three, four ... X compilers that had not yet finishedSo --- is there some way to accomplish this?

As to why the first compile refuses to die, well that is another question

Remember when you wrote this:
This higlights the exact same problem. The /c command option for cmd.exe is meant to run the program and then quit:If I use the above Command Line: C:\WINNT\system32\cmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F from the Start/Run of Windows 2000, it brings up the compiler and compiles the file just fine, and I can repeat it with no problems. Each repeat brings up a new instance of the compiler.
The reason you get a new window every time you run this from the command line is the cmd.exe has not terminating. But it should terminate since that is what the /c option asked it to doCMD [/X | /Y] [/A | /U] [/Q] [[/C | /K] string]
/C Carries out the command specified by string and then terminates

For example as a test if you run this command line instead:
Code: Select all
cmd.exe /c sort.exe test
You could ask them why this command line does not close the cmd.exe like it is supposed to:Would it help if I asked the compiler people any questions?
Code: Select all
cmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F
Code: Select all
@echo off
REM Run the compile
c:\pfw236\pfw.exe include %1
REM Hopefully this line will fix the problem
exit
With some luck this might force the compiler to die.
Cheers Jussi
Thank you. I will try out your suggestion.
But also, another idea --- In Zeus, I created a new tool called "ProForth." For the program name, I used c:\pfw236\pfw.exe. For the argument, I used "c:\pfw236\pfw.exe include $fn" (including the quotes). I told it to Run Normal, Capture Standard Output, and Capture Standard Error.
With my b1.fth file in the Zeus window, if I call up the ProForth tool, it brings up the compiler and compiles the file. Then, if I call up the ProForth tool again, it compiles the file again in a new instance of the compiler. I can compile the file over and over again without any problem.
So, three questions:
1. How can I get the Compile command to do what the tool command does?
2. Or how can I make an icon or a shortcut to call up my ProForth tool conveniently?
3. If I compile using the ProForth tool, is there any difference from compiling with the Zeus Compile command?
Thank you.
But also, another idea --- In Zeus, I created a new tool called "ProForth." For the program name, I used c:\pfw236\pfw.exe. For the argument, I used "c:\pfw236\pfw.exe include $fn" (including the quotes). I told it to Run Normal, Capture Standard Output, and Capture Standard Error.
With my b1.fth file in the Zeus window, if I call up the ProForth tool, it brings up the compiler and compiles the file. Then, if I call up the ProForth tool again, it compiles the file again in a new instance of the compiler. I can compile the file over and over again without any problem.
So, three questions:
1. How can I get the Compile command to do what the tool command does?
2. Or how can I make an icon or a shortcut to call up my ProForth tool conveniently?
3. If I compile using the ProForth tool, is there any difference from compiling with the Zeus Compile command?
Thank you.
When you run the compile inside Boxer, does the Windows Task Manager show that pfw.exe is still running even after the compile has completedjussij wrote:For instance, using the Boxer text editor, I can do this wthout any problem, so I know it is possible. In Boxer, the compiler command line is: C:\PFW236\PFW.EXE include $Filepath

I forgot to answer this earlier --- yes, when Boxer pulls up the compiler, the Windows task manager shows that the compiler is still running. When I use Boxer to compile many times, each instance of the compiler shows up in Windows Task Manager, all running at once.
There is no way to do this. For good reasons the Zeus compiler feature is designed to wait for the compiler to finish. But as you can see by the Windows task manager the forth compiler is broken as it never finishes1. How can I get the Compile command to do what the tool command does?

All you can do is add the item to the main menu and/or the right click popup menu.2. Or how can I make an icon or a shortcut to call up my ProForth tool conveniently?
I am not sure what you mean by this question3. If I compile using the ProForth tool, is there any difference from compiling with the Zeus Compile command?

Cheers Jussi
Well, I certainly appreciate your help on all this.
As I understand it, the problem is simply with my compiler, that it just keeps on running and does not know how to quit properly.
I will send an email to the compiler people, asking if this can be helped. Since I do not know much about this, can you suggest any technical questions that I should ask?
As I understand it, the problem is simply with my compiler, that it just keeps on running and does not know how to quit properly.
I will send an email to the compiler people, asking if this can be helped. Since I do not know much about this, can you suggest any technical questions that I should ask?
That is correct.
For example, if you do nothing more than use the Start, Run button and type in:
For example, if you do nothing more than use the Start, Run button and type in:
The fact that this command will create a DOS window that never closes defines the problem exactly. If the compiler was well behaved it would end gracefully and the /c option would kill the DOS window once the compile was completecmd.exe /c c:\pfw236\pfw.exe include c:\pfw236\user\B1.F

Hi Robert,
The latest version of Zeus offers another possible solution to this problem. For more details see the Capturing tools/compiler output posting.
I can not test this myself as I do not have the Forth compiler, but with some luck it might just work
Cheers Jussi
The latest version of Zeus offers another possible solution to this problem. For more details see the Capturing tools/compiler output posting.
I can not test this myself as I do not have the Forth compiler, but with some luck it might just work

Cheers Jussi
Hello,
Thank you. But I do not understand the code in the Capturing tools/compiler posting.
However, I emailed Stephen Pelc, who is the creator of the ProForth compiler that I am using. By the way, ProForth does not use a DOS window, and it is an interpreter/compiler that always remains interactive. Stephen's email address is stephen@mpeltd.demon.co.uk , in case you wish to talk with him on this.
Anyway, when I explained the problem, he said:
"Try driving the editor from ProForth rather than ProForth from
the editor. The real problem is that ProForth permits multiple
instances of itself."
Robert:
> Is it possible to send a file to ProForth from an editor, to have
> it compile, then to go back to the editor and send the file to
> compile again? Or must I always close ProForth in order to
> compile again?
Stephen:
"This will depend on the macro facilities in the editor, in
particular whether it can detect that an application is already
running. Most editors are set up for batch compilers rather than
interactive compilers."
So --- does this help in any way? Do you think that I should attempt the Capturing tools/compiler posting code that you suggested in your last message? If so, can you explain what is being done there?
Thank you.
Thank you. But I do not understand the code in the Capturing tools/compiler posting.
However, I emailed Stephen Pelc, who is the creator of the ProForth compiler that I am using. By the way, ProForth does not use a DOS window, and it is an interpreter/compiler that always remains interactive. Stephen's email address is stephen@mpeltd.demon.co.uk , in case you wish to talk with him on this.
Anyway, when I explained the problem, he said:
"Try driving the editor from ProForth rather than ProForth from
the editor. The real problem is that ProForth permits multiple
instances of itself."
Robert:
> Is it possible to send a file to ProForth from an editor, to have
> it compile, then to go back to the editor and send the file to
> compile again? Or must I always close ProForth in order to
> compile again?
Stephen:
"This will depend on the macro facilities in the editor, in
particular whether it can detect that an application is already
running. Most editors are set up for batch compilers rather than
interactive compilers."
So --- does this help in any way? Do you think that I should attempt the Capturing tools/compiler posting code that you suggested in your last message? If so, can you explain what is being done there?
Thank you.
Well that does explain why the Forth compiler is not ending. It is does not want to end 
In all the previous attempts to get the compiler to work, you need to pick the one that managed to capture the output to a text file. For example the batch file option might be the way to go.
Then you just need to use a macro something like this to run that command:
But even if this works, it will not get around the problem of the fact that there will be endless numbers of forth compilers still running
The guy who writes the compiler really needs to add a command line option that would enable the compile to do its work and then end. If such a command line option was available all this would work perfectly, without the need for these attempts at a work around
Cheers Jussi

In all the previous attempts to get the compiler to work, you need to pick the one that managed to capture the output to a text file. For example the batch file option might be the way to go.
Then you just need to use a macro something like this to run that command:
Code: Select all
function key_macro()
-- the file to be compiled
local file_name = macro_tag("$fb") .. macro_tag("$ext")
-- the directoruy of the file
local dir = macro_tag("$fdd")
-- NOTE: You may need to change the command below. For example
-- using the pfe.cmd option might work the best here.
-- the command needs to cpature the output to a file
local cmd = "c:\\pfw236\\pfe.exe include " .. file_name .. " > output.txt"
-- run the command hidden
local flags = 16+32
-- this is for debugging only
message_box(1, cmd);
local result = system(cmd, dir, flags)
-- this file should be created
local file_output = dir .. "output.txt"
-- send the output to a Zeus compiler window
file_open_compiler(file_output, "Forth Compiler")
end
key_macro() -- run the macro

The guy who writes the compiler really needs to add a command line option that would enable the compile to do its work and then end. If such a command line option was available all this would work perfectly, without the need for these attempts at a work around

Cheers Jussi