coding debugging and debugging Rexx codes

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
blacfit85
Posts: 4
Joined: Wed Apr 10, 2013 12:48 am

coding debugging and debugging Rexx codes

Post by blacfit85 »

Hello eveybody, I am very new with Zeus, an I do'nt know how to configure it for rexx developments... :cry:
should somedy give me entries in this soft to help me to use it ? I have installed Centos rexxdev plugin, it is recognized by Zeus ( in Windows/preferences). I believe that I have to done other thigs, but I do ntoknow what. Could somebody help me ? :oops:
Thank you ! :D

For rexx, I am using regina and reginald versions , and they are well known by zeus . the code hilightning is good.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

I have installed Centos rexxdev plugin.


I am assuming you mean this plug-in: http://rexxdev.sourceforge.net/
For rexx, I am using regina and reginald versions, and they are well known by zeus.

Are you talking about the Zeus web server :?:

This is a forum for the Zeus IDE not the Zeus Web Server.

If you are looking for a REXX IDE then Zeus will be able to do this and I'm more than happy to help you set this up.

But if you are confusing this with the Zeus Web Server then you are in the wrong forum ;)

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Based on the Regina document file I found here: http://aarnet.dl.sourceforge.net/projec ... regina.pdf

As a starting point I would suggest setting up the REXX Document Type (Options, Editor Options menu) and in the compiler section setting this as the command line:

Code: Select all

"<Your install path>regina.exe" -c program "$fn"
The Your install path is the location of the REXX interpreter.

That will allow you to use the Compile menu to compile the currently active REXX file.

In a similar manner you could also create a tool (also in the document type) to execute the current file and capture the output into Zeus.

If you have scripts that require user input that is also possible, but for that you will need to use a Zeus macro. There are many examples of such scripts in the Zeus script folder.

Also, if you post an example of the command line used to run a REXX script I'd be more than happy to create this execute script for you ;)

Cheers Jussi
blacfit85
Posts: 4
Joined: Wed Apr 10, 2013 12:48 am

Post by blacfit85 »

Thank you for your answers.
I am assuming you mean this plug-in: http://rexxdev.sourceforge.net/
yes .
Are you talking about the Zeus web server
No i'm talking about the Zeus IDE
It is assumed , in it description, to support Rexx language development tools : edit debug, run, and so...

Regina rexx can be executed via rexx.exe or regina.exe. the help of regina :
Regina REXX-Regina_3.7(MT) 5.00 14 Oct 2012. All rights reserved.
Regina is distributed under the terms of the GNU Library Public License
and comes with NO WARRANTY. See the file COPYING-LIB for details.

To run a Rexx program:
regina [switches] [program] [arguments...]
where switches are:

-h,-? show this message
-v display Regina version and exit
-r run Regina in "safe" mode
-t[trace_char] set TRACE any valid TRACE character - default A
-a pass command line to Rexx program as separate arguments
-p pause after execution (Win32 only)
-l[locale] use the system's default charset or a supplied one
-oOPTIONS specify OPTIONS in same format as OPTIONS instruction
program is the file containing Rexx code to execute
arguments are arguments passed to program

To tokenise a Rexx program:
regina -c program(input) tokenisedfile(output)

To execute a tokenised file:
regina -e tokenisedfile [arguments...]

If you intend using external functions (using RxFuncAdd) you need to run the "regina" executable


Regina path : C:\Program Files\rexx.org\Regina\regina.exe
It is included inf the elements of the windows PATH environnement variable

Thank you again
cheers
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Thanks for that information. It is good to know it contains a complete REXX environment.

Zeus should have no trouble running the two rexx.exe or regina.exe executables.

Also since these executables are in the PATH you can get away with defining the compiler command line as:

Code: Select all

regina.exe -c program "$fn
The same also applies for the command line for the tools.

As for debugging, Zeus has support for the GDB debuuger so if this REXX package also uses that debugger it might be possible to also get the debugger to work. I will take a look at this.

Let me know if you run into any issues.

Cheers Jussi
blacfit85
Posts: 4
Joined: Wed Apr 10, 2013 12:48 am

Post by blacfit85 »

Hello,
I always have problems in customzing Zeus to manage Rexx scripts.
I have created Workspace , project, I have imported some Rexx sources that I know well working. I have defined rexx.exe "$Fn" as compiler command .
I can now compile and execute output only scripts, but not interactives. There is no dialog windows opened... I can't debug , and so . This product is too more complicated for me to customize. Therefore I am an old Geek, my job was System engeener and programer. I do not succeed in usingZeus as rexx IDE.

Would you have exmples from peoples having done this ?

