Missing something elementary about macro syntax

I'm missing something dreadfully simple here. I've got the following trivial macro:

MACRO mybox

LWIDTH 0.1
BOX 2,2 3,3

ENDM

I save that to a file, load the macros from that file, and run it, but nothing happens. (And yes, it's a small map - so I should see the box even though it's small.) What am I not doing here?

Comments

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    Working fine once you remove those empty lines inside the macro.
  • LOL, I never would have guessed the whitespace to be significant there. I still can't get it to work, though. Specifically, I'm doing the following...

    1) Tools->Edit Macros, and adding the above lines to the end of the fcw32 macro file (without the extra lines)
    2) Tools->Load Macros to load the same file (probably unnecessary)
    3) Typing "mybox" and hitting Enter.

    Nothin. No box, no error message, nothin. I also tried with semicolons at the end of the two commands. Clearly I'm missing something rather elementary here.
  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    hmm.. It should work...
    I copied the lines from your post and pasted into my macro file the same way you describe (Except that I skipped step 2, which is not required). I then removed the empty lines (Before I did that, CC3 only crashed when trying the command)

    Make sure your current colour is set to something visible though. Since your macro doesn't change this, the box is drawn using the current one.
  • It should be visible... I can do the box manually at the command line and it shows up just fine. I notice my line width isn't being changed, so it doesn't look I'm even entering the macro at all. Simplifying even further, it still doesn't work if I drop the LWIDTH command. The macro just doesn't seem to get called.
  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited August 2008
    If CC3 didn't find the macro, it would have given an error, so it should be called.

    Your fill style isn't set to "Hollow" with no outline by any chance? That would make the macro draw an object that is invisible.
    Make sure your current colour is something visible, that the line style (LS) is set to "Solid", and that the fill style (FS) is also set to "Solid". Neither of these should be the problem if you can draw it manually though, but I am kind of running out of ideas here. The macro works perfectly on my computers, drawing a very tiny square at the designated coordinates.

    You can also look for invisible objects by using the Info -> List command, and drag a selection rectangle around the entire area the box is supposed to be drawn in. If there is something there, the status line should show it, and when you complete the command, the lsit window should show the object details.
  • OK, I guess I'll take this one to tech support then. Thanks.
  • I suspect the problem was that there isn't a final <cr> at the end of the ENDM line - I usually hit enter a couple of times to make sure it's there or I add new macros at the top of the file rather than the bottom :)
  • Simon RogersSimon Rogers Administrator, ProFantasy Traveler
    Use Notepad to edit macros, save after changes then use Load Macro to reload them.
Sign In or Register to comment.