How to Write this Sub-Procedure
I do this procedure at the start of my report:
procedure ReportOnStartReport(Sender: TfrxComponent);
begin
if (Pos('/',<StartDate>) <> 0) then Set('StartDate', StrToDate(<StartDate>))
else Set('StartDate', StrToFloat(<StartDate>));
if (Pos('/',<?EndDate>) <> 0) then Set('?EndDate', StrToDate(<?EndDate>))
else Set('?EndDate', StrToFloat(<?EndDate>)); }
end;
How would I write a separate procedure to do this? I want to send in the variable (StartDate or EndDate) and have this procedure re-set the value. I am not sure how to write the code so that I can just run this:
procedure ReportOnStartReport(Sender: TfrxComponent);
begin
PrepareDate (<StartDate>);
PrepareDate (<EndDate>);
end;
procedure PrepareDate;
begin
//this is what I don???t know how to write
end;
Any help with writting sub-procedures would be helpful. Also, what I would love is to be able to put this sub-function in a shared .pas file.
Thank you!
procedure ReportOnStartReport(Sender: TfrxComponent);
begin
if (Pos('/',<StartDate>) <> 0) then Set('StartDate', StrToDate(<StartDate>))
else Set('StartDate', StrToFloat(<StartDate>));
if (Pos('/',<?EndDate>) <> 0) then Set('?EndDate', StrToDate(<?EndDate>))
else Set('?EndDate', StrToFloat(<?EndDate>)); }
end;
How would I write a separate procedure to do this? I want to send in the variable (StartDate or EndDate) and have this procedure re-set the value. I am not sure how to write the code so that I can just run this:
procedure ReportOnStartReport(Sender: TfrxComponent);
begin
PrepareDate (<StartDate>);
PrepareDate (<EndDate>);
end;
procedure PrepareDate;
begin
//this is what I don???t know how to write
end;
Any help with writting sub-procedures would be helpful. Also, what I would love is to be able to put this sub-function in a shared .pas file.
Thank you!
Comments
i am not sure which product(s) you work with as your post's show up in different forums.
I am not sure of what you are trying to achieve as some of code appears to be internal report code
and yet you are talking about passing in from delphi.