Qbasicnews.com
CHR$ - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html)
+--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html)
+--- Thread: CHR$ (/thread-8882.html)



CHR$ - billy_boy - 02-14-2006

Hello this is part of my program i have used the menu list a couple of time throught the program

IF selection = 1 THEN CALL CONVGBP
IF selection = 2 THEN CALL AUDGBP
IF selection = 3 THEN CALL CADGBP
IF selection = 4 THEN CALL NZDGBP
IF selection = 5 THEN CALL USDGBP
IF selection = 6 THEN CALL EURGBP
IF selection = 7 THEN CALL ENDOFDAY
IF selection >= 8 THEN
ELSEIF selection <= 0 THEN

it all works fine what i would like help on please is on who do i display an error message if user accidently presses a letter key have been advised to use CHR$ but cant make it work


CHR$ - TheDarkJay - 02-14-2006

You could do.

dim selection as string

while selection = ""
selection = INKEY$
wend

IF selection = "1" THEN CALL CONVGBP
IF selection = "2" THEN CALL AUDGBP
IF selection = "3" THEN CALL CADGBP
IF selection = "4" THEN CALL NZDGBP
IF selection = "5" THEN CALL USDGBP
IF selection = "6" THEN CALL EURGBP
IF selection = "7" THEN CALL ENDOFDAY
IF selection >= "8" THEN
ELSEIF selection <= "0" THEN


CHR$ - billy_boy - 02-14-2006

Tghanks will let you know if it works it will take me ages to go throught the prpogram and change all the other menus
Big Grin


CHR$ - billy_boy - 02-15-2006

Thanks a lot it works a treat been going round in circles trying to work it out

Marvellous
Big Grin Big Grin