> Gerald Shapiro wrote:
>
> I am fairly new to MapBasic, and I am wondering how others use
> DiaBUilder2000 and MBCoder as a development environment.
>
> I started writing my code in the MapBasic Editor, and then
> fired up DiaBuilder2000 to generate my DIALOG block. Now I have
> a number of files that DiaBuilder2000 created, with variable
> and subroutine definitions. All I can figure out is to cut and
> paste these into my existing code, but is there a better way?
Don't cut n' paste except on the most trivial dialogs. Doing this
prevents you from easily changing the dialog later and getting it
back into your code.
I create a directory below where my mb source code resides called
\Dialogs, and that's where I store all my DiaBuilder2000 dialog
projects. Then in my source code I use Include statements to
dynamically insert the relevant pieces of the DiaBuilder output.
For example, if I create a dialog project called EditWidget.prj,
I insert the approriate EditWidget files like so:
'EditWidget.mb
Include "Dialogs\EditWidget.def"
Include "Dialogs\EditWidget.dcl"
'...
Function EditWidgetDlg () as Logical
Include "Dialogs\EditWidget.dim"
'... dialog prep code goes here, or call a Load subroutine from
the form
Include "Dialogs\EditWidget.dlg"
If Not CommandInfo (CMD_INFO_DLG_OK) then
Exit Function
End If
'... post dialog code goes here
EditWidgetDlg = TRUE
End Function
This way I can always modify the DiaBuilder projects, and just
recompile the code to reflect the changes. I also usually put
each dialog function in its own code module, so I can use
module-scope variables that won't interfere with the rest of the
application. I also put the dialog-specific functions in this
module (e.g. EditWidget_Load(), EditWidget_UpdatePicklist(), etc.
It's a little more work to build multi-module applications, but
it pays off in the maintenance end of the program life cycle.
- Bill Thoen
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 11576