Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Figuring out VFP crashes
Message
From
02/03/2017 02:24:29
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01648682
Message ID:
01648717
Views:
113
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 ;-)
Previous
Reply
Map
View

Click here to load this message in the networking platform