Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP.exe to different VFP.exe
Message
De
17/02/2021 02:43:48
 
 
À
16/02/2021 17:08:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01678195
Message ID:
01678307
Vues:
56
>>>
>>>**************************************************************
>>>* Marco Plaza, 2018,2021
>>>* @nfoxDev
>>>* https://github.com/nftools/wmiquery
>>>**************************************************************
>>>			If !Isnull(m.property.Value)
>>>				For Each Item In m.property.Value
>>>					nitem = m.nitem+1
>>>					Dimension &thisarray(m.nitem)
>>>
>>>					If Vartype( m.item) = 'O'
>>>						thisitem = Createobject(EMPTYORLINE)
>>>						setproperties( m.item, m.thisitem )
>>>						*** &thisarray(m.nitem) = m.thisitem
>>> 					store m.thisitem to (thisarray+'[m.nitem]')
>>>					Else
>>>						*** &thisarray(m.nitem) = m.item
>>>						 store m.item to (thisarray+'[m.nitem]')
>>>					Endif
>>>
>>>				Endfor
>>>
>>>			Endif
>>>
>>>
Hi Marco,

>There's no way to substitute the macro operator here.
Embolded: With Fox always remember and paraphrase title of Connery redoing Fireball in his last 007 flick
;-))

>( check the preceding lines for thisArray init procedure )
the previous code was middle of night, missed brackets and more - yupp, faulty answer BUT
the above should work, at least coffee-fueled cells suggest it.
( typing on Linux without easy check in vfp as this machine is sober on purpose, no Wine similar stuff)

And is it REALLY necessary to ALWAYS force "Private All" - this is certainly a way to secure against side effects, but can run you into serious perf troubles if called by old style code with oodles of variables, as there is a non-linear time component involved as variable count grows. 2 easy ways to guard: old style coding privating (only) every used var or building a small class and working as much on properties as possible...

regards
thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform