Re: VFP 9, Macro substitution and Error 1231
- From: "jndb72" <jndb72@xxxxxxxxxxxxx>
- Date: 16 Jun 2005 08:31:00 -0700
Chip Orange wrote:
> It looks to me like you're counting on the semi colon to work in the middle
> of a string, which is not supposed to work AFAIK; you need to terminate the
> string with a quote and use the plus operator before using the semi colon to
> continue on the next line. I'm sure that works, and I bet it fixes your VFP
> 9 issue.
> line so:
>
> strX = "abc" + ;
> "def"
>
>
> Chip
>
>
Hi Chip,
Sorry, the actual code is only on one line. I (mistakenly) put the ; on
here for readability.
jndb72
> "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
- Re: VFP 9, Macro substitution and Error 1231
- From: Chip Orange
- VFP 9, Macro substitution and Error 1231
- Prev by Date: Re: VFP 9, Macro substitution and Error 1231
- Next by Date: RE: Get file from URL
- 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
|