Version 5 has a new property for many objects called "Bubble Help." We're all familiar with bubble help -- hold your cursor over an object and a bit of text is displayed on the screen, usually offering some help or explanation associated with the object.
With v5, you can edit an object's bubble help as part of the properties assignment dialog. Right-click on the object and fill in the text that you want displayed.
Now here's where the real fun starts: You can program the bubble help using Xbasic.
First, the property must exist, which in normal circumstances is only if the bubble help is assigned in the right click menu / properties dialog/help page.
If you have not assigned a bubble help entry then the property does not yet exist. For example, if you set bubble help for the first_name field you can then go the interactive window and see it's value.
?People_Entry:first_name.bubble_help
= "this is the first name"
is valid.
But if you did not set bubble help for the last_name field, you'll get this in the interactive window:
?people_entry:last_name.bubble_help
ERROR: invalid data-type for this operation
The solution to this problem is the to use the property_add() method.
so, for the last_name field:
people_entry:last_name.Property_Add("bubble_help")
people_entry:last_name.bubble_help = "this is the last name"
Now, again in the interactive window:
?people_entry:last_name.bubble_help
= "this is the last name"
OK, this is neat. So what else? Well, I needed to display more information on a form than I could reasonably fit, but it was only for a few fields, and only when the user asked for it. In my particular case, I had a dozen or so insurance codes to display and the need to let the user quickly see the full description of the benefit indicated by the code. Here's a part of that screen, with a custom bubble help showing:

If you can set the text for bubble help, then why not also be able to derive the text from a table?
In this case, I have a table of codes and explanations. All I did was set a bubble_help value for the field object if it had a value. I used the form's OnFetch:
DENTAL_NHA.property_add("bubble_help")
IF UT(DENTAL_NHA.Text) <> ""
DENTAL_NHA.Bubble_Help = ALLTRIM(lookupc("f", ut(DENTAL_NHA.text), "alltrim(Description)","agreements","Code"))
END IF
This is a terrific display of the new power of Xbasic and, at the same time, it's simplicity.
My thanks, as always, to Selwyn Rabins for help on this and everything else.
Steve Workings, consultant, developer, and trainer in the Washington DC-Baltimore, is a familiar and well respected name in the Alpha Software database world. You can find Steve at www.workings.com