Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax help??

Status
Not open for further replies.

lemonjuice

Programmer
Jun 12, 2003
62
ZA
Does anyone know the syntax to use, when working with the setDesktopPreference() property?
 
lemonjuice,

It can be confusing, for the Help files aren't that clear. Here's an example that makes certain that the Developer Menus are displayed:

Code:
method pushButton(var eventInfo Event)
var
   atPV Anytype  ; Preference Value
endVar

   atPV = getDesktopPreference( prefProjectSection, 
                                prefDeveloperMenu )

   if not atPV then ; Dev Menus aren't displayed
      setDesktopPreference( PrefProjectSection, 
                            prefDeveloperMenu, TRUE )
   endIf

endMethod

The Help file documents three sets of Developer Preferences:

1. Project Preferences (e.g. global settings that apply to the current "project")

2. QBE Preferenes, which control the results of your QBE queries.

3. Project Viewer preferences, which indicates whether or not the Proejct Viewer is displayed when you start the program.

Another thing the Help file doesn't make clear is the data type of the underlying value. While it's true the DesktopPreferenceType values are small integers, the settings within each section can vary types dramatically. The one used above, for example, is a Logical while prefTitleName returns a string.

At this point, it's probably best to experiement with these as you need them, though I think I'll add an article request to the wish list for my site that clarifies these in more detail.

To determine the data type of spefici settings, use a simple script that retrieves the value you're looking into an AnyType variable and then call that variable's view() method without a title. When you run the the title of the view() dialog will tell you the data type you need to use.

In the mean time, I hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top