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

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>P┼Ö├¡kaz GoSub...Return [Runtime]</title><meta name="filename" content="text/sbasic/common/03090301"/><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.         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="gosubreturn" xmlns:help="http://openoffice.org/2000/help">
  36.   <p class="Head1"><help:link Id="66539">P┼Ö├¡kaz GoSub...Return [Runtime]</help:link></p>
  37.   <p class="Paragraph">V procedu┼Öe nebo funkci vol├í podprogram, kter├╜ je ozna─ìen n├ív─¢┼ít├¡m. P┼Ö├¡kazy za n├ív─¢┼ít├¡m budou provedeny a┼╛ po n├ísleduj├¡c├¡ p┼Ö├¡kaz Return. Potom bude program pokra─ìovat p┼Ö├¡kazem, kter├╜ n├ísleduje za p┼Ö├¡kazem GoSub<text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>.</p>
  38.   </help:to-be-embedded>
  39.   <p class="Paragraph"><span class="T1">Syntaxe</span>:</p>
  40.   <p class="Paragraph">viz Parametr</p>
  41.   <p class="Paragraph"><span class="T1">Parametr</span>:</p>
  42.   <p class="Paragraph">Sub/Function</p>
  43.   <p class="Paragraph">blok_p┼Ö├¡kaz┼»</p>
  44.   <p class="Paragraph"><help:key-word value="GoSub" tag="kw66539_1" xmlns:help="http://openoffice.org/2000/help"/>GoSub N├ív─¢┼ít├¡</p>
  45.   <p class="Paragraph">blok_p┼Ö├¡kaz┼»</p>
  46.   <p class="Paragraph">GoSub N├ív─¢┼ít├¡</p>
  47.   <p class="Paragraph">Exit Sub/Function</p>
  48.   <p class="Paragraph">N├íve┼ít├¡:</p>
  49.   <p class="Paragraph">blok_p┼Ö├¡kaz┼»</p>
  50.   <p class="Paragraph">Return</p>
  51.   <p class="Paragraph">End Sub/Function</p>
  52.   <p class="Paragraph">P┼Ö├¡kaz GoSub se pou┼╛├¡v├í k vol├ín├¡ m├¡stn├¡ho podprogramu, kter├╜ je ozna─ìen n├ív─¢┼ít├¡m ozna─ìuj├¡c├¡m prvn├¡ ┼Ö├ídek podprogramu, z procedury nebo z funkce. N├ízev n├ív─¢┼ít├¡ mus├¡ b├╜t ukon─ìen dvojte─ìkou (:). Po dosa┼╛en├¡ p┼Ö├¡kazu GoSub pokra─ìuje program p┼Ö├¡kazem, kter├╜ n├ísleduje za n├ív─¢┼ít├¡m. Budou provedeny n├ísleduj├¡c├¡ p┼Ö├¡kazy a funkce a┼╛ do n├ísleduj├¡c├¡ho p┼Ö├¡kazu Return. Program potom p┼Öejde zp─¢t k p┼Ö├¡kazu GoSub a pokra─ìuje p┼Ö├¡kazem, kter├╜ n├ísleduje za p┼Ö├¡kazem GoSub.</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">Pokud program naraz├¡ na p┼Ö├¡kaz Return, p┼Öed kter├╜m nen├¡ p┼Ö├¡kaz GoSub, aplikace <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic zobraz├¡ chybovou zpr├ívu. Pomoc├¡ p┼Ö├¡kaz┼» <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>Exit Sub nebo Exit Function lze zajistit, aby program opustil proceduru nebo funkci p┼Öed dosa┼╛en├¡m n├ísleduj├¡c├¡ho p┼Ö├¡kazu Return.</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">P┼Ö├¡kazy GoSub a Return jsou poz┼»statky star├╜ch dialekt┼» jazyka BASIC a jsou zachov├íny pouze z d┼»vodu kompatibility. Pokud ─ìasto pou┼╛├¡v├íte p┼Ö├¡kazy GoSub a Return, budou programy ┼ípatn─¢ ─ìiteln├⌐. Doporu─ìuje se pou┼╛├¡vat sp├¡┼íe p┼Ö├¡kazy Sub a Function.</p>
  63.      </span></th></tr></table>
  64.   <p class="Paragraph"/>
  65.   <p class="Paragraph">N├ísleduj├¡c├¡ p┼Ö├¡klad ukazuje pou┼╛it├¡ p┼Ö├¡kaz┼» GoSub a Return. Dvojit├╜m proveden├¡m ├║seku programu je vypo─ìtena druh├í mocnina dvou ─ì├¡sel, kter├í zadal u┼╛ivatel.</p>
  66.   <p class="P2">P┼Ö├¡klad:</p>
  67.   <p class="PropText">Sub ExampleGoSub</p>
  68.   <p class="PropText">dim iInputa as Single</p>
  69.   <p class="PropText">dim iInputb as Single</p>
  70.   <p class="PropText">dim iInputc as Single</p>
  71.   <p class="PropText">iInputa = Int(InputBox$ "Enter the first number: ","NumberInput"))</p>
  72.   <p class="PropText">iInputb = Int(InputBox$ "Enter the second number: ","NumberInput"))</p>
  73.   <p class="PropText">iInputc=iInputa</p>
  74.   <p class="PropText">GoSub SquareRoot</p>
  75.   <p class="PropText">Print "The square root of";iInputa;" is";iInputc</p>
  76.   <p class="PropText">iInputc=iInputb</p>
  77.   <p class="PropText">GoSub SquareRoot</p>
  78.   <p class="PropText">Print "The square root of";iInputb;" is";iInputc</p>
  79.   <p class="PropText">Exit Sub</p>
  80.   <p class="PropText">SquareRoot:</p>
  81.   <p class="PropText">iInputc=sqr(iInputc)</p>
  82.   <p class="PropText">Return</p>
  83.   <p class="PropText">End Sub</p>
  84.  </body></html>
  85.