home *** CD-ROM | disk | FTP | other *** search
/ com!online 2002 April / comcd0402.iso / vollver / office60 / f_0021 / sbasic.jar / text / sbasic / common / 03090302.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  5.6 KB  |  84 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>GoTo-Anweisung [Runtime]</title><meta name="filename" content="text/sbasic/common/03090302"/><meta name="language" content="de-DE"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         table.Tabelle1{
  5.                 }
  6.         span.Tabelle1A{
  7.                 width:1.499cm;}
  8.         span.Tabelle1B{
  9.                 width:16.498cm;}
  10.         tr.Tabelle11{
  11.                 }
  12.         td.Tabelle1A1{
  13.                 }
  14.         table.Tabelle2{
  15.                 }
  16.         span.Tabelle2A{
  17.                 width:1.499cm;}
  18.         span.Tabelle2B{
  19.                 width:16.498cm;}
  20.         tr.Tabelle21{
  21.                 }
  22.         td.Tabelle2A1{
  23.                 }
  24.         p.P1{
  25.                 }
  26.         p.P2{
  27.                 }
  28.         span.T1{
  29.                 font-weight:bold;}
  30.         span.fr1{
  31.                 }
  32.         </style></head><body>
  33.   
  34.   
  35.   <help:to-be-embedded Eid="goto" xmlns:help="http://openoffice.org/2000/help"><a name="goto"/>
  36.   <p class="Head1"><help:link Id="66534">GoTo-Anweisung [Runtime]</help:link></p>
  37.   <p class="Paragraph">Sorgt daf├╝r, da├ƒ das Programm innerhalb einer Unterroutine (Sub) oder einer Funktion (Function) mit der Abarbeitung des Programmteils fortf├ñhrt, der durch eine Marke gekennzeichnet ist.</p>
  38.   </help:to-be-embedded>
  39.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  40.   <p class="Paragraph">see Parameter see</p>
  41.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  42.   <p class="Paragraph">Sub/Function</p>
  43.   <p class="Paragraph">Befehlsblock</p>
  44.   <p class="Paragraph"><help:key-word value="GoTo" tag="kw66534_1" xmlns:help="http://openoffice.org/2000/help"/>GoTo Marke1</p>
  45.   <p class="P2">Marke2:</p>
  46.   <p class="Paragraph">Befehlsblock</p>
  47.   <p class="Paragraph">Exit Sub</p>
  48.   <p class="P2">Marke1:</p>
  49.   <p class="Paragraph">Befehlsblock</p>
  50.   <p class="Paragraph">GoTo Marke2</p>
  51.   <p class="Paragraph">End Sub/Function</p>
  52.   <p class="Paragraph">Mit Hilfe der <span class="T1">GoTo</span>-Anweisung weisen Sie <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic an, mit der Programmausf├╝hrung an einem ganz anderen Teil des <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic-Programms innerhalb einer Unterroutine (Sub) oder Funktion (Function) fortzufahren. Die Stelle, an der das Programm mit der Ausf├╝hrung fortfahren soll, ist mit einer Marke gekennzeichnet. Um eine Marke zu setzen, benennen Sie sie beliebig und schlie├ƒen Sie mit einem Doppelpunkt (":") ab.</p>
  53.   <table><tr class="Tabelle11"><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  54.       <p class="TextInTable"><draw:image draw:style-name="fr1" draw:name="HIND_1" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="0" xlink:href="65640" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  55.      </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1B">
  56.       <p class="TextInTable">Bitte beachten Sie, da├ƒ Sie mit der GoTo-Anweisung niemals aus einem Unterprogramm oder einer Funktion hinausspringen d├╝rfen.</p>
  57.      </span></th></tr></table>
  58.   <p class="Paragraph"/>
  59.   <table><tr class="Tabelle21"><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2A">
  60.       <p class="TextInTable"><draw:image draw:style-name="fr1" draw:name="HIND_2" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="1" xlink:href="66732" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  61.      </span></th><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2B">
  62.       <p class="TextInTable">Die <span class="T1">GoTo</span>-Anweisung ist ein Relikt ├ñlterer Basicdialekte, die nur aus Kompatibilit├ñtsgr├╝nden erhalten geblieben sind. Verwenden Sie GoTo sehr h├ñufig, wird Ihr Programm f├╝r Sie, aber auch f├╝r andere Programmierer, schwer lesbar. Versuchen Sie sich daher einen Programmstil anzueignen, der m├╢glichst wenig, am besten gar keinen Gebrauch der <span class="T1">GoTo</span>-Anweisung macht. Einzige Ausnahmen sind <span class="T1">On...GoTo</span> und <span class="T1">On Error GoTo</span> (siehe dort).</p>
  63.      </span></th></tr></table>
  64.   <p class="Paragraph"/>
  65.   <p class="Paragraph">Beispiel:</p>
  66.   <p class="PropText">Sub ExampleOnGosub </p>
  67.   <p class="PropText">Dim iVar As Integer </p>
  68.   <p class="PropText">Dim sVar As String </p>
  69.   <p class="PropText">iVar = 2 </p>
  70.   <p class="PropText">sVar ="" </p>
  71.   <p class="PropText">On iVar GoSub Sub1, Sub2 </p>
  72.   <p class="PropText">On iVar GoTo Line1, Line2 </p>
  73.   <p class="PropText">Exit Sub </p>
  74.   <p class="PropText">Sub1: </p>
  75.   <p class="PropText">sVar =sVar & <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>" Von Sub 1 nach" : Return </p>
  76.   <p class="PropText">Sub2: </p>
  77.   <p class="PropText">sVar =sVar & <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>" Von Sub 2 nach" : Return </p>
  78.   <p class="PropText">Line1: </p>
  79.   <p class="PropText">sVar =sVar & <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>" Marke 1" </p>
  80.   <p class="PropText">Line2: </p>
  81.   <p class="PropText">sVar =sVar & <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>" Marke 2" </p>
  82.   <p class="PropText">Print sVar </p>
  83.   <p class="PropText">End Sub</p>
  84.  </body></html>