to : ilmore(寒风) 没有么? 看看delphi的帮助把 帮助主题goto statements,A goto statement, which has the formgoto labeltransfers program execution to the statement ed by the specified label. To a statement, you must first declare the label. Then precede the statement you want to with the label and a colon:label: statementDeclare labels like this:label label;You can declare several labels at once:label label1, ..., labeln;A label can be any valid identifier or any numeral between 0 and 9999. The label declaration, ed statement, and goto statement must belong to the same block. (See Blocks and scope.) Hence it is not possible to jump into or out of a procedure or function. Do not more than one statement in a block with the same label. For example,label StartHere;... StartHere: Beep; goto StartHere;creates an infinite loop that calls the Beep procedure repeatedly. The goto statement is generally discouraged in structured programming. It is, however, sometimes used as a way of exiting from nested loops, as in the following example.procedure FindFirstAnswer;var X, Y, Z, Count: Integer; label FoundAnAnswer; begin Count := SomeConstant; for X := 1 to Count do for Y := 1 to Count do for Z := 1 to Count do if ... { some condition holds on X, Y, and Z } then goto FoundAnAnswer;
... {code to execute if no answer is found } Exit;
FoundAnAnswer: ... { code to execute when an answer is found }end;Notice that we are using goto to jump out of a nested loop. Never jump into a loop or other structured statement, since this can have unpredictable effects.
PASCAL语言属于面向过程的语言,也能支持面向对象.
我的理解.
我的理解算法语言不是一个实际的语言
仅是用来交流的。
pascal是结构的但也支持非结构语句如goto
pascal 有goto 语句吗??????
Borland自己认为,BP7是学习OO编程的最理想的语言.
这是Boeland一年前的网站的首页上的所标称的一种看法.
不要混为一谈!
看看delphi的帮助把
帮助主题goto statements,A goto statement, which has the formgoto labeltransfers program execution to the statement ed by the specified label. To a statement, you must first declare the label. Then precede the statement you want to with the label and a colon:label: statementDeclare labels like this:label label;You can declare several labels at once:label label1, ..., labeln;A label can be any valid identifier or any numeral between 0 and 9999.
The label declaration, ed statement, and goto statement must belong to the same block. (See Blocks and scope.) Hence it is not possible to jump into or out of a procedure or function. Do not more than one statement in a block with the same label.
For example,label StartHere;...
StartHere: Beep;
goto StartHere;creates an infinite loop that calls the Beep procedure repeatedly.
The goto statement is generally discouraged in structured programming. It is, however, sometimes used as a way of exiting from nested loops, as in the following example.procedure FindFirstAnswer;var X, Y, Z, Count: Integer;
label FoundAnAnswer;
begin
Count := SomeConstant;
for X := 1 to Count do
for Y := 1 to Count do
for Z := 1 to Count do
if ... { some condition holds on X, Y, and Z } then
goto FoundAnAnswer;
... {code to execute if no answer is found }
Exit;
FoundAnAnswer:
... { code to execute when an answer is found }end;Notice that we are using goto to jump out of a nested loop. Never jump into a loop or other structured statement, since this can have unpredictable effects.