> 2) On a more serious note, I have a question about DK add-ins....once installed on your computer, are the .exe files stored in a library
so that if you have to move data and MT to a new computer or hard drive (which happens to me periodically), one can easily re-
install  the add-ins from a local library?
GIDSK source code is kept in an .rsc file. It compiles to 7 files, eg., myprog.rsc compiles to myprog.1 through myprog.6 and myprog.dbd.  This set of files is called a UI (user interface).  To use the addin you go to Tools-Addins-Setup and point to the dbd portion of the UI, eg., myprog.dbd (which can be anywhere) and give the name of the starting macro or dbox.  You can move these to any computer at any time and set them up 

 > 3) Is there a central library on-line of "public domain" DK scripts?  It seems that they are scattered in various places, 
 > perhaps with varying amounts of explanation on how they function.  It seems that the MT & TransCad user community 
could develop & maintain an on-line warehouse where users could browse, select download files & experienced DK 
 > programmers could submit applications for peer review & ultimate posting to the "tested" list of applications.
There is no central library beyond the ones at Caliper and on Directions Magazine.  Ever since Marjorie Roswell started this group we have occasionally discussed sharing DK programs somehow.  In fact I contributed some of the first programs, and, I think, it was Marjorie that got the Directions Magazine library set up. 

One of the problems with producing for a public library is the following.  It is very quick and easy to bang out a small piece of code to do exactly what you need to do by hard wiring all your file paths, layer names, settings, etc., etc.  This core code usually only takes about 20% of the time when writing a Dk (or any other program).  But when you add parameterization, generalization, user interface, error trapping and internal and user documentation, and handle the mechanics of getting it into a library, etc., the time becomes difficult to expend on a voluntary basis, especially for consultants who make their livelihood creating such software.  I think most software sharing libraries are contributed to by full-time employees of organizations and companies where they are not under intense pressure to get a lot of work out or are specifically allowed to contribute to the user community.  (Also, right now there aren't very many GISDK programmers so this effort would fall to a few of us.)
 
Many of my addins have been of the "quick and dirty" type to solve a particular problem and don't have the aforementioned qualities to make them a finished product.   If I contributed these to a library they could not be run as-is without adapting them to your situation or the current version of Maptitude.  I don't think the current libraries would want such contributions. 
 
HOWEVER, in the interest of expanding the DK user community, this weekend I will review my 9 years of dk programs, eliminate the proprietary, redundant and garbage code, put them in a zip file, and provide it to anyone interested.  It will probably amount to about 50 to 100  GISDK (.rsc) files with lots of working sample code that does lots of different things.    When I write DK code I often do a global search through my code to find similar code to copy in to avoid writing blocks of code anew.   (CTRL-F5 does this very nicely in TextPad; see below).  These files could help you with your efforts to learn the DK.  One rule that I have always followed is to prefix each small block of code with a comment lines saying in English what is being done.  These, and comments and the beginning of each macro, should help you understand the code. 
 
Send me a private email at [EMAIL PROTECTED] if you want to be on the list to receive it, probably this Sunday.  I will also include the 5 page GISDK language summary Word document that I mentioned in a previous email. 

 > 4) Given the higher degree of functionality of TransCad, would it be true to say that all DK add-ins written for MT will 
 > work with TransCad but not all TransCad add-ins will work with MT?
Correct.  We have run many MT 4.6 compiled programs in TC 4.6 with no problem.

 > 5) On a similar note, do DK add-ins need to be categorized for MT version compatability (i.e. works with all 4.x versions or 
>  works only with 4.5+ or 4.6+ or 4.7, etc)?

That's a little more difficult.  It depends upon if you used a feature/function that changed.  There haven't been that many, the biggest one being that you used to be able to get the length of an array with array.len but when array dot notation came in that had to be changed to array.length.  It's usually a good idea to compile to the particular version but there are long stretches of versions that can use the same code.  The safest is to get the source code (.rsc) and compile it on your machine.  Caliper may have a better answer.  I think everything for 4.1+ works OK. 4.0 and prior should be adapted for 4.1+.

[
A couple of other notes on DK programming.  If you're going to do it I highly recommend the following:
 
1. A program editor that can show line numbers.  Notepad won't do!  Armando and I use TextPad (http://www.textpad.com) which is fast to start up, powerful, easy to use and cheap ($29).  The reason you need line numbers displayed is because the DK compiler and Maptitude error displays give the line number of the problem DK command.
 
2. I use ShortKeys (http://www.wintools.com/) to speed code writing.  This program allows you to specify a prefix of your choosing and then an abbreviation for some text.  For example my prefix is "..".  To insert the DK command for a scroll list into my program I type ".." plus my abbreviation for scroll list "sc", eg., "..sc" and I get this inserted instantly:
 
scroll list 1,1,30,15 list: xxxxxx_list multiple Variables: yyyyy_index, click do
     if click=0 then do   // single click
     end
     if click=1 then do  // double click
     end
  enditem
 
It works anywhere in Windows.  It is wonderful for filling in forms in a browser, eg., when I type ..add I get my address line, 170 Richardson Rd., inserted into a text box.
 
Armando and I look forward to more of you starting to use the DK.  Since it is a procedural language it doesn't have anywhere near the learning curve that learning Microsoft VisualBasic or C# have.  But it will take some effort and dedication on your part.  I guarantee you that, if you do a lot of mapping, you will enjoy automating some of your repetitive tasks, and increase your productivity in the long run.
 
Larry Manire
 
 
 
 
 

Yahoo! Groups Sponsor

Get unlimited calls to

U.S./Canada



Yahoo! Groups Links

Reply via email to