mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 11:53:42 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			567 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			567 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| { Old file: tbs0291.pp }
 | |
| { @procvar in tp mode bugss                             OK 0.99.13 (PFV) }
 | |
| 
 | |
| {$ifdef fpc}{$mode tp}{$endif}
 | |
| {$F+}
 | |
| 
 | |
| function ReturnString: string;
 | |
| begin
 | |
|   ReturnString := 'A string';
 | |
| end;
 | |
| 
 | |
| procedure AcceptString(S: string);
 | |
| begin
 | |
|   WriteLn('Got: ', S);
 | |
|   if S<>'A string' then
 | |
|    begin
 | |
|      writeln('ERROR!');
 | |
|      halt(1);
 | |
|    end;
 | |
| end;
 | |
| 
 | |
| type
 | |
|   TStringFunc = function: string;
 | |
| 
 | |
| const
 | |
|   SF: TStringFunc = ReturnString;
 | |
| var
 | |
|   S2: TStringFunc;
 | |
| begin
 | |
|   @S2:=@ReturnString;
 | |
|   AcceptString(ReturnString);
 | |
|   AcceptString(SF);
 | |
|   AcceptString(S2);
 | |
| end.
 | 
