Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WriteExpression without the =
Message
De
03/11/2007 11:23:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01266346
Message ID:
01266398
Vues:
12
>Is there a way to have the WriteExpression not add the equal sign (=)? The following strips out the controlsource info set by the VFP builder when I drag&drop columns from VFP tables. I remove the alias and store the column name to the cControlSource property. This works but it adds the = in front of the column name which I don't want. Any ideas?
>
>
>LOCAL aControl[1]
>IF ASELOBJ(aControl) = 0
>  IF ASELOBJ(aControl, 1) = 0
>    RETURN
>  ENDIF
>ENDIF
>
>FOR EACH loControl IN aControl[1].CONTROLS
>  IF PEMSTATUS(loControl,'ControlSource',5)
>    lnStart = AT('.',loControl.CONTROLSOURCE)+1
>    lcSource = SUBSTR(loControl.CONTROLSOURCE,lnStart)
>    loControl.WRITEEXPRESSION('cControlSource',lcSource)
>    loControl.RESETTODEFAULT('ControlSource')
>  ENDIF
>ENDFOR
>
If you use writeexpression() then it writes an 'expression' < g >.If you want a constant as you do then:

loControl.cControlSource = m.lcSource

PS: IMHO dropping the alias is not a good idea.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform