Online FoxPro Users Group Meeting Tuesday, August 20th

UPDATE: The meeting was recorded and is available on the OFUG YouTube Channel.

OFUG (Online Visual FoxPro Users Group) meets this coming Tuesday, August 20th.

I’ll be presenting “Multithreading with Visual FoxPro”, a condensed (and updated) version of my session from Southwest Fox 2011.

Even though it’s an online meeting, make sure you wear shoes – because the demos will blow your socks off.

OFUG meets the 3rd Tuesday of each month at 8:30PM (Eastern Time – currently EDT). If you’re not sure what time that is in your time zone, you can find it here.

To learn more about the Online FoxPro User Group, please check out the following links:

Hope to “see” you there Tuesday night!

Please RELEASE Me

Did you know if you add an object to a collection, and the object contains a RELEASE method, it will automatically be removed from the collection when the object is released?

Check out this example code:

oCollection = CREATEOBJECT("MyCollection")
FOR i = 1 TO 10
   IF MOD(i,3) == 0
      ?"No Release"
      o = CREATEOBJECT("ObjNoRelease")
      oCollection.Add(o)
   ELSE  
      o = CREATEOBJECT("ObjWithRelease")
      oCollection.Add(o)
      ?"With Release()"
   ENDIF
ENDFOR
?"Collection Count: " + ;
  ALLTRIM(TRANSFORM(oCollection.Count))
lnCount = oCollection.Count
FOR i = lnCount TO 1 STEP -1
   oObj = oCollection.Item(i)
   TRY
      oObj.Release()
   CATCH
   FINALLY
      ?"Collection Count: " + ;
      ALLTRIM(TRANSFORM(oCollection.Count))
   ENDTRY
ENDFOR
?"Collection Count: " + ;
   ALLTRIM(TRANSFORM(oCollection.Count))
DEFINE CLASS ObjWithRelease As Session
   PROCEDURE Release
      RELEASE THIS
   ENDPROC
ENDDEFINE
DEFINE CLASS ObjNoRelease As Session
ENDDEFINE

DEFINE CLASS MyCollection As Collection
ENDDEFINE

Objects with a RELEASE method magically disappear from the collection when they are released. This makes for an easy way to keep track of opened threads when using Christof’s DMULT.DLL for multithreading. All I have to do is make sure my callback objects have a Release method, and periodically check the “ThreadManager” collection Count property to see how many threads may still be running.

Shameless Self-Promotion

Next Thursday (June 21), I’ll be speaking at the Atlanta FoxPro Users Group meeting. I’ll be presenting the “Easy Multithreading with Visual FoxPro” session I did at Southwest Fox 2011.

Since I’ve done the session at Southwest Fox,  Detroit Area Fox Users Group and the Chicago FoxPro Users and Developers Group, I reckon it’s time to “retire” the session from “the road” after Atlanta.

So, in the next couple of weeks I’ll be posting the slides, code and whitepaper for the session.

If you haven’t seen the session, here’s a quick little “promotional” video for it (with tongue planted firmly in cheek).