Variable that Changes

Basically, I want to define a value, which can change depending on what is going on elsewhere in the project.

I am using FastLED and an OLED screen, I basically want it to display what pattern it is showing when it comes on.

Each pattern shown below has a void() statement before it, and basically I want it to throw a value at the display function of the OLED.

void rainbow() 
{
  // FastLED's built-in rainbow generator
  fill_rainbow( leds, NUM_LEDS, gHue, 7);
}

void sinelon()
{
  // a colored dot sweeping back and forth, with fading trails
  fadeToBlackBy( leds, NUM_LEDS, 20);
  int pos = beatsin16( 13, 0, NUM_LEDS-1 );
  leds[pos] += CHSV( gHue, 255, 192);
}

void bpm()
{
  // colored stripes pulsing at a defined Beats-Per-Minute (BPM)
  uint8_t BeatsPerMinute = 380;
  CRGBPalette16 palette = PartyColors_p;
  uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);
  for( int i = 0; i < NUM_LEDS; i++) { //9948
    leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));
  }
}

eg, I have made a 'display.print(displayPattern)' statement, of which I want to be able to reference displayPattern to make it display whatever void pattern() it is inside of.

void setup() {
  //OLED
  // initialize and clear display
  display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
  display.clearDisplay();
  display.display();
  // display a line of text
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(27,30);
  display.print(displayPattern);

  display.display();
}

Hopefully you can help! I'd also appreciate an explanation to why you have done what you have, in terms of coding. I am new to C/C++, I have a fair knowledge on Java but this is completely Alien to me.
Thanks.

have you tried global variables?

arduino_new:
have you tried global variables?

How would I set that up?

I'm a complete C/C++ newb.

Also how would I declare that change? Would it be within the respective pattern void() statements?

Thanks

You put global variables outside of (typically above) any functions.

enum {PatternX, PatternY, PatternZ};
byte CurrentPatternID = PatternX;
char *CurrentPatternName = "Pattern X";

Then, in the place where you select a new pattern, set the global pointer to point to a different string constant:

     //  Change to pattern Y
    CurrentPatternID = PatternY;
    CurrentPatternName = "Pattern Y";

Then when you update the display, print CurrentPatternName.

theoisadoor:
I have a fair knowledge on Java

Then you should be familiar with the concept of a FUNCTION. That's what the entities in your code such as rainbow(),fill_rainbow(), and bpm() are, not 'voids'. The 'void' specifier in their definition simply means that they don't return a value.