Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynamicBackColor length limitations and complex conditio
Message
De
26/08/2009 08:12:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
01419452
Message ID:
01420706
Vues:
56
>Hi Cetin
>
>I have update this post a couple of time and maybe I am confused :(
>
>and this adaptation, please try
>
>
Public oForm
>oForm = Createobject('sampleForm')
>oForm.Show()
>
>Define Class sampleForm As Form
>  DataSession = 2
>  Add Object myGrid As Grid With RecordSource='Customer'
>
>  Procedure Load
>    Use (_samples+'data\customer')
>  Endproc
>
>  Procedure Init
>    Local lcValue, DynBC
>    This.myGrid.Tag = "a" + Replicate(".", 1023) + "z"
>    *** this line is modified
>    DynBC = '(IIF(LEN("' + this.mygrid.Tag + '") > 1024 and RIGHT("' + this.mygrid.Tag + '",1)="z", 0xFFFF00, RGB(0,0,0)))'
>
>    This.myGrid.SetAll('DynamicBackColor',m.DynBC)
>
>    Messagebox(This.myGrid.Columns(1).DynamicBackColor)
>    Messagebox(This.myGrid.Tag)
>    Messagebox(Len(This.myGrid.Tag))
>  Endproc
>Enddefine
>
>
Public oForm, cDynBC
>oForm = Createobject('sampleForm')
>oForm.Show()
>
>Define Class sampleForm As Form
>  DataSession = 2
>  Add Object myGrid As Grid With RecordSource='Customer'
>
>  Procedure Load
>    Use (_samples+'data\customer')
>  Endproc
>
>  Procedure Init
>    Local lcValue, DynBC
>    This.myGrid.Tag = "a" + Replicate(".", 254) + "z"
>    DynBC = '(IIF(RIGHT("' + "a" + Replicate(".", 254) + "z" + '",1)="z", RGB(0,0,0), 0xFFFF00))'
>
>    This.myGrid.SetAll('DynamicBackColor',m.DynBC)
>  Endproc
>Enddefine
You are intentionally creating expressions that goes beyond VFP's string literal limit 255. VFP doesn't protect you from intentional errors and if that is in Dynamic*Color expression, rather than showing up error silently doesn't apply the dynamic coloring.

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