Egg or Chicken, Properties or Methods?

In Visual FoxPro you can use expressions to initialize properties. These expressions are evaluated only once when you first load a class into memory. The result is stored in the class object. To create an expression for a property, you can either enter the equals sign in the Properties Windows followed by the expression or you press the "fx" button next to the text box on the Properties Window.
Read More…

TRANSLATE() gotcha

TRANSLATE() is the PL/SQL function that provides the same functionality as CHRTRAN() in Visual FoxPro. The function searches the first string and replaces every character in the second one with the corresponding value from the third string:
Read More…

Being fooled by Oracle

PL/SQL is a programming language that is quite close to Visual FoxPro. Many string functions have the same syntax as in Visual FoxPro, such as SUBSTR() or are pretty close like PADR() that becomes RPAD() in Oracle. However, with concatenation there's a huge difference in Oracle. To combine strings you use the "||" operator instead of "+". That would be fine, if the plus operator wouldn't work with strings, too:
Read More…

The scope of CREATEOBJECT

Sometimes one gains insights that are absolutely useless. One such piece is the scope of CREATEOBJECT(). The first time you instantiate an object from a class, Visual FoxPro creates a template object with all the properties values that the class defines. If the class definition contains an expression for one of the properties, Visual FoxPro evaluates it at this time once. For any further instance, Visual FoxPro uses the pre-evaluated expression from the class object.
Read More…

Tagged

So much for keeping this strictly technical... Craig Berntson and Ted Roche tagged me in their blogs. Which means I'm now participating in a cocktail party game initiated by Jeff Pulver and I don't even know him except for five things. So, here are the five things about me you didn't (want to) know before:
Read More…

Binding to the Valid event

As with so many things in Visual FoxPro, binding to the Valid event isn't as straight forward as one may wish to. When binding to a control in a grid, Visual FoxPro calls the delegate object only when the grid control contains user defined code in the Valid event at some point in the class hierarchy. This code doesn't have to do anything and can be a plain comment. Visual FoxPro needs the user-defined code as a binding place, so its mere existence is sufficient.
Read More…