Simple compare string
Hi -
I am using Delphi and Fastreports 4. I am simply trying to compare the value of a variable in the "BeforePrint" event of a control. The result of the comparison will either show or hide the control.
The problem is, how to use a simple if then statement to check its value ? I am using Pascal scripting language and I have tried using the normal Delphi / Pascal way to contruct the if.. then statement but I just get random non-helpful messages.
here is how I would do it intuitively..
Here <ShowPrices> is a report variable. I have tried enclosing the constant in double-quotes such as "YES", tried defining a variable of type string and doing a similar test for equality and nothing seems to work .
Can anyone shed light on why ? After all, its a valid Pascal language statement. I have also tried different ways of refering to the variable itself (in case the error was a "best guess" error message) but still have no luck.
Any help would be much appreciated.
Thanks.
I am using Delphi and Fastreports 4. I am simply trying to compare the value of a variable in the "BeforePrint" event of a control. The result of the comparison will either show or hide the control.
The problem is, how to use a simple if then statement to check its value ? I am using Pascal scripting language and I have tried using the normal Delphi / Pascal way to contruct the if.. then statement but I just get random non-helpful messages.
here is how I would do it intuitively..
if (<ShowPrices> = 'YES') then Â
  self.Visible  true
else             Â
  self.Visible  false;
Here <ShowPrices> is a report variable. I have tried enclosing the constant in double-quotes such as "YES", tried defining a variable of type string and doing a similar test for equality and nothing seems to work .
Can anyone shed light on why ? After all, its a valid Pascal language statement. I have also tried different ways of refering to the variable itself (in case the error was a "best guess" error message) but still have no luck.
Any help would be much appreciated.
Thanks.
Comments