代码大全
if Status=Error then ErrorType=FileOpenError else ReadFile(InputFile,FileData,Status) if Status= Success then SummarizeFileData( ...
else ErrorType = DataSummaryError / / end if else ErrorTyre = FileReadError / / end if else ErrorType=FileOpenError / / end if i ...
if ( Min.Color<=Color and Color<=Max.Color ) begin { do some thing } end; { else color is invalid } { Screen not written t ...
CharType=Letter; C if(IsLetter(InputChar)) —— CharType=Letter; else if(IsPunctuation(InputChar)) CharType=Punctuation; else if(I ...
CharType:=ControlChar; others=> PUT_LINE("internal Error: Unexpected type of character detected."); end case; 14.2 case case ...
Action:=UserCommand[1]; case Action of 'c': Copy; 'd': DeleteCharacter; 'f': Format; 'h': Help; else PrintErrorMsg('Error: Inval ...
Pascal case Letter of 'a': PrintArchives; 'p': {no action required,but case was considered} ; 'q': PrinrQuarterlyReport; 's': Pr ...
14.2.3 if-then if-then else else if else if else if-then-else if-then-else case case case case C break 14.3 i ...
15.1 15.2 15.3 15.4 15.5 17 13 14 Basic FOR NEXT Fortran DO Pascal while-do for C while for Ada loop 15.1 15-1 ...
15-1 Ada for while loop-with-exit loop n a Basic FOR-NEXT WHILE-WEND DO LOOP C do-while while Fortran Do Pascal for repeat-until ...
repeat-until C while repeat-until repeat-until while while repeat-until while 15.1.2 Loop-with-exit Loop-with-exit Ada Loo-with- ...
and a break statement to emulate a loop with exit loop. */ Score = 0; FOREVER GetNextRating( RatingIncrement ); Rating = Rating ...
loop-with-exit loop with exit C goto goto Start while expression do something * ... Start; do something else * ... loop-with-e ...
while for while 15.2 Controlling The Loop ———— C while eof InputFile && MoreDataAvailable { } eof InPutFile MoreDataAvai ...
FOREVER { ... } Pascal while Pascal goto exit goto exit Pascal Pascal while(True) begin {infinite loop} ... end; Pascal C for i: ...
c : RecCount = 0; for( rewind(InFile); !feof(InFile); fgets(InputRec[RecCount], MAX_CHARS, InFile) ); { RecCount++; } rewind feo ...
while(InputChar!=’\n’); i := i 1 Pascal StringIdx:=1; TtlLength:=0; while not eof(InputFile) do begin {do the work of the loop} ...
begin { some Code } ... if(...) then i = 101 {more code} ... end; 101 i 1 100 for while C for ( i=0; i<MaxRecords; i++ ) { if ...
} } return(Found); Ada for Pascal SafetyCounter := 0; repeat Node := NodeˆNext; ... safetyCounter := SafetyCOunter+1; if(SafetyC ...
if break break break break break break 16.1 goto goto goto goto continue continue continue continue while(not eof(File)) do read ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf