For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > October 2005 > How to write a nested if-statement









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to write a nested if-statement
RSummersJr@gmail.com

2005-10-28, 6:56 pm

Hello,

I'm a beginner to Perl, and I'm trying to modify some existing code by
placing an if-statement within another if statement. I get an error
when I try using this code:

LOOP
IF v_last_heading <> cr_option.HEADING THEN
IF v_last_heading <> 'Action Type' THEN
v_opt_return := v_opt_return || '<TR><TH COLSPAN="3"
class="formheader"><div align="left"><font color="red">*</font>' ||
cr_option.HEADING || '</div></TH></TR>';
v_option_count := 0;
END IF;

The error I get is:

Line No. 162 : PLS-00103: Encountered the symbol "LOOP" when expecting
one of the following:

if
(WWV-17050)
Line No. 238 : PLS-00103: Encountered the symbol "end-of-file" when
expecting one of the following:


Any help would be greatly appreciated. Thanks!

Rick

andrmcg

2005-10-28, 6:56 pm

Firstly (IF)hould be in lowercase.
Secondly there is no (END IF) in perl or (THEN)
What is LOOP ?
If it is a label it should be writen as :
LOOP: if(v_last_heading <> cr_option.HEADING)
{
if()
{
...........
}
}

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com