Beginners Page

What is it?

A page designed to help newcomers to programming in dBASE

Suggestions, tips and general advice arising from calls by beginners to our Help lines

  • Files that can be downloaded, what they offer and where to get them.
  • Common problems hit by beginners and how to avoid them.
  • The dBASE interface, how to configure it, some suggestions and some warnings.

Free Guidance and where to find it

Material to help you get started.

The Language Reference book that comes with versions 7 and 7.5 is a wealth of vital information. It is too a mirror of the OLH (On Line Help). But neither tell you what to do when you first open dBASE. First, if you have v7.5 there is a Getting Started book that all beginners should explore but what then? A great deal in fact.

A series of "How ...." articles have been prepared on most aspects of dBASE. As their title suggest, they explain how to do most of the main dBASE programming tasks and include many tips, illustrations and example code. If you have v7.5 or later they are on your CD in the KnowledgeBase (,,\kb). Otherwise you can download from the KnowledgeBase area on the dBASE2000 web site. All the files (and many other ones too) are also held on some sites in the dBASE WebRing (see the foot of the Home Page). Look at AppTools first but most other sites also hold useful material

A complete Tutorial is also in the KnowledgeBase and some other sites. It is a detailed "talk through" for creating a small application. Look too for Vesper7 in AppTools, a working example of a simple system. Not only is this another guide to how to start designing your own first system but it includes custom forms and other material that can be "borrowed" and adapted to your own needs. Never invent a wheel that already exists!

On the same theme of always look for existing material that can be re-used, do not miss the dBASE Users Function Library. In ..\kb\duflp on the CD but again can also be downloaded. In fact, as it is updated every other month you may want to download the latest version straight away. It now comprises custom classes far more than reusable functions but overall is a treasure chest of userful routines.

More guidance and reusable code is to be found in the on-line magazine dBulletin. Many articles may be too advanced for those just starting (though they will show just what is possible) but there are others ideal for the beginner. Such as a Report Generator in issue 9 (we could not resist a plug for our own contribution to the magazine!).


Who can I ask?

Getting help with problems

dBASE not only has some of the best support available for any software but it is fast and it is free! It is the NewsGroup (NG) hosted by dBASE.Inc at news.dbase2000.com. A group of gurus ("dBVIPs") have the answer for virtually every question but many others will also contribute suggestions from their own experience. You should be able to access it through your browser but an Off-Line Reader (OLR) is better. Several of us in the UK group are very happy with Agent or FreeAgent, a free version that can be downloaded and includes all the features you will want at first. Articles describing the NG and explaining how to subscribe are in the first issue of dBulletin. Subscription is free by the way!

If you feel you need a more individual helping hand, then contact one of those listed on out Home Page - though remember they do not claim to match those dBVIPs! If you can do so, bring your problems along to one of the two monthly meetings, that is what they are there for. Oh, you will probably have to be in the UK to manage this!


Design/Run Toggle


 

Errors

 

 

 

Using Two-way tools

Common Problems Reported by Beginners.

The Design Form/Run Form toggle buttons. With a default MDI form, these work as described but if you change your form to SDI you may not spot that it works differently. When you switch back from Run to Design mode the form does not close but just minimises to the Taskbar. Each time you cycle through the Design-Run-Design you leave another copy on the TaskBar. So you must maximise these forms and close them yourself.

Error messages. You may well get lots of error messages with your first programs, quite normal of course. But a few points to watch. The reported error can sometimes be misleading so check your code for all possible mistakes. The Fix option is a very convenient way or correcting syntax errors and the inevitable typo but do not assume it has infinite patience! If you try to fix too much on the fly you are likely to hit a GPF. This is quite normal, just close dBASE (which clears out the dBASE memory) and re-open. If a quick Fix is not possible and you choose Close be warned, this closes the form but may not close open tables. Close dBASE and re-open to do this.

Two-way Tools. Yes, you can edit visually on the form surface, through Properties in the Inspector or in the Source Editor. But be warned, changes made to control properties in the Source Editor in Design Form mode may not stick. Each time you save and close a form all the code for the controls are re-streamed to the wfm file. So while working in the Form Designer restrict your use of the Code Editor to creating or modifying functions. Opening a form as Source Code only does allow most things to be edited but again be prepared for changes if you subsequently open and save in the Designer. For example, a change of path in Set Procedure lines is unlikely to stick.


dBASE GUI

Configuring the dBASE Interface

What best suits each programmer comes with experience. Until then, try the layout below when using the Form Designer. The form itself in the centre, the Component Palette top left, Field Palette bottom left, Inspector top right and the Source Code Editor half hidden acros the bottom. All with just enough of the Navigator still showing to allow it to be selected if a further table needs to be dragged onto the form. This layout is best with a 1024 x 768 setting (or greater).

Explore all the configuration options. The Desktop and Form Design options are accessed from the Properties menu. Less obvious is the Customise Tools Window accessed from the View - Tool Windows menu. Through this you can set if you want labels (with the field name) placed with each field as you drag it from the Palette and, if so, whether it should be above or to the left of the field. Look at the Inspector Page and uncheck Always on Top if you do not want this. Check out too the Associate Component Types in the Files menu. This allows you to set whether you want a SpinBox, CheckBox etc. for appropriate field types or just a standard Entryfield.


Metrics for Forms and Reports

 

Wandering Windows

 

Project Explorer

A Few Friendly Tips

It is best to change the default metrics for forms and reports. Forms default to Character but most programmers find it best to work either in Pixels or in either inches or centimetres. Reports default to Twips (one twentieth of a point) but this seems to lead to some odd problems. Use inches or centimetres for reports.

It is not unknown for a window on the dBASE worktop to gradually wander in position, sometimes even to a place partially or wholly off-screen. The settings for the windows (and many other things) are in the vdb.ini file in your ...\bin folder. This can be modified in any text editor (such as Notebook) to correct any settings that you cannot change inter-actively.

Warning. The Project Explorer allows forms and other files to be opened to look as they would in the Source Code Editor. Do not try to edit such files while in the Project Explorer, it is not intended to handle this and it does not in fact do so properly.


Custom Controls


Custom Controls
. The How files and other material mentioned above will, quite rightly, strongly recommend that you use your own Custom Controls in preference to the supplied stock controls like Entryfield and CheckBox. This seems to create problems as if you drag on your own custom control (such as MyEntryfield) there is no datalink. In fact there is a property in the inspector that allows you to select the table and field to set a datalink. Alternately (my preferred method), just drag on fields from the Field Palette and at sum later point use the Search and Replace facility to change all the stock controls to your custom ones.


Grid is better than Browse


Browse or Grid?
 If you are familiar with DOS versions of dBASE (or Visual dBASE 5.x) then you may use the Browse control just because it is familiar to you. However it is there just to allow a quick migration of some old code into dBASE 7.01 and above. It has limitations and restrictions and you will do better to use the newer Grid class. This allows far more control by the programmer and each upgrade is likely to add add more facilities.

Text on Forms


Text or TextLabel controls?
 Use the Textlabel control (v7.5 onwards) for all simple text on a form. The Text control offers more scope such as wrapping across several lines and the inclusion of HTML tags to format the text. But the downside is that it is slower and uses far more GDI (see other pages for a discussion of this). So for simple labels against entryfields, column titles and similar, use the Textlabel control.

Home Page 

Articles       Demos      Library       Meetings      Members       Tip & Tricks