Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>Sorry if I offend rules and regulations here by asking this, but Thomas, seeing as you understand what I am doing - If I have say 4 records in the table, and make 4 line objects visible, my next problem is to make each visible line object display the data in it's record in the table. Any suggestions how to achieve that? EG: Object1 to display record 1 data, Object2 to display record 2 data, etc.
>
>Many thanks!
I'd go top before the loop, in loop scatter to the line object (which I is not a vfp line object but some container representing the line of record data) or a sub (data) object, set visible, skip
but since I have no idea what controls are there / how data binding is accomplished, this is shooting in the dark without some code you already have. From architectural POV I'd probably create a base "line class", which has a designated data subobject and all repeating controls on it. on the form I'd pseudo-subclass this classs with the recno-names and set in the loop a temporary object pointer for fast and generic handling or pass current active line object to a method which can do all work on the supplied instance parameter.
loLineNo = eval(thisform.Dayjobsline" + ALLTRIM(STR(x)) )
or
thisform.BldLinePerRec(eval(thisform.Dayjobsline" + ALLTRIM(STR(x)) ) )
procedure BldLinePerRec(toLineNo )
Scatter Name toLineNo.oData [additive]
toLineNo.visible = .t.
skip
As there are quite a few ways to code that which are "good enough" I'd ask you to either sketch your current approach / work done or use one of the vcx/scx to prg tools and give current code samples.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement