Changeset 213 for branches/interpreter2/USource.pas
- Timestamp:
- Apr 22, 2020, 10:23:31 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/interpreter2/USource.pas
r212 r213 308 308 end; 309 309 310 { TReturn } 311 312 TReturn = class(TCommand) 313 private 314 function GetFieldsCount: Integer; override; 315 public 316 Expression: TExpression; 317 procedure GetValue(Index: Integer; out Value); override; 318 function GetField(Index: Integer): TField; override; 319 procedure SetValue(Index: Integer; var Value); override; 320 constructor Create; 321 destructor Destroy; override; 322 end; 323 310 324 { TIfThenElse } 311 325 … … 437 451 SYes = 'Yes'; 438 452 SNo = 'No'; 453 454 { TReturn } 455 456 function TReturn.GetFieldsCount: Integer; 457 begin 458 Result := 1; 459 end; 460 461 procedure TReturn.GetValue(Index: Integer; out Value); 462 begin 463 if Index = 0 then TExpression(Value) := Expression 464 else inherited; 465 end; 466 467 function TReturn.GetField(Index: Integer): TField; 468 begin 469 if Index = 0 then Result := TField.Create(dtObject, 'Expression') 470 else inherited; 471 end; 472 473 procedure TReturn.SetValue(Index: Integer; var Value); 474 begin 475 if Index = 0 then Expression := TExpression(Value) 476 else inherited; 477 end; 478 479 constructor TReturn.Create; 480 begin 481 Expression := TExpression.Create; 482 end; 483 484 destructor TReturn.Destroy; 485 begin 486 Expression.Free; 487 inherited Destroy; 488 end; 439 489 440 490 { TField }
Note:
See TracChangeset
for help on using the changeset viewer.