PDA

View Full Version : How to increment string?


Richard Von
07-30-2007, 07:15 AM
I am trying to draw multiple vertical lines on a chart using DrawVerticalLine. This requires providing a string tag which must be unique each time used. I can't figure out how to increment a string.

I've tried this:

In the variable section:

int TagNbr = 1;

In the code:

string myTag = string "myTag" + TagNgr.ToString;
TagNbr = TagNbr +1;

The error says I can't use the + operator in this context.

I'm sure this is awkward and there must be a better way.

NinjaTrader_Ray
07-30-2007, 07:16 AM
string myTag = "myTag" + TagNgr.ToString();