If true: draw this plot, if false: draw other plot

Hi all, I am trying to do something which I know is possible in Python, but I’m not sure how to ‘translate’ it to C++.

Basically, I have a macro that I would like to ‘split’ into 2 different parts. One part plots one thing and the second part plots another plot. I would like to be able to say at the start of my code which plot I want my macro to plot

So I thought I’d something like this:
At the start of my code I write

plot_1 = true/false; 
plot_2 = false/true;

So, if I want to plot the first plot, I write plot_1 = true and plot_2 = false

And then I thought I would write

if (plot_1 = true) {
// this is where I write the code that would eventually plot my first plot
}

else if (plot_2 = true) {
// this is where I write the code that would eventually plot my second plot
}

However, I get an error message saying ‘use of unidentified declarer plot_1: plot_1 = true’ and similarly for plot_2. What am I doing wrong? Thanks!

plot_1 = true/false; 
plot_2 = false/true;

if (plot_1) {
// this is where I write the code that would eventually plot my first plot
} else if (plot_2 ) {
// this is where I write the code that would eventually plot my second plot
}
1 Like

ah yes, that looks better! But I still get the error that ‘plot_1 is an unidentified declarer: plot_1= true’…

plot_1 and plot_2 should be declared à bool of course.

bool plot_1,plot_2;
plot_1 = true/false; 
plot_2 = false/true;
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.