XP & SYMBOLC Looping Problem

I'm working on an XP project to draw some planets in a loop. I can run the SYMBOLC command once successfully. When I loop it, I can't get it to run correctly. Here's a simple function with the problem with many creative details removed: (Sorry, I can't figure out how to format C++ code here.)

void XPCALL RunCreation()

{

char Command[500];


for (int i = 0; i < 4; i++)

{

sprintf_s(Command, "SYMBOLC;D:\\ProgramData\\Profantasy\\CC3Plus\\Symbols\\Cosmographer\\Cos Bitmap A\\CosA_Planets_Traveller.FSC;CosA Planet Life 1;4.0;4.0;0.0;0.0,0.0;");

ExecScriptCopy(Command);

}


Redraw();

CmdEnd();

}


When I run this, I get "ChkData DAV has no pending DRQ - Bitmap". So, I tried adding a second semicolon at the end of the command. This makes the "Symbol Parameters" dialog appear.

Any advice? I've tried so many different combinations, but each one has small problems. What's the correct way to run this command many times in a loop? Thanks.

Comments

  • MonsenMonsen Administrator 🖼️ 81 images Cartographer
    edited May 3

    The reason you're getting into trouble here is that SYMBOLC is a repeating command that lets you place multiple symbols with one command. This means that when you get to that second iteration of your loop, the command is still very much active and running, and just waiting for the next position, not ready to accept a new command.

    While normally, placing that extra ; at the end will result in a blank input that terminates most such commands, unfortunately this one is set up to show the symbol parameters dialog on a blank input instead (that default action in square brackets you see on the command line when running it manually)

    I am sure Joe has a better way to deal with this, but you can terminate the command by sending it something that is neither a coordinate, nor a blank line. For example by appending _; to your command. If you were using the command interactively, just hitting Esc would be the proper way, but you can't send that as a parameter on the command line in any way I am aware of.

  • Brilliant! This worked perfectly. I should have asked sooner. I was worried about asking small questions that I thought I should have been able to deal with.

    Thank you!

  • jslaytonjslayton Moderator, ProFantasy Mapmaker

    Does using the ^; sequence act as an ESC character in a macro? There is what I would consider a questionable control-key accelerator translation that uses the low 6 bits of whatever character is present after a ^ marker as a lookup into the accelerator table. Admittedly, that accelerator shouldn't be mapped to anything and so I wouldn't expect anything to happen.

    It does look like the vertical bar character ( | ) will generate an ESC in scripts if that helps.

Sign In or Register to comment.