On Thu, February 26, 2009 11:14 am, Mike yearwood wrote:
> I would do that a little differently. For one thing I would use a
> single replace command for the entire table and not one per column.
>
> LOCAL ;
> laFields[1], liLoop as Integer, lcCmd as String, llFound as Boolean CLOSE
> DATABASES ALL
> USE los
> llFound = .F. lcCmd = "REPLACE " FOR liLoop = 1 TO AFIELDS(laFields,"los")
> IF NOT INLIST(LOWER(laFields[m.liLoop,1]),"groupid", "stuname", "stunum",
> "inadate", "rta", "los_pk", "rowguid", "importdate", "location",
> "createdate", "createtime", "modidate", "moditime") ;
> AND INLIST(laFields[m.liLoop,2],"N","I") THEN
> lcCmd = m.lcCmd + laFields[m.liLoop,1] + " WITH 9999," llFound = .T. ENDIF
> ENDFOR
> IF m.llFound
> *Drop the final comma
> lcCmd = LEFT(m.lcCmd,LENC(m.lcCmd)-1) &lcCmd. ALL IN LOS
> ENDIF
>
>
> HTH
>
>
> Mike Yearwood
> Microsoft MVP 2008 - Visual FoxPro


Well, yours is certainly a more efficient operation, since you're passing
through the data ONCE instead of 'n' columns-affected times.  To reference
that PSU education:  you're "Big O" notation # is far less than mine
(which is a good thing in this case...lol!).


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to