Thanks guys. It' works perfectly now.
>From: Bill Guindon <[email protected]>
>Reply-To: [email protected]
>To: cartel x <[email protected]>
>CC: [email protected]
>Subject: Re: [meu] Coding Question
>Date: Tue, 05 Dec 2000 09:09:20 -0500
>
>The problem is you can't split/nest whiles and ifs.
>
>Here's some pseudocode that should work:
>
>open the DB.
><MvOPEN yada yada yada...>
>
>skip until you find one, or you hit the end of the file.
><MvWHILE EXPR="{(NOT my_db.d.EOF) AND (my_db.d.cover NE 'yes')}">
> <MvSKIP NAME="my_db" ROWS="1">
></MvWHILE>
>
>If you're done skipping, and you haven't hit EOF, then you found one.
><MvIF EXPR="{NOT my_db.d.EOF}">
> html code to show cover
><MvELSE>
> Hmmmm... you forgot to say what you want it to do if NONE of the
>records have a cover. If nothing, then lose the MvELSE
></MvIF>
>
>either way, your job is done now, so close the DB.
><MvCLOSE NAME="my_db">
>
>
>cartel x wrote:
> >
> > Okay, I thought I had everything working perfect but....
> > Anyway this code is suppposed to go through the database, starting from
>the
> > last record enter and check the "cover" field, if the cover field equals
> > "yes" it's supposed to display it. When the latest record added has a
> > "cover" field of "no" the script works perfectly. It'll go to the next
> > record and if that one's field equals "yes" it will display it
>perfectly,
> > but if the latest record entered has a cover field of "yes" then I get
>this
> > error: "html/homepage-text.mv: Line 57: Syntax Error: Unexpected
> > </MvWHILE> "
> > I've have it currently coded it like this:
> >
> > <MvOPEN
> > NAME = "my_db"
> > DATABASE = "features.dbf"
> > INDEXES = "database_yr_features.mvx"
> > TYPE="xbase3">
> > <MvWHILE EXPRESSION = "{my_db.d.eof NE 1}">
> > <MvIF EXPR="{ my_db.d.cover NE 'yes' }">
> >
> > <MvSKIP name="my_db">
> > </MvWHILE>
> >
> > <MvELSE>
> >
> > <table border="0" cellpadding="0"
>cellspacing="0" width="90%">
> > <tr>
> > <td colspan="2"><a
>href="lifestyle/feature-view.mv"><img height="100"
> > width="300" src="../feature-images/&[my_db.d.image9]" border="0"></a>
> > </td>
> > </tr>
> > <tr>
> > <td colspan="2">
> > <div align="left">
> > <font size="1"
>face="Verdana" color="#ffffff"><MvEVALUATE EXPRESSION
> > = "{my_db.d.desc}">
> > </font><a
>href="lifestyle/feature-view.mv"><font size="1"
> > face="Verdana">MORE</font></a></div>
> > </td>
> > </tr>
> >
> > <MvCLOSE name="my_db">
> > </MvIF>
> >
> > But I've also had it coded like this:
> >
> > <MvOPEN
> > NAME = "my_db"
> > DATABASE = "features.dbf"
> > INDEXES = "database_yr_features.mvx"
> > TYPE="xbase3">
> > <MvWHILE EXPRESSION = "{my_db.d.eof NE 1}">
> > <MvIF EXPR="{ my_db.d.cover EQ 'yes' }">
> >
> > <table border="0" cellpadding="0"
>cellspacing="0" width="90%">
> > <tr>
> > <td colspan="2"><a
>href="lifestyle/feature-view.mv"><img height="100"
> > width="300" src="../feature-images/&[my_db.d.image9]" border="0"></a>
> > </td>
> > </tr>
> > <tr>
> > <td colspan="2">
> > <div align="left">
> > <font size="1"
>face="Verdana" color="#ffffff"><MvEVALUATE EXPRESSION
> > = "{my_db.d.desc}">
> > </font><a
>href="lifestyle/feature-view.mv"><font size="1"
> > face="Verdana">MORE</font></a></div>
> > </td>
> > </tr>
> >
> > <MvCLOSE name="my_db">
> >
> > <MvELSE>
> >
> > <MvSKIP name="my_db">
> > </MvWHILE>
> >
> > </MvIF>
> >
> > And I still get the same error, of course in a different line number
>now.
> > What am I doing wrong???
> >
> >
>_________________________________________________ ____________________________________
> > Get more from the Web. FREE MSN Explorer download :
>http://explorer.msn.com
> >