Changeset 20 for trunk/IDE/Forms/UMainForm.pas
- Timestamp:
- Nov 9, 2010, 12:21:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/UMainForm.pas
r14 r20 73 73 Project: TProject; 74 74 Compiler: TCompiler; 75 function GetSource(Name: string; Source: TStringList): Boolean;75 function GetSource(Name: string; var SourceCode: string): Boolean; 76 76 end; 77 77 … … 112 112 end; 113 113 114 function TMainForm.GetSource(Name: string; Source: TStringList): Boolean;114 function TMainForm.GetSource(Name: string; var SourceCode: string): Boolean; 115 115 var 116 116 FileName: string; 117 F: TFileStream; 117 118 begin 118 119 FileName := Project.GetDir(True) + Name + '.pas'; 119 if FileExists(FileName) then begin 120 Source.LoadFromFile(FileName); 120 if FileExists(FileName) then 121 try 122 F := TFileStream.Create(FileName, fmOpenRead); 123 SetLength(SourceCode, F.Size); 124 if F.Size > 0 then 125 F.Read(SourceCode[1], F.Size); 121 126 Result := True; 127 finally 128 F.Free; 122 129 end else Result := False; 123 130 end;
Note:
See TracChangeset
for help on using the changeset viewer.