20.10.2015, 11:48
Yeah, or something like this:
[ab3]INCLUDE "Unit1.ab3"
Function TestDoSomethingOK{}
in$ = "foo"
result$ = DoSomething{in$}
NPrint result$
ret = 0
If result$ = "foobar"
ret = 1
EndIf
Function Return ret
End Statement
Function TestDoSomethingFail{}
in$ = "foo"
result$ = DoSomething{in$}
NPrint result$
ret = 0
If result$ = "foobuzz"
ret = 1
EndIf
Function Return ret
End Statement
If TestDoSomethingOK{} = 0
NPrint "ERROR in DoSomething"
EndIf
If TestDoSomethingFail{} = 0
NPrint "ERROR in DoSomething, wrong result!"
EndIf[/ab3]
Is there a function for exiting from program, like Exit()?
That could be used if a test fails, instead of checking a return val.
Manfred
[ab3]INCLUDE "Unit1.ab3"
Function TestDoSomethingOK{}
in$ = "foo"
result$ = DoSomething{in$}
NPrint result$
ret = 0
If result$ = "foobar"
ret = 1
EndIf
Function Return ret
End Statement
Function TestDoSomethingFail{}
in$ = "foo"
result$ = DoSomething{in$}
NPrint result$
ret = 0
If result$ = "foobuzz"
ret = 1
EndIf
Function Return ret
End Statement
If TestDoSomethingOK{} = 0
NPrint "ERROR in DoSomething"
EndIf
If TestDoSomethingFail{} = 0
NPrint "ERROR in DoSomething, wrong result!"
EndIf[/ab3]
Is there a function for exiting from program, like Exit()?
That could be used if a test fails, instead of checking a return val.
Manfred