Jun
20

I got an email from Bob Kocher this morning noting the finalization of the speaker list and he has pulled another one out of his hat with Nancy Folsom. Another fine selection. Nancy did a great session on Refactoring at GLGDW 2006, so her session Refactoring à la Carte is another one to add to your “must see” or “must read” list.

Jun
18

A couple of weeks ago I wrote a builder that generically manipulates properties. I was trying to recall a technique with macro substitution I used a couple of years ago to do this very thing.

I opened up Code References started searching source code for “..&” (period, period, ampersand) because this is what I thought I needed. The search came up with no results. This surprised me. I could have sworn I needed two periods.

It turns out what I needed is simply “.&” (period, ampersand). You see, what I intended to do is concatenate a macro substituted property name to the end of a reference to an object in the live designer. The final code is pretty straightforward once you know what you need. In this case I have a combobox with a list of objects in the form or class designer. The combo has an array with the full containership path to the object from the outermost container. To get an object reference I executed the following code:

lnComboRowSelected = this.cboObjectsToPickFrom.ListIndex lcAddPath = this.cboObjectsToPickFrom.aItems[lnComboRowSelected, 2] loPickedControl = this.oControlList.oObject.&lcAddPath;

The properties I am working with are in a multi-pick listbox. To get the value of the property on the control I use the following code:

lcProperty = ALLTRIM(this.lstCommonProperties.aItems[lnI, 1]) lcPropertyValue = loPickedControl.&lcProperty;

In this particular builder (which will be discussed in a future issue of Advisor’s Guide to Microsoft Visual FoxPro) I generically allow you to pick to controls, select the properties you want identical, and the builder will migrate the properties. This is using the BuilderControls framework also discussed in the article. I use the same technique twice in the same method that moves the property values between the controls.

It bothered me a bit that I could not figure out why I originally thought I needed two periods. Then last week Tracy Pearson made a post on ProFox that was the smack up the side of my head jogging the correct memory of what I was thinking about. This is the second technique of using macro substitution.

I often work with tables or cursors to store data and often know the structure using AFIELDS() or some other technique. I control the alias to the cursor programmatically and store it in a memory variable. If I want a specific value from a column and need to include the alias (something I always like to do to eliminate the ambiguity factor) in the reference to the column. If the code is a generic to the cursor I can use macro substitution to manipulate the data:

lcAlias = ALIAS()

ldInvoice = &lcAlias..dInvoice;
lcCustomerName = &lcAlias..cCustName;

As Tracy pointed out in his post: “One dot to end the macro substitution, one dot for the normal table.field”

It made me feel better that there was a two-period macro substitution technique, I just wish I would have saved a half hour not looking for it the wrong way {g}. Hopefully this post will either introduce you to the techniques, or serve as a reminder they exist and they are completely different.

Jun
17

Just in case you have not seen this yet, Bob Kocher has more surprises for you at Southwest Fox 2006. I just read that he has added Rick Borup, Milind Lele, Rod Paddock, and Christof Wollenhaupt. Wow!

I think this will be Christof’s first speaking engagement in the USA, but he has been a big time speaker at the German DevCon for years and someone I really respect. His knowledge of VFP and software development are tops in our community. I am really looking forward to his session ‘The Security Cookbook.”

Rick Borup is one of my personal favorite speakers at VFP conferences and is the co-author on Deploying Visual FoxPro Solutions. His session on “Automating the Build” is something I plan on attending.

Rod Paddock has hosted the often overlooked FoxForum.com site, which is where I hang out daily. Rod is an accomplished developer in both VFP and .NET so his session on “Understand the .NET Framework” should be a good one.

What a great set of additions to a power packed line up!

I also see Bob has announced each attendee will receive $150 in DBi Dollars. What a fantastic offer from the folks at DBi Tech. DBi Tech has been involved with the Fox Community for years, but have really stepped it up in the last 12 months with the Sedna components they are planning to release as part of the product and now this generous offer. Way to go DBi Tech and Bob!

Looks like Southwest Fox is heating up even more to be the best valued conference of the year here in the USA. I am sure there is not better bang for the buck in conferences around. You still have a couple of weeks to get the lowest price available. And knowing Bob, he probably still has a few tricks up his sleeve.

(updated 06/20/2006 to remove Milind’s speaking as Bob has removed him from the list in latest post)

Jun
14

Lost in Trace

I have a situation here that has me perplexed. I build an APP file, the VFP Builder Manager (Builder.APP) to be specific. I do a Recompile All, and have checked on Debug Info and unchecked Encrypted in the Project Info dialog when I build.

I have added a SET STEP ON in the code to figure out a problem I have with a new builder I am writing. When the Trace Window opens there is no code displayed. None. It is as if the Debug Info was checked off.

I have checked the code for SYS(2030) and there are no instances of this called in the project. There is no SET DEBUG OFF anywhere in the project. The FXPs are not readonly and not getting replaced because the code stops on my SET STEP ON. I have checked this with PROGRAM() and LINENO() in the Watch window and they match my additions to the Builder.PRG. No projecthook to reset the Debug Info setting. I even added a SYS(2030,1) to make sure VFP was not stopping the debugging internally.

I know I am running the correct version of the APP file by checking _BUILDER and doing a ?FDATE(_BUILDER) to see if the file is the correct build date.

As you probably know, I don’t have much more hair to pull out.

Has anyone seen this before? Can anyone point me to the corrective action? There could be prizes!

Jun
09

Finally coming up for some air today after a marathon of activity here at White Light World Headquarters. I added about 10 blog entry ideas to my Wiki over the last couple of weeks and have not had time to address any of them.

VFP 9 has many enhancements to the Property Sheet, but one I was using a lot this last week include a shortcut to the Edit Property/Method dialog. I was refactoring some classes for a builder framework I am extending (which will be detailed in a future article in Advisors Guide to Visual FoxPro). I was adding properties and methods, renaming them, changing descriptions, and moving them to different classes. Fun work.

One of the frustrating things to make these changes is to to pull the Edit Property/Methods dialog off the Form or Class menu. Once displayed you have to scroll down the list to find the property/method you want to change. What I rediscovered this week is you can call the dialog from the Property Sheet shortcut menu and it will actually position you on the PEM (property/event/method) in the dialog. What a time saver.

Unfortunately this is only available for custom property and methods you add to the form or class. Right-clicking on intrinsic PEM does not display the menu option. Bummer.

Now the dialog should become a MenuHit project on SednaX (hint, hint, hint {g}). The dialog should be modeless like Doug Hennig’s New Property/Method dialog. It should be resizable, remember its last size and position, and be dockable. It should be MemberData smart (making a change to the PEM in this dialog wipes out the MemberData details), the New Property and New Method buttons should call Doug’s dialog. I am sure there are other ideas. What are your’s?

There was a brief thread on this topic a long time ago on FoxForum.com (“Semi-hacking .SCX/.VCX PEMs for speed” thread in June of 2005). I offered to help, but unfortunately the thread and the discussion went no where. Hopefully someone will take the charge and come up with a replacement dialog.

Jun
05

SednaX Name Poll

Just in case you have not heard: the SednaX Admins are requesting your opinion on changing the name. Here is a snippet from Craig Boyd’s news post on SednaX:

In the interests of providing SednaX members and project managers with more features and a powerful online environment for collaborative projects a move to Microsoft’s CodePlex (http://www.codeplex.com) is being looked into. The CodePlex site is still in beta, but offers a number of features that SednaX members and projects could benefit from. The timeline in which SednaX would be moved to CodePlex is still a little difficult to estimate, but we hope to be able to make the move in a timely manner.

One of the other changes that is being considered as part of the move is renaming SednaX to better reflect the fact that it is related to Visual FoxPro. We have set up a thread, ‘SednaX Name Change’, in the discussion area for ideas about what SednaX should be officially named/branded for the long term.

Andrew MacNeill is taking this a step further with a poll. Cool.

So take part in this community effort and join in on the discussion in the SednaX forum, and vote on the poll. Both aspects will impact the final decision.
May
26

VirtualPC Resources

Back in March I blogged looking for instructions to set up a Virtual Machine. I even asked this question to the attendees of GLGDW 2006. I flat out have not had a single pointer to some decent resources. This surprises me.

Since this time I have run across two good resources I want to share with you. The first is a book called The Rational Guide To: Microsoft Virtual PC 2004 (Amazon link here). It is a short book and has some decent pointers on configuration and setup of VirtualPC. While this book has some simple topics and states some obvious points, you will definitely get your US$10 worth from the read.

The second resource is a new whitepaper from Ronald Beekelaar and John Paul Cook titled Developing and Debugging Software Inside of Virtual Machines. You can get this whitepaper free of charge of on Microsoft’s VirtualPC site. Besides the testing and debugging topic, this whitepaper helps you with copying a virtual machine (VM) to save you time setting up different configurations of the same OS, making new VM, and configuring advanced networking scenarios.

Neither of these resources resolved all the things I was looking for initially, but between the two I have been able to answer most of the questions. Hopefully if you are in the market for some answers to similar questions you will find these resources helpful.

May
23
SednaX membership is exploding. We have been approving close to 10 memberships a day for the last week and we just hit 700 memberships overall. This is phenomenal!

We recently added two exciting projects:
1) ctl32_statusbar headed by Carlos Alloatti
2) Code Analyst headed by Andrew MacNeill
The other projects all have recent updates to the source code as well:
1) GDI+ X Foundation Classes headed by Bo Durban
2) JustBehave headed by Glenn Domeracki
3) OOP menus headed by Doug Hennig
A few people recently emailed me asking how they can get involved. It really is easy, join SednaX, then offer one of the project managers your assistance. It is up to each project manager to handle their projects as they see fit, but I know several of them are looking for testers and feedback at the moment.
There is another project on deck which we will be announcing soon too. I think it is safe to say SednaX has momentum.