Empty Project Macro Tags

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
bniemerg
Posts: 8
Joined: Wed Sep 16, 2009 8:58 pm

Empty Project Macro Tags

Post by bniemerg »

I'm trying to pass my active project information to a batch file using the project macro tags and they all appear to be empty.

The tags I'm referring to are:

$ProjectBase or $PB
$ProjectDir or $PD
$ProjectDrive or $PDR
$ProjectDriveDir or $PDD
$ProjectFile or $Pf

I am using Zeus version 3.97j

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

Post by jussij »

There is a macro that can help debug these types of issuse. Just use the Macros, Load menu and load and run the the ztag.lua (or maybe ztag.zm) macro.

I'm not near Zeus at the moment so I am not 100% sure of the macro name.

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

Post by jussij »

I created the following Lua macro to show how to query the project details via a macro script:

Code: Select all

function key_macro()
    local message_text = ""

    -- Project file base name (excludes file extension)
    message_text = message_text .. "\nProject Base"      .. " = " .. macro_tag("$PB" )
    -- Project file drive and directory (includes '\')
    message_text = message_text .. "\nProject Drive Dir" .. " = " .. macro_tag("$PDD")
    -- Project file extension  (includes '.')
    message_text = message_text .. "\nProject Ext"       .. " = " .. macro_tag("$PE" )
    -- Project file name
    message_text = message_text .. "\nProject File"      .. " = " .. macro_tag("$PF" )

    -- name of all projects
    all_projects = projects()

    -- name of the active project
    project_name = project_active()

    -- files in the active project
    files = project_files(project_name, 0, "\\n")

    message_text = message_text .. "\n\n"
    message_text = message_text .. "\nAll Project Names"       .. " = " .. all_projects
    message_text = message_text .. "\nActive Project Name"     .. " = " .. project_name
    message_text = message_text .. "\nActive Project Files:\n" .. files

    message_box(1, message_text, "Zeus Macro Tags")
end

key_macro() -- run the macro
For me this macro is working as expected and returning sensible values.

Cheers Jussi
bniemerg
Posts: 8
Joined: Wed Sep 16, 2009 8:58 pm

Post by bniemerg »

Here are my results from running the ztag.lua macro.

https://docs.google.com/open?id=0Bz1Mt2 ... VlJWWhqcDQ
https://docs.google.com/open?id=0Bz1Mt2 ... nVEVkJiSjA

Thank you for your assistance.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Those links don't show for me :(

Juts rip up the images and you zeus project file (.zpi) and zeus workspace (.zwi) and send them to me as an e-mail.

Don't put any of your source files into the zip. Just the zwi and zpi files.

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

Post by jussij »

What version of Zeus are you running :?:

When open the project and workspace files that you provided and run the macro I get the expected results as shown below:

Code: Select all

---------------------------
Zeus Macro Tags
---------------------------
.....
Current Dir = E:\testing\
.....
Project Base = Dashboard
Project Drive = E:
Project Drive Dir = E:\testing\662btn\
Project Dir = \testing\662btn\
Project Ext = .zpi
Project File = E:\testing\662btn\Dashboard.zpi
---------------------------
OK   
---------------------------
bniemerg
Posts: 8
Joined: Wed Sep 16, 2009 8:58 pm

Post by bniemerg »

3.97j
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Silly me. You mentioned that earlier in the thread :oops:

What happens if you run the test.lua code:

Code: Select all

function key_macro()
    -- create a new file
    FileNew();

    local message_text = ""

    if is_workspace_open()  then
        -- Project file base name (excludes file extension)
        message_text = message_text .. "Project Base"      .. " = " .. macro_tag("$PB" )

        -- Project file drive and directory (includes '\')
        message_text = message_text .. "\nProject Drive Dir" .. " = " .. macro_tag("$PDD")

        -- Project file extension  (includes '.')
        message_text = message_text .. "\nProject Ext"       .. " = " .. macro_tag("$PE" )

        -- Project file name
        message_text = message_text .. "\nProject File"      .. " = " .. macro_tag("$PF" )

        -- name of all projects
        all_projects = projects()

        -- name of the active project
        project_name = project_active()

        -- files in the active project
        files = project_files(project_name, 0, "\\n")

        message_text = message_text .. "\n"
        message_text = message_text .. "\nAll Project Names"       .. " = " .. all_projects
        message_text = message_text .. "\nActive Project Name"     .. " = " .. project_name
        message_text = message_text .. "\n\nActive Project Files:\n" .. files
    else
        message_text = "No workspace currently open!"
    end

    write(message_text)
end

key_macro() -- run the macro
Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Ok, I think I know what might be happening.

Over the years this project details macro tag has taken on different meanings.

For example in earlier versions of Zeus there was no concept of a workspace only a single project, so at that time this tag meant the details for that one and only project.

With the advent of the workspace containing multiple projects that had to change.

In the Zeus that I'm running (which is the latest version) this macro tag refers to the details found in the Workspace Options, in the General panel, in the Project Make File field.

So what I suggest doing is putting something into that field and seeing what happens when you run the macro.

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

Post by jussij »

Further on this issue. I'm now quite confident that all you have to do is add your project details into the Project Make File field found in the the General panel located using the Workspace Options menu.

Cheers Jussi
bniemerg
Posts: 8
Joined: Wed Sep 16, 2009 8:58 pm

Post by bniemerg »

Adding the project name to the Project Make File field worked.

Thank you!
Post Reply