<pre lang="cs">do{ /* poll the payout device and check for events */ if(PollPayoutDevice(&pay) == 0){ exitLoop = 1; } Sleep(100); if(_kbhit()){ /* which command key was hit */ switch(getchar()){ case 'x': /* end run */ case 'X': exitLoop = 1; break; case 'p': /* Payout a value */ case 'P': printf("Enter payout value: "); scanf_s("%d",&payoutValue); if(SetPayOutAmount((unsigned long)payoutValue * pay.TrueValueMultiplier) == 0){ exitLoop = 1; } break; case 'e': /* empty the payout */ case 'E': printf("\nEmptying command sent...\n"); if(EmptyPayout()== 0){ exitLoop = 1; } /* enable payout for operations after emptying */ if(EnablePayout(&pay) == 0){ exitLoop = 1; } break; case 'f': case 'F': /* TO DO - add function for float command */ break; } } }while(!exitLoop);</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)