Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynamicBackColor with using self-defined function Lock Grid!
Message
De
23/08/1999 02:49:43
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
DynamicBackColor with using self-defined function Lock Grid!
Divers
Thread ID:
00256465
Message ID:
00256465
Vues:
59
In my shipping project, I need to make a schedule by grid to show what has done!

There are many procedures to do and need to change Backcolor to show what process is out-of-phase!
Since some tasks can be non-needed, I use a standard C(9) instead of all Date field.

i.e. If user fill in "Nil", that means that procedure don't need to do And the user has mention this case!
If user fill in Date as DTOS() format, "19990823" and the program will change it back to date type for calculation!

So, Cases are:
"19990823"     Normal Date with done task
"NIL"               Skip it
"" or .NULL.    Not Fill in yet!

Benefit: I can simply check this field empty or not on showing DynamicBackColor! Work Fine here!

Now, problem come:
there are Proc8, proc9, proc10 done first and check on any out-of phase for Proc11, Proc12, Proc13 !
Proc8 done then proc9, proc10 not done!
otherwise, Proc9, proc10 done and proc8 is skipped!

iif (Proc11 - EarlyDateOf (Proc8, Proc10) > 3 days, Show in Red Color, ... )   ** Ymd3Dif()
iif (Proc12 - EarlyDateOf (Proc8, Proc9) > 3 days, Show in Red Color, ... )
iif (Proc13 - EarlyDateOf (Proc8, Proc10) > 7 days, Show in Red Color, ... )


Then, I make a self-define function: YmdToD() to convert this field back to Date Format
Result:

"19990823"  return {08/23/1999}  && I use MDY for date format
"NIL"            return .T.         && acceptable input
"" or .NULL. return {}          &&  show not done and need calculate in furture
otherwise      return .F.          && Wrong Input!

this proc will fine and Next proc on calculate date different!

** Ymd3Diff() is to return Numeric for all cases on calculate day different:
Lparameters pLastDate, p1stDate, p2ndDate

If YmdToD(pLastDate) = {}  && nothing fill,
Take Today value on calculation
....
This Proc also work fine when I simply test:

? ("", "19980801", "NIL")   && etc. etc.

But when I put it into DynamicBackColor setting to show red color...
it lock at that red Record and don't go away!
( Show Color as wanted show)

I code:

* oGrd.AfterRowColChange()
...
oGrd.Columns[11].DynamicBackColor = ;
  "iif(Ymd3Diff(myTable.Field11, myTable.Field8, myTable.Field9)>3,RGB(255,64,0),RGB(255,255,255))"

it will back to that record even I click or keydown to another record..

if simply Empty(), no problem!

So, What can I do? Since this project is started for few days,
I can change the data structure if needed!

p.s. I used AddObject() to create this form!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Répondre
Fil
Voir

Click here to load this message in the networking platform