home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 December
/
Chip_2003-12_cd2.bin
/
oo
/
download
/
f_0019
/
sbasic.jar
/
text
/
sbasic
/
common
/
03050200.xml
< prev
next >
Wrap
Extensible Markup Language
|
2003-01-16
|
2KB
|
40 lines
<?xml version="1.0" encoding="utf-8"?>
<html><head><title>Funkce Err [Runtime]</title><meta name="filename" content="text/sbasic/common/03050200"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
p.P1{
}
p.P2{
}
span.T1{
font-weight:bold;}
</style></head><body>
<help:to-be-embedded Eid="err" xmlns:help="http://openoffice.org/2000/help">
<p class="Head1"><help:link Id="66624">Funkce Err [Runtime]</help:link></p>
<p class="Paragraph">Vrátí kód označující chybu, k níž došlo v průběhu programu.</p>
</help:to-be-embedded>
<p class="Paragraph"><span class="T1">Syntaxe</span>:</p>
<p class="Paragraph">Err <help:key-word value="Err" tag="kw66624_1" xmlns:help="http://openoffice.org/2000/help"/></p>
<p class="Paragraph"><span class="T1">Vrácená hodnota</span>:</p>
<p class="Paragraph">Typu Integer</p>
<p class="Paragraph"><span class="T1">Parametr</span>:</p>
<p class="Paragraph">Funkcí Err se v rutinách pro zpracování chyb zjišťuje typ chyby a určuje způsob jejího odstranění.</p>
<p class="P2">Příklad:</p>
<p class="PropText">sub ExampleError</p>
<p class="PropText">on error goto ErrorHandler <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>REM Set up error handler</p>
<p class="PropText">Dim iVar as Integer</p>
<p class="PropText">Dim sVar As String</p>
<p class="PropText">REM Error occurs due to non-existent file</p>
<p class="PropText">iVar = Freefile</p>
<p class="PropText">Open "\file9879.txt" for Input as #iVar</p>
<p class="PropText">Line Input #iVar, sVar</p>
<p class="PropText">Close #iVar</p>
<p class="PropText">exit sub</p>
<p class="PropText">ErrorHandler:</p>
<p class="PropText">MsgBox "Error " & Err & ": " & Error$ + chr(13) + "At line : " + Erl + chr(13) + Now , 16 ,"an error occurred"</p>
<p class="PropText">end sub</p>
<p class="PropText"/>
<p class="PropText"/>
</body></html>