Trying to make a clock without using RTC with IR remote input

Hello,

I am trying to make a clock without a RTC with inputs for the current time being inputed with an IR remote controller.

I am trying to keep my IR sensor results all in extra functions. I have one to read the numbers for input into the system (translateIR), one to signal the clock to edit the current time(settimereader) and one to change Am/Pm (ampmreader). I'm trying to have an output of those functions to be int values but it's not working. Most errors I get as I try to fix this are "'settimereader' was not declared in this scope" and 'settime' does not name a type. My current code is below. Can you help me get the values I need so I can use them elsewhere.

Thanks!

// initialize the library with the numbers of the interface pins
#include <LiquidCrystal.h>
#include <IRremote.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;

volatile int sec, minute = 0, hour = 0;
//volatile int digit = 0;
//volatile int settime = 0; // When set time = 0, no edit. when set time = 1, allowed to edit
//volatile int ampm=0; //when ampm = 0 its am. when ampm = 1 its pm.

volatile int settime;
settime = settimereader();

int ampm;
ampm = ampmreader();

int digit;
digit = translateIR();

void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16,2);
// Print a message to the LCD.
lcd.setCursor(0,0);
lcd.print(" Hello! ");
delay(5000);
lcd.clear();

// set up IR Sensor
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop()
{

//setting the time on the clock, clock will stop.
while (settime == 1)
{
lcd.setCursor(0,0);
lcd.print(" Enter Time ");
lcd.setCursor(0,1);
digit = translateIR();
hour = digit *10;// set tens place of hour
lcd.print(digit);

digit = translateIR();
hour = hour + digit;// set ones place of hour
lcd.print(digit);
lcd.print(" : ");

digit = translateIR();
minute = digit*10;//set tens place of minute
lcd.print(digit);

digit = translateIR();
minute = minute + digit; //set ones place of minute
lcd.print(digit);
//delay(500);
lcd.print(" : ");
if(sec<10)
{
lcd.print("0");
lcd.print(sec);
}
else
lcd.print(sec);
lcd.print(" ");
delay(3000); //delayed to see time to be set
settime = 0;
}

while (settime == 0)
{
lcd.setCursor(0, 0);
delay(1000);//delay 1 second before clock shows 1 sec passes
lcd.print("Time: ");
lcd.setCursor(0, 1);
if (hour < 10)
{
lcd.print("0");
lcd.print(hour);
}
else
{
lcd.print(hour);
}
lcd.print(":");
if (minute < 10)
{
lcd.print("0");
lcd.print(minute);
}
else
{
lcd.print(minute);
}

lcd.print(":");
if (sec < 10)
{
lcd.print("0");
lcd.print(sec);
}
else
{
lcd.print(sec);
}
lcd.print(" ");
if (ampm == 0)
{
lcd.print("AM");
}
else
{
lcd.print("PM");
}

sec++; //add 1 to sec after every second
if (sec > 59)
{
minute++;
sec = 0;
}

if (minute > 59)
{
hour++;
minute = 0;
}
if (hour > 23)
{
hour = 0;
//ampm++;
}
}
irrecv.resume(); // Receive the next value
}
}

// create function for translating IR

int translateIR()
{
int digit;
if (irrecv.decode(&results)) {
switch(results.value)
{
// convert IR to digits for entering

case 0xFFA25D:
digit = 1;
break;
case 0xFF629D:
digit = 2;
break;
case 0xFFE21D:
digit = 3;
break;
case 0xFF22DD:
digit = 4;
break;
case 0xFF02FD:
digit = 5;
break;
case 0xFFC23D:
digit = 6;
break;
case 0xFFE01F:
digit = 7;
break;
case 0xFFA857:
digit = 8;
break;
case 0xFF906F:
digit = 9;
break;
case 0xFF9867:
digit = 0;
break;

//create am or pm change button for #
//case 0xFFB04F:
//ampm++;
//if (ampm>1)
//ampm = 0;
//break;

}
delay(500);
irrecv.resume();
}
return digit;
}

int settimereader() { // reads the set time
int settime;
if (irrecv.decode(&results)) {
switch (results.value) {
case 0xFF6897:
settime++;
if (settime > 1)
settime = 0;
break;
}
delay(500);
irrecv.resume(); // Receive the next value
}
return settime;
}

int ampmreader() {
int ampm;
if (irrecv.decode(&results)) {
switch (results.value) {
case 0xFFB04F:
ampm++;
if (ampm>1)
ampm = 0;
break;
}
delay(500);
irrecv.resume(); // Receive the next value
}
return ampm;
}

If You read the first instructing topics for every segment of Forum telling how to use this Forum You will find "code tags", the upper left symbol in this window. That will make more helpers stepping in. It also makes it easy for us to copy Your code into an IDE window and serach, compile etc.

You can use the "Auto format" in IDE. That often shows errors like a lost curly bracket. Your definition of settimereader is not recognized by the compiler, likely caused by a missin "{" or "}".