[Gambas-user] (no subject)

Alonzo Flinston francesco.difusco at ...69...
Sat Sep 17 13:06:50 CEST 2005


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





More information about the User mailing list