Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange error
Message
 
À
25/12/2009 15:36:10
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01440623
Message ID:
01440655
Vues:
30
Thank Dragan !

You helped me !

&m.lcSql is bad but &lcSql is Good !
 *-- Cf UT 25/12/2009
  SET SAFETY OFF
  *!*	lcSql = CHRTRAN( This.csql, 0h0d0a, SPACE(2) )
  m.lcSql = THIS.csql
  *-- Pour garder le requête Sql sur disque et pouvoir la dégoguer.
  STRTOFILE( m.lcSql , 'Temp.txt' )
  SET SAFETY ON
  *-- Bug &m.lcSql NE FOCNTIONNE PAS et donne une erreur 16 !
  &lcSql
>>OK naomi !
>>
>>Thank...
>>
>>but ....:-)
>>
>>IN Fact the problem become from a another code
>>I try to build per programmation a complex sql command
>>
>>TEXT To oSql.cSql NOSHOW TEXTMERGE PRETEXT 15
>> << m.cSql1 >>
>> << m.cInner1 >>
>> << oSql.ccondit1 >>
>> << m.cSql2 >>
>> << m.cInner2 >>
>> << oSql.ccondit2 >>
>>  ORDER BY 3 , 1, 4 , 2 INTO CURSOR CrystalNew READWRITE
>> ENDTEXT
>>
>>
>>&oSql.cSql
>
>The syntax
>
&oSql.cSql
>will probably never work, because you forgot that while the ampersnad starts the macro expansion, dot terminates it. So your macro tried to expand oSql (the part of the command which was between & and .) as a string, then append "cSql" to that string, then evaluate it as a command. Which won't work, because oSql is an object, not a string.
>
>Generally, macro compiles whatever is between & and the next terminating character - a space or whatever; if you need the macro to be a part of the word, you need to supply your own delimiter, which is a dot:
>
>
var1="something"
>x="var"
>? &x.1
>
>You simply can't execute a macro which is stored in an object's property without storing it into a variable. Even if you find a trick to do it, very few could read it. Simply...
>
>
lcSql=chrtran(oSql.csql, 0h0d0a, space(2))
>&lcSQL
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform