home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 December / Chip_2003-12_cd2.bin / oo / download / f_0019 / sbasic.jar / text / sbasic / common / 03090303.xml < prev    next >
Extensible Markup Language  |  2003-01-16  |  4KB  |  63 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>P┼Ö├¡kaz On...GoSub; p┼Ö├¡kaz On...GoTo [Runtime]</title><meta name="filename" content="text/sbasic/common/03090303"/><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">
  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.         p.P1{
  15.                 }
  16.         p.P2{
  17.                 }
  18.         span.T1{
  19.                 font-weight:bold;}
  20.         span.fr1{
  21.                 }
  22.         </style></head><body>
  23.   
  24.   
  25.   <help:to-be-embedded Eid="ongosub" xmlns:help="http://openoffice.org/2000/help">
  26.   <p class="Head1"><help:key-word value="On...GoSub" tag="kw66563_1"/><help:key-word value="On...GoTo" tag="kw66563_2"/><help:link Id="66563">P┼Ö├¡kaz On...GoSub; p┼Ö├¡kaz On...GoTo [Runtime]</help:link></p>
  27.   <p class="Paragraph">P┼Öejde na jeden ze zadan├╜ch ┼Ö├ídk┼» v programov├⌐m k├│du, v z├ívislosti na hodnot─¢ ─ì├¡seln├⌐ho v├╜razu.</p>
  28.   </help:to-be-embedded>
  29.   <p class="Paragraph"><span class="T1">Syntaxe</span>:</p>
  30.   <p class="Paragraph">On N GoSub N├ív─¢┼ít├¡ 1[, N├ív─¢┼ít├¡ 2[, N├ív─¢┼ít├¡ 3[,...]]]</p>
  31.   <p class="Paragraph">On ─î├¡seln├╜_v├╜raz GoTo N├ív─¢┼ít├¡ 1[, N├ív─¢┼ít├¡ 2[, N├ív─¢┼ít├¡ 3[,...]]]</p>
  32.   <p class="Paragraph"><span class="T1">Parametr</span>:</p>
  33.   <p class="Paragraph">─î├¡seln├╜_v├╜raz: Libovoln├╜ ─ì├¡seln├╜ v├╜raz od 0 do 255 ur─ìuj├¡c├¡, na kter├╜ z ┼Ö├ídk┼» program p┼Öejde. Pokud bude ─î├¡seln├╜ v├╜raz rovn├╜ 0, nebude p┼Ö├¡kaz proveden. Pokud bude ─î├¡seln├╜ v├╜raz v─¢t┼í├¡ ne┼╛ 0, program p┼Öejde na p┼Ö├¡slu┼ín├⌐ n├ív─¢┼ít├¡, jeho┼╛ ─ì├¡slo um├¡st─¢n├¡ odpov├¡d├í v├╜razu (1 = Prvn├¡ n├ív─¢┼ít├¡; 2 = Druh├⌐ n├ív─¢┼ít├¡)</p>
  34.   <p class="Paragraph">N├íve┼ít├¡: C├¡lov├╜ ┼Ö├ídek podle struktury p┼Ö├¡kazu <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>GoTo <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>nebo GoSub.</p>
  35.   <table><tr class="Tabelle11"><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  36.       <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="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" 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>
  37.      </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1B">
  38.       <p class="TextInTable">Konvence p┼Ö├¡kaz┼» GoTo a GoSub <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>jsou platn├⌐.</p>
  39.      </span></th></tr></table>
  40.   <p class="Paragraph"/>
  41.   <p class="P2">P┼Ö├¡klad:</p>
  42.   <p class="PropText"/>
  43.   <p class="PropText">Sub ExampleOnGosub</p>
  44.   <p class="PropText">Dim iVar As Integer</p>
  45.   <p class="PropText">Dim sVar As String</p>
  46.   <p class="PropText">iVar = 2</p>
  47.   <p class="PropText">sVar =""</p>
  48.   <p class="PropText">On iVar GoSub Sub1, Sub2</p>
  49.   <p class="PropText">On iVar GoTo Line1, Line2</p>
  50.   <p class="PropText">Exit Sub</p>
  51.   <p class="PropText">Sub1:</p>
  52.   <p class="PropText">sVar =sVar & <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>" From Sub 1 to" : Return</p>
  53.   <p class="PropText">Sub2:</p>
  54.   <p class="PropText">sVar =sVar & <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>" From Sub 2 to" : Return</p>
  55.   <p class="PropText">Line1:</p>
  56.   <p class="PropText">sVar =sVar & <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>" Label 1" : GoTo Ende</p>
  57.   <p class="PropText">Line2:</p>
  58.   <p class="PropText">sVar =sVar & <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>" Label 2"</p>
  59.   <p class="PropText">Ende:</p>
  60.   <p class="PropText">MsgBox sVar,0,"On...Gosub"</p>
  61.   <p class="PropText">End Sub</p>
  62.  </body></html>
  63.