Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Figuring out VFP crashes
Message
De
02/03/2017 02:24:29
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01648682
Message ID:
01648717
Vues:
114
This message has been marked as a message which has helped to the initial question of the thread.
>>>
>>>with thisform
>>>   lcAlias = .parse(tcFieldList, "ALIAS")
>>>   lcAlias = iif(empty(m.lcAlias), alias(), m.lcAlias)
>>>   if !empty(m.lcAlias)
>>>      lnFields = afields(laFlds)
>>>      for lnI = 1 to lnFields
>>>         lcField     = laFlds[lnI, 1]
>>>         lcType      = laFlds[lnI, 2]
>>>         lcMemvar    = "m." + m.lcField
>>>         lcPassedVal = .parse(tcFieldList, lcField)
>>>         if vartype(m.lcMemvar) = "U"
>>>            public &lcMemvar
>>>         endif
>>>         do case
>>>            case lcType $ "NFIBY"
>>>               lxVal = val(nvl(lcPassedVal,"0"))
>>>            case lcType = "D"
>>>               lxVal = ctod(nvl(lcPassedVal,"{^1900-01-01}"))
>>>            case lcType = "T"
>>>               lxVal = ctot(nvl(lcPassedVal,"{^1900-01-01}"))
>>>            case lcType = "L"
>>>               lxVal = upper(nvl(lcPassedVal,""))=".T."
>>>            otherwise						&&"C" "M"
>>>               lxVal = nvl(lcPassedVal,"")
>>>         endcase
>>>         STORE lxVal TO (m.lcMemvar )
>>>      next lnI
>>>   endif   
>>>endwith
But if it's not reproducible it's unlikely to be the problem ?
>

On quick glance I would break out of with endwith IAC:
the memory access path is not shortened by many object steps (with thisform.page1.cnt1.btngroup2.btn3)
and only needed twice with ".parse", so the overall code length will be minimally shorter.
If you are at it, delete the lnFields by putting afields() in for loop and delete lcField by referencing the array value twice ;-)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform