jerem488 Posted April 19, 2008 Share Posted April 19, 2008 I know... in my opinion, this is a very small error but ... so my problem is : $nb = InputBox ("Bon alors.... QUESTION", "Combien veux-tu de LIGNES de ce symbole ==>> '" & $symb & "' ???" & _ @CRLF & @CRLF & "Rep ! !, enfin marque ds la petite celule juste en dessous !","","",320,160 ) If @error = "1" Then Exit EndIf If $nb[0] <> "0" Or $nb[1] <> "1" Or $nb[2] <> "2" Or $nb[3] <> "3" Or $nb[4] <> "4" Or $nb[5] <> "5" Or _ $nb[6] <> "6" Or $nb[7] <> "7" Or $nb[8] <> "8" Or $nb[9] <> "9" Then MsgBox(48,"Entrée invalide...", "Tu dois saisir un NOMBRE (chiffres de '0' à '9') et non pas des caractères !") Exit EndIf and in fact i have this error message ==>> ==> Variable used without being declared.: If $nb[0] <> "0" Or $nb[1] <> "1" Or $nb[2] <> "2" Or $nb[3] <> "3" Or $nb[4] <> "4" Or $nb[5] <> "5" Or $nb[6] <> "6" Or $nb[7] <> "7" Or $nb[8] <> "8" Or $nb[9] <> "9" Then If ^ ERROR I have tryed like this : If $nb <> "0" Or $nb <> "1" Or $nb <> "2" Or $nb <> "3" Or $nb <> "4" Or $nb <> "5" Or _ $nb <> "6" Or $nb <> "7" Or $nb <> "8" Or $nb <> "9" Then MsgBox(48,"Entrée invalide...", "Tu dois saisir un NOMBRE (chiffres de '0' à '9') et non pas des caractères !") Exit EndIf But, it was the same problem, with the same error message. Qui ose gagneWho Dares Win[left]CyberExploit[/left] Link to comment Share on other sites More sharing options...
MHz Posted April 19, 2008 Share Posted April 19, 2008 (edited) It looks to me that you are checking for an invalid value that you specify. Consider using And instead of Or for a logical reason. Or will be true for almost any value that you give it with your previous usage. Global $symb $nb = InputBox("Bon alors.... QUESTION", "Combien veux-tu de LIGNES de ce symbole ==>> '" & $symb & "' ???" & _ @CRLF & @CRLF & "Rep ! !, enfin marque ds la petite celule juste en dessous !","","",320,160 ) If @error = 1 Then Exit EndIf If $nb <> "0" And $nb <> "1" And $nb <> "2" And $nb <> "3" And $nb <> "4" _ And $nb <> "5" And $nb <> "6" And $nb <> "7" And $nb <> "8" And $nb <> "9" Then MsgBox(48,"Entrée invalide...", "Tu dois saisir un NOMBRE (chiffres de '0' à '9') et non pas des caractères !") Exit EndIf Edit: Changed a word for better meaning Edited April 19, 2008 by MHz Link to comment Share on other sites More sharing options...
mod147 Posted April 19, 2008 Share Posted April 19, 2008 I know... in my opinion, this is a very small error but ... so my problem is : $nb = InputBox ("Bon alors.... QUESTION", "Combien veux-tu de LIGNES de ce symbole ==>> '" & $symb & "' ???" & _ @CRLF & @CRLF & "Rep ! !, enfin marque ds la petite celule juste en dessous !","","",320,160 ) If @error = "1" Then Exit EndIf If $nb[0] <> "0" Or $nb[1] <> "1" Or $nb[2] <> "2" Or $nb[3] <> "3" Or $nb[4] <> "4" Or $nb[5] <> "5" Or _ $nb[6] <> "6" Or $nb[7] <> "7" Or $nb[8] <> "8" Or $nb[9] <> "9" Then MsgBox(48,"Entrée invalide...", "Tu dois saisir un NOMBRE (chiffres de '0' à '9') et non pas des caractères !") Exit EndIf and in fact i have this error message ==>> ==> Variable used without being declared.: If $nb[0] <> "0" Or $nb[1] <> "1" Or $nb[2] <> "2" Or $nb[3] <> "3" Or $nb[4] <> "4" Or $nb[5] <> "5" Or $nb[6] <> "6" Or $nb[7] <> "7" Or $nb[8] <> "8" Or $nb[9] <> "9" Then If ^ ERROR I have tryed like this : If $nb <> "0" Or $nb <> "1" Or $nb <> "2" Or $nb <> "3" Or $nb <> "4" Or $nb <> "5" Or _ $nb <> "6" Or $nb <> "7" Or $nb <> "8" Or $nb <> "9" Then MsgBox(48,"Entrée invalide...", "Tu dois saisir un NOMBRE (chiffres de '0' à '9') et non pas des caractères !") Exit EndIf But, it was the same problem, with the same error message. try this Global $symb $nb = InputBox("Bon alors.... QUESTION", "Combien veux-tu de LIGNES de ce symbole ==>> '" & $symb & "' ???" & _ @CRLF & @CRLF & "Rep ! !, enfin marque ds la petite celule juste en dessous !","","",320,160 ) If @error = 1 Then Exit EndIf If not StringRegExp ($nb ,"(\d)") Then MsgBox(48,"Entrée invalide...", "Tu dois saisir un NOMBRE (chiffres de '0' a '9') et non pas des caracteres !") Exit EndIf Link to comment Share on other sites More sharing options...
jerem488 Posted April 19, 2008 Author Share Posted April 19, 2008 Thank you Very much. I have some difficulties with the "stringregexp" command. But I will analyze this this command. @+ Qui ose gagneWho Dares Win[left]CyberExploit[/left] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now