Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ideas for passing records back to calling form
Message
De
17/09/2015 12:16:30
 
 
À
17/09/2015 11:57:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01624724
Message ID:
01624752
Vues:
85
Right, if primary keys are not yet populated, you can simply:
o.add(m.oRec)
otherwise reinserting into the source cursor is super easy:
select alias
for i = 1 to m.oColl.count
  oRec = m.oColl.item(m.i)
  if seek(m.oColl.getKey(m.i), 'alias', 'primaryKey')
    gather from name oRec
  else
    insert into alias from name oRec
  endif
endfor
>Nice. I had not used a collection object before. I would not have a primary key at the point of passing back the data (I would probably assign that key when I inserted it into the view in the calling form). Reading the help file, it seems as though you don't have to assign a key - any reason to do assign the key at the time of adding the object to the collection (ease of use later or good design?).
>
>Albert
>
>>
>>procedure form.unload
>>
>>o = create('collection')
>>local oRec as Empty
>>select ...
>>scan
>>  scatter name oRec  memo
>>  o.add(m.oRec, transform(primaryKey))
>>endscan
>>
>>return m.o
>>
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform