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 » Fri Jan 04, 2013 5:30 pm

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: 2508
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Sat Jan 05, 2013 3:03 am

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: 2508
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Sun Jan 06, 2013 10:23 pm

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 » Wed Jan 09, 2013 2:56 pm

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: 2508
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Wed Jan 09, 2013 10:04 pm

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: 2508
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Thu Jan 10, 2013 12:16 am

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 » Thu Jan 10, 2013 2:29 am

3.97j

jussij
Site Admin
Posts: 2508
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Thu Jan 10, 2013 3:06 am

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: 2508
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Thu Jan 10, 2013 3:30 am

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: 2508
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Thu Jan 10, 2013 5:45 am

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 » Thu Jan 10, 2013 4:45 pm

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

Thank you!

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 4 guests