this is my code: define var iTotalClicks define var iClickRun while ! exit && iTotalClicks <= 20 [ onClick: iClickRun ++ show iClickRun on label onShowTotal: iTotalClicks += iClickRun iClickRun = 0; show iTotalClicks on label show iClickRun on label ] Code (markup): can anybody help me to convert it to vb because we haven't seen pseudo yet it would be great, thx in advance
This looks like HW. I'll help you out, but you need to do some work. I won't write it in VB, but in C++ instead. It is up to you to look for the correct syntax (If you search Google for it, you will find it, e.g.: While loops in VB 6). int iTotalClicks; int iClickRun; int option=1; var is_done = false; while ( is_done == false && iTotalClicks <= 20){ std::cout << "Enter option "; // instead of cout, you will use an event user specified from the main form. std::cin << option; if(option == 1){ //onShowTotal: iClickRun = iClickRun +1; std::out << "ICLickinRun is " << iClickRun; } if(option == 2){ //onShowTotal: iTotalClicks += iClickRun; iClickRun = 0; std::out << "iTotalClicks is " << iTotalClicks ; std::out << "ICLickinRun is " << iClickRun; } if(option == 3){ //exit is_done = true; } } Code (markup): Peace,