Re: VFP 9, Macro substitution and Error 1231

Tech-Archive recommends: Speed Up your PC by fixing your registry



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
> >

.



Relevant Pages

  • Re: VFP 9, Macro substitution and Error 1231
    ... put the basic unchangeable portion of the command into the ... > Chip Orange wrote: ... >> string with a quote and use the plus operator before using the semi colon ... >>> allow for diffrent requerying scenarios, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: isnumber
    ... Function IsNumber(ByVal Value As String) As Boolean ... ' Get local setting for decimal point ... "Chip Pearson" wrote in message ...
    (microsoft.public.excel.programming)
  • Re: resorting columns
    ... something that says find IMP, record that location, find next IMP ... VBA's I/O routines, put the data in one large string, then use Split ... to break the data apart by some delimiter, ... Chip Pearson ...
    (microsoft.public.excel.programming)
  • Re: Select Case Failing on Array Variable
    ... Chip one last question. ... I am getting an error stmt on the second one. ... Dim a as String ...
    (microsoft.public.excel.programming)
  • Re: Chip from saddle on D28 Marquis?
    ... the string bends up from the pin. ... the chip came out. ... It seems to me this saddle is glued in. ... window and don't want to settle for a hack job should I keep the guitar. ...
    (rec.music.makers.guitar.acoustic)