Gossamer Forum
Home : Products : DBMan : Customization :

conditional statements (help)

Quote Reply
conditional statements (help)
I am going crazy and if someone can help me that would be wicked. I attached my html.pl file so you can take a look at it if you like. I am still in the beginning stages of learning perl so I am having a hard time.

Basically what i need to input is, if there is nothing entered in a particular record, i don't want the column to be displayed at all when yuo are doing a search.

eg if this record is blank then don't print out row, but if there is something there then print out the row.

as you can see i have records named mon1, mon2, mon3 etc. those are the records i am worried about. If someone can help that would be great. Also i am not sure if i need to modify anything in the .cfg file as well. Not a tonne of perl wizards around.

thanks
michael
Quote Reply
Re: [kaykills] conditional statements (help) In reply to
Lets suppose that the code you want to modify is in sub html_record which currently is mostly done within one big "print qq".

If you want a conditional print qq, then you need to;

1. end the original print qq (in this case use |;)

2. write a conditional print qq such as
Code:
print qq <$font>&nbsp;Mon:&#36; $rec{'MonRate1'}</Font> | if ($rec{'MonRate1'} ne "");

3. restart the original print qq (in this case use print qq|)

Seems simple, until you test it and decide that now the columns don't line up, in which case you need to add something to take the place of the missing data.

Hum? Well that's more html table tags and less Perl.

I also see you have multiple records per row, so it seems you would only eliminate the row when ALL the values are blank?