Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Menu Help using C (Switch)

Status
Not open for further replies.

cnandha19

Member level 3
Member level 3
Joined
Aug 28, 2015
Messages
59
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
604
When 2 Pressed,
Delete Product : 1. Yes / 2. No
If 1 pressed,
Confirm : 1.Yes / 2. No
If 1 pressed, delete product Info
is it correct way ??

Code:
      int deleteproductrecords();

int deleteproductrecords()
{
	
	int ret =0;
	lcdClear();
	lcdMoveCursor(0,0);
	lcdPrintStr("Delete Product rec:");
	lcdMoveCursor(1,6);
	
	lcdPrintStr("1.Yes:");
	lcdMoveCursor(2,6);
	lcdPrintStr("2.No:");
	
	while(1)
	{
		
		ret = READ_SWITCHES();
		
		
		 if(ret == '1')
		 {
			 lcdClear();
			 lcdMoveCursor(0,0);
			 lcdPrintStr("Delete product rec:");
			 lcdMoveCursor(2,7);
			 lcdPrintStr("1.Yes");
			 
			 
		 }
		 
		 if(ret == enterkeystore)
		 {
			 
			 
			 lcdClear();
			 lcdMoveCursor(0,0);
			 lcdPrintStr("Delete product rec:");
			 lcdMoveCursor(2,7);
			 lcdPrintStr("Deleted");
		 }
		 
		 if(ret == nextkeystore)
		 {
			 
			 
			 lcdClear();
			 lcdMoveCursor(0,0);
			 lcdPrintStr("Delete product rec:");
			 lcdMoveCursor(2,7);
			 lcdPrintStr(" Not Deleted");
		 }
		 
		 if(ret == '2')
		 {
			 
			 
			 lcdClear();
			 lcdMoveCursor(0,0);
			 lcdPrintStr("Delete product rec:");
			 lcdMoveCursor(2,7);
			 lcdPrintStr("2.No");
			 
		 }
		
		else if(ret == '3')
		{
			return;
		}
		
	}
	
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top