Re: VFP 9, Macro substitution and Error 1231
- From: "Robert Hoogstraat" <roberth.nospam@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 16 Jun 2005 12:09:00 -0400
<start of code snippet>
LOCAL lcWhere, lcCreate
lcWhere = " &lcCriteria "
&& String used to create the view by macro substitution
lcCreate = " CREATE VIEW ByLocation AS SELECT * FROM Location WHERE " ;
+ "DELETED() = .F. AND (" + lcWhere + ")"
&& Create the view - this works fine in version 8 but generates a
&&Missing Operand error in version 9
&lcCreate
<end of code snippet>
VFP is correct in raising a 'missing operand' error as lcCriteria is
undefined at this point.
--
Robert Hoogstraat
"jndb72" <jndb72@xxxxxxxxxxxxx> wrote in message
news:1118930122.975188.94060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi All,
>
> We recently upgraded from version 8 to version 9 and have come across
> an issue with macro substitution. A lot of our views are created to
> allow for diffrent requerying scenarios, based on diffrent fields
> within the view. Below is an example that works fine in v8 but crashes
> with a Missing Operand error in v9.
>
> CREATE DATABASE Test
> CREATE TABLE Location (cCountry C(12), cGroup C(3))
>
> INSERT INTO Location VALUES ("GB ", "A01")
> INSERT INTO Location VALUES ("USA", "A01")
> INSERT INTO Location VALUES ("FRA", "A02")
> INSERT INTO Location VALUES ("AUS", "A02")
> INSERT INTO Location VALUES ("ITA", "A02")
>
> LOCAL lcWhere, lcCreate
>
> lcWhere = " &lcCriteria "
>
> && String used to create the view by macro substitution
> lcCreate = " CREATE VIEW ByLocation AS SELECT * FROM Location WHERE ;
> DELETED() = .F. AND (" + lcWhere + ")"
>
> && Create the view - this works fine in version 8 but generates a
> &&Missing Operand error in version 9
>
> &lcCreate
>
> && This all works fine in v8
>
> USE ByLocation NODATA
>
> && Requery the view
> lcCriteria = " cCountry = 'GB ' "
> REQUERY("ByLocation") &&Returns 1 record in v8
>
>
> lcCriteria = " cGroup = 'A02' "
> REQUERY("ByLocation") &&Returns 3 record in v8
>
>
> I've read through the "whats new in 9" section but haven't yet come
> across anything that would explainn this issue.
>
> Anyone have any thoughts?
>
> jndb72
>
.
- Follow-Ups:
- Re: VFP 9, Macro substitution and Error 1231
- From: Chip Orange
- Re: VFP 9, Macro substitution and Error 1231
- References:
- VFP 9, Macro substitution and Error 1231
- From: jndb72
- VFP 9, Macro substitution and Error 1231
- Prev by Date: RE: Get file from URL
- Next by Date: Re: database - table references (VFP9)
- Previous by thread: Re: VFP 9, Macro substitution and Error 1231
- Next by thread: Re: VFP 9, Macro substitution and Error 1231
- Index(es):
Relevant Pages
|