I have written a procedure that fills a RichEdit component depending on the input.
procedure LoadCPData(ResName: String);
begin
ResName := AnsiLowercase(ResName) + '_data';
rs := TResourceStream.Create(hInstance, ResName, RT_RCDATA);
try
rs.Position := 0;
info.reMeta.Lines.LoadFromStream(rs);
finally
rs.Free;
end;
end;
Note: The above procedure is stored in an external .pas
file called Functions.
When I go to call the procedure in my form the RichEdit remains empty. However, if I were to place that code block in the form itself, the RichEdit component fills the data without a problem as expected. Now I could place the above code block in the form itself, but I plan on using the procedure multiple times in a case
statement.
What will I need to include in order for my procedure to work?
Thank you in advanced!