# need visual logic help



## wjulaxer13 (Jul 18, 2013)

I want to check the input that is entered from the console to see if it is numeric or alphabetic. I havent been able to determine how to do it yet. An example would be : If field1 = numeric. or If field2 is not numeric. Anyone have any ideas? John


----------



## Fjandr (Sep 26, 2012)

What language are you using? If it's a typed language, just check for the variable type. If not, it's a bit more complex usually.


----------



## beefers1 (Aug 23, 2007)

Fjandr said:


> What language are you using? If it's a typed language, just check for the variable type. If not, it's a bit more complex usually.


Aren't stdin inputs always strings, and wouldn't regular expressions do the trick?


----------



## wjulaxer13 (Jul 18, 2013)

I mean to try something like this: Input Field1 Field1 numeric (or some way to tell what has been entered is numeric) I tried this (and other ways) while trying to find the largest number in a series of numbers that were being entered from the terminal. I wanted to set a non-numeric up to stop the input loop but unless you entered exactly what I used ( "Done" vs "done") it wouldn't stop and stored the non-numeric in the array. I would like to find a way to bypass all non-numeric input while processing all numeric input. Just haven't figured out how.


----------



## beefers1 (Aug 23, 2007)

wjulaxer13 said:


> I would like to find a way to bypass all non-numeric input while processing all numeric input.


You could do something like this:

- Initialize an empty string
- Loop through your input string, and if the character is a number, add it to the other string.


----------



## Fjandr (Sep 26, 2012)

Again, what language are you using?


----------



## AlbertMC2 (Jul 15, 2010)

Fjandr said:


> Again, what language are you using?


The OP is using Visual Logic.
Visual Logic

Schools use it to to teach students programming logic and loops.
All variables are "declared" as variant.


----------



## beefers1 (Aug 23, 2007)

Oh, whoops. Never heard of it before, sorry.


----------



## Fjandr (Sep 26, 2012)

Heh, I apparently didn't process the thread title until now. Thanks. :smile:


----------

