IBM Lotus Symphony
|
Quitte une instruction Do...Loop, une instruction For...Next, une fonction ou une sous-routine.
voir Paramètres
Exit Do
Applicable uniquement à l'intérieur d'une instruction Do...Loop afin de quitter la boucle. L'exécution du programme se poursuit par l'instruction figurant juste après l'instruction Loop. Si des instructions Do...Loop sont imbriquées, le contrôle est transféré à la boucle du prochain niveau supérieur.
Exit For
Applicable uniquement à l'intérieur d'une boucle For...Next pour quitter cette boucle. L'exécution du programme se poursuit par la première instruction figurant après l'instruction Next. Dans des instructions imbriquées, le contrôle est transféré à la boucle du prochain niveau supérieur.
Exit Function
Quitte immédiatement la procédure Function. L'exécution du programme se poursuit par l'instruction figurant après l'appel de Function.
Exit Sub
Quitte immédiatement la sous-routine. L'exécution du programme se poursuit par l'instruction figurant après l'appel de Sub.
![]() |
L'instruction Exit ne définit pas la fin d'une structure et ne doit pas être confondue avec l'instruction End. |
Sub ExampleExit
Dim sReturn As String
Dim sListArray(10) as String
Dim siStep as Single
For siStep = 0 to 10 REM Remplir la matrice avec des données de test
sListArray(siStep) = chr(siStep + 65)
msgbox sListArray(siStep)
next siStep
sReturn = LinSearch(sListArray(), "B")
Print sReturn
end sub
Function LinSearch( sList(), sItem As String ) as integer
dim iCount as Integer
REM LinSearch recherche une une TextEntry dans TextArray:sList() :
REM Renvoie l'index de l'entrée ou 0 (Null)
for iCount=1 to Ubound( sList() )
if sList( iCount ) = sItem then
Exit for REM sItem found
end if
next iCount
if iCount = Ubound( sList() ) then iCount = 0
LinSearch = iCount
end function