(no subject)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(no subject)

difusco_francesco@tiscali.it
Why this simple program down't work

FUNCTION NumBinario(binario AS String) AS Boolean
DIM numbin AS Boolean
DIM i AS Integer
DIM n AS Integer
DIM cifra AS String
numbin = TRUE
n = Len(binario)
FORMMAIN.TextBox1.TEXT = n
i = 1
DO WHILE (i <= n AND numbin = TRUE)
cifra = Mid$(binario, i, 1)
IF (cifra <> "0" OR cifra <> "1") THEN
numbin = FALSE
ELSE
i = i + 1
ENDIF
LOOP
RETURN numbin
END

I have a string and I want to check if every character if a binary
digit, "0" or "1"

Thanks

Francesco
--
Teaching OnLine
Corsi online di programmazione
Php, Asp, C, C++, Visual Basic, Delphi
Linux Shell Programming
------------------------------------
http://www.teachingonline.it



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...