k, so i have this single line edit box and i want to get data from the user, but i want no alpha data, purely numeric. for some reason, my big long if statement thats supposed to tell if the data is numeric or not - isn't working. idky...its probably a stupid reason, but here's what i'm trying:
it displays every character (saying that no character it has is a number) in a messagebox and then tells me that i only accept numberic data. the data i've tried entering is 212 , thats purely numericCode:for (i = 0; i <= length; i++) { if (dubbuf[i] < 48 && dubbuf[i] != 46 || dubbuf[i] > 57 || dubbuf[i] != 0) { debug[0] = dubbuf[i]; MessageBox(hwnd, debug, "the culprit..", MB_OK); go = 0; } }
is there a better way? what am i doing wrong?help
lol
also, it would be better if i could disallow alpha values while the user is entering data, i'd much rather do it that way then checking after the person pushes a button. can i do this? how pleeeaaasethanks
.



LinkBack URL
About LinkBacks