Thanks and best regards. :)
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi,
I can now compile and execute output only scripts, but not interactives.
To run interactive scripts in Zeus you need to use a Zeus macro script. This is exactly how Zeus runs C#, Lua, Go and Python interactive scripts.
This product is too more complicated for me to customize.
Zeus definitely requires a level of user customization and it also needs a basic understand of things like command lines and system paths etc.
Would you have examples from peoples having done this?
Just do the following:

1) Save the code below to a file called rexx_exec.py in the zScript folder.

On Windows Vista, Windows 7 etc that folder is here:

Code: Select all

C:\Users\<user name>\AppData\Roaming\Xidicone\Zeus\zScript\
On Windows XP that folder is here:

Code: Select all

C:\Program Files\Zeus\zScript\
2) Edit the REXX document type and add the following macro:
Menu Text: Execute '$f" Script
Macro Name: $zudzScript\rexx_exec.py
Arguments: "$fn"
[x] Add to popup menu

NOTE: The $zudzScript in the arguments above point to the zScript folder described earlier.

3) Change this line of code in the rexx_exec.py to whatever you need to run the current file in the REXX interpreter:

Code: Select all

# the 'REXX command to run the current filename
cmdREXX = "REXX.exe " + file_name
4) Now open a REXX file and run this macro from the Macros menu.

It should run your current file through the REXX interpreter, display a user input dialog so you can interact with the script and capture the output inside of Zeus when you end the script.

Here is code for the rexx_exec.py script:

Code: Select all

#
#        Name: Execute REXX script
#
#      Author: Jussi Jumppanen
#
#    Language: Python
#
# Description: This function is used to execute a REXX script in a MS-DOS
#              window and have the script output captured in Zeus when
#              the script terminates.
#

import os
import zeus

def key_macro():
   file_name = ""

   if zeus.argc() == 1:
       # get the file passed in
      file_name = zeus.argv(0)

      # save the current file
      zeus.FileSave()
   else:
      # the initial value
      nill = ""

      # ask the user to name the script that is to be run
      file_name = zeus.user_input("REXX Script to Execute:", nill)

      if (len(file_name) == 0):
         zeus.message("The operation cancelled by user.")
         zeus.beep()
         return

   # the output file name
   file_output = file_name + ".ztow"

   # remove the file quotes to allow the file to be deleted
   file_output_ex = file_output.translate(None, '"')

   # remove any previous output file
   if os.access(file_output_ex, os.F_OK):
      os.remove(file_output_ex)

   # the 'REXX command to run the current filename
   cmdREXX = "REXX.exe " + file_name

   # the 'run script' command using tee to capture the output to a file
   cmd = cmdREXX + " 2>&1 | tee " + file_output

   #zeus.message_box(0, cmd, "Test")

   # run the command as a MS-DOS command in a visible DOS window and wait for it to finish
   flags = 16+32+64

   # run the command which should be displayed in a DOS window
   zeus.system(cmd, "", flags)

   # capture the standard output, run as a DOS batch command and wait for it to finish
   flags = 2+16+32

   # send the resulting output file to zeus using the type MS-DOS command
   zeus.system("type " + file_output, "", flags)

   # remove the output file
   if os.access(file_output_ex, os.F_OK):
      os.remove(file_output_ex)

key_macro() # run the macro
Cheers Jussi
blacfit85
Posts: 4
Joined: Wed Apr 10, 2013 12:48 am

Post by blacfit85 »

hello,
I have done as you said, and when executing a valid REXX code, i get the message below . I do not know phyton syntax, so I can't fix it by myself .
Thank you for your help
---------------------------------------------------------------------------
Zeus - Version 3.97o
Copyright (c) Xidicone P/L 1993-2013. All rights reserved.
---------------------------------------------------------------------------
**** Unregistered Software. To be used for evaluation purposes only. ****
---------------------------------------------------------------------------



Unexpected error running command line:
C:\Windows\system32\cmd.exe /c type "L:\Zeus_regina\Demos\animal.rexx".ztow
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

What did you use as the REXX command line in the Python script :?:

Code: Select all

# the 'REXX command to run the current filename
cmdREXX = "REXX.exe " + file_name
This is the command line that is used to run the REXX interpreter and you need change this to suit you REXX setup.

For example I tested the macro using Regina REXX but the Regina.exe was not in the path so I used this for the REXX command:

Code: Select all

# the 'REXX command to run the current filename
cmdREXX = "D:\projects\REXX\Regina.exe " + file_name
If I had put the executable in the path I could have made it this:

Code: Select all

# the 'REXX command to run the current filename
cmdREXX = "Regina.exe " + file_name
If I had been using a different REXX interpreter I would have to make sure the command line was correct.

To help debug the script you can also chaneg this line:

Code: Select all

#zeus.message_box(0, cmd, "Test")
to this:

Code: Select all

zeus.message_box(0, cmd, "Test")
This will display the full command line.

Cheers Jussi
Post Reply