The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.

Moderator: pjdixit

#72080 by Jsosnowski
Sun Aug 13, 2017 10:58 am
PART EIGHT - A D4D PRIMER - CONVERTING DCAL to D4D CODE

Converting older DCAL macros into D4D macros is reasonably straight forward,but somewhat tedious process. The first step is to load your old DCAL code inin a simple text editor such as Notepad++ and run several search and replace cycles to convert from DCAL to the Delphi language. Changes include:

IF Then statements.
A Delphi if statement reads:
Code: Select all if condition then
  dosomething;
end; 

while Delphi If statements reads:
Code: Select all if condition then begin
  doSomething;
end; 
Although the the final 'end;' can be dropped if the 'doSomething; code is only one line long, it is simpler to keep the 'end' statement in place both for search and replace and for future additions. Therefore search for 'then' and replace it with "then begin'.

ELSE statements
In Delphi an ELSE statement follows this format:
Code: Select allIf condition then begin
  doSomething;
end
else begin
  doSomethingElse;
end;
Search for 'Else' and replace it with 'end else begin'.

ELSIF statements
The 'elsif' statement does not exist in Delphi. There are two alternatives to correct it.
1. Search for 'elsif' and replace it with 'end else if '.
2. Delphi includes the 'case condition of' statement structure which reads simply in your code. You can easily assemble 'case' statements individually to replace 'elsif' cascades in your code.

The 'RETURN;' keyword alone
The return keyword used alone is used to end processing a method before reaching the method end. Delphi does not recognize the keyword 'return' and uses the keyword 'Exit' instead. Search for 'Return;' and replace with 'Exit' (without a semicolon).

The 'Return value;' keyword
Delphi uses a built in function variable called 'result' for function return values. Replace the term by searching for 'Return' and replacing it with 'result := '.

For/Do and While/Do statements
These multiple line statement structures must be enclosed with 'begin, and 'end;' keywords. For 'For/Do' and 'While/do' statements Search for the word ' do' (include a leading space to avoid 'do' contained in words) and replace with ' do begin'.

End of method code line
Datacad methods conclude with a last line reading 'end <methodname>; while Delphi methods do not include the method name. To correct this manually move to the end of each method and insert '; //' after 'end' converting the method name to a comment.

! Comments
The '!' is not recognized by Delphi for a line comment. Search for '!' and replace it with '//'.

Method argument types
A typical DCAL method declaration might read as 'function doWork (a: IN OUT integer; b: IN Integer; c: OUT integer, d: integer): integer;'. Delphi does not recognizer the key words IN & OUT and instead uses 'const' for IN and 'var' for OUT. The revised method will read 'function doWork (var a: integer; const b: Integer; var c: integer, d: integer): integer;'.

Global Unit Variables
DCAL units include provisions for persistent global variables declared in units outside of methods. Whenever a macro is closed, the current value for these variables is saved in the macro file '*.dcx'. Delphi does not include these persistent variables so another strategy must be used.

Initialization methods
Many DCAL macros include a method such as 'procedure InitData;' to set initial values for a macro. The call for this procedure is usually placed in the DCAL Macro program starting method for the macro and checks a global variable such as 'Used: boolean;' to determine if the macro variables have been given initial values. Boolean variables are initiated as false so 'Used' will equal false on its first use meaning that InitData should be called. 'InitData' will then set 'Used' to true, preventing reinitialization in later macro runs. Unfortunately, Delphi unit variables are not stored between uses so this initiation strategy will not work. Delphi provides a unit section called 'Initialization' that serves the same first time purpose. However, to preserve these variables between uses of the macro they will have to be saved and retrieved using a file. One way of doing so is discussed in PART SIX using 'ini' files.

Accessing Datacad Variables
The DCAL manual lists numerous program variables that are accessible in DCAL. D4D declares these varaibles in a in a packed record called 'savevar' in uvariables.pas,although many have modified names. requiring all variables to be checked and renamed in your revised code. To access these variables you must use the function PGsavevars; to read or write the specific field as in the following code line:.
Code: Select allCurrentSz := PGsavevars.txtsiz;


Method Public Declarations
DCAL requires two files for each unit file used in a macro. 'UnitA.inc' and 'UnitA.dcs'. The '.inc' file contains declarations including a list of all methods which are to be accessible to other units in the program. The '.dcs' file contains the actual methods including a 'PUBLIC;' declaration ending each methods declaration line. Delphi moves all unit declarations into the same unit file under the section heading 'interface'. Copy the contents of your '.inc'. file into the unit under the 'interface' section keyword. Move your '.dcs' functions into the unit file under the 'implementation' section keyword and remove the 'public;' term from methods.

Character Literals
DCAL uses double quotes " to bracket character literals (eg. "c"). Delphi uses single quotes. A simple search and replace should cover all code line occurrences.
#73990 by dhs
Tue May 29, 2018 2:40 pm
Thanks for the advice Joe. I am in the process of converting some code and found your comments most helpful.

I also took it a bit further by automating many of the steps using Notepad++ macros.
So far I have developed 3 Notepad++ macros:

Replaces does pretty much all of the straight text replacements outlined in Joe's post in just one step. My macro is assigned to the Shift/Alt/R key in Notepad++. This macro just needs to be run once to do all the replacements

StrAssign macro automates the process of replacing DCAL StrAssign statements with the string assignement used in Delphi. I have assigned this macro to Shift/Alt/A. This macro searches for and corrects one instance of StrAssign at a time. You can run it multiple times automatically, but if doing so I recommend adding the word 'StrAssign' to a new line at the very end of your file before running (as the macro will corrupt the line the cursor is on if you run it and there are no more instances of 'StrAssign' in your code). I find it easier to just press Shift/Alt/A repeatedly until I hear a warning beep (the beep indicates the macro could not find an instance of StrAssign, so I then need to press Ctrl/Z to undo the last thing that it did)

StrCat macro automates the process of replacing DCAL's StrCat with the correct Delphi syntax of adding strings together. I have assigned it to Shift/Alt/C and run it in a similar way to StrAssign (as it will also corrupt the line the cursor is on if it does not find another instance of 'StrCat').

If you are using Notepad++ then you can add these macros by copying the code below into the <Macros> section of the shortcuts.xml file that is found in your 'C:\Users\<UserName>\AppData\Roaming\Notepad++' folder (replacing '<UserName>' with your user name of course). Ensure that you don't have any existing user-defined macros assigned to the keys that I have assigned before just copying this in:
Code: Select all        <Macro name="StrAssign" Ctrl="no" Alt="yes" Shift="yes" Key="65">
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="strassign" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="(" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="," />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=":" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="=" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam=")" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
        </Macro>
        <Macro name="StrCat" Ctrl="no" Alt="yes" Shift="yes" Key="67">
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="strcat" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2454" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2454" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2454" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="(" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="," />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2454" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2469" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="," />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="+" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam=")" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="2" message="0" wParam="44035" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="," />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=":" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="=" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
        </Macro>
        <Macro name="Replaces" Ctrl="no" Alt="yes" Shift="yes" Key="82">
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="\r\nEND " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="\r\nEND; //" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="\r\nEND; //\r\n" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="\r\nEND;" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="PUBLIC;" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="EXTERNAL;" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="then" />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="then begin" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="elsif" />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="end else if" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="else" />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="else begin" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="do" />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="do begin" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="return;" />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="exit;" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="return " />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="{todo: is exit required?} result := " />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="\r\n" />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="&apos; + sLineBreak + &apos;" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="\r" />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="&apos; + sLineBreak + &apos;" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
        </Macro>
#73997 by dhs
Tue May 29, 2018 3:59 pm
Here are a couple more useful Notepad++ macros:

InOut fixes IN OUT parameters. Invoked by Shift/Alt/I and fIxes one at a time and same comments apply to automatically running it multiple times as the the macros in my previous post.

In fixes IN parameters. Must be run after the InOut macro above (otherwise it will corrupt all your IN OUT parameters). I found I use the word 'IN' in comments quite a bit, so you need to watch and undo when it modifies a comment (and make sure the cursor is on the following line before you invoke the macro again). Same comments regarding multiple runs as for above macro.

Here is the xml code for the macros (insert into the <Macros> section of the same file as specified in my previous post)
Code: Select all        <Macro name="InOut" Ctrl="no" Alt="yes" Shift="yes" Key="73">
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="IN OUT" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2302" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2451" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
            <Action type="0" message="2452" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="(" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" (" />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam=":" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" : " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam=":" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" : " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam=":" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" : " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="IN OUT" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="v" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="a" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="r" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2452" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="var (" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="(var " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="0" message="2302" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2301" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2307" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="\r\n " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="\r\n" />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="0" message="2302" wParam="0" lParam="0" sParam="" />
        </Macro>
        <Macro name="In" Ctrl="no" Alt="yes" Shift="yes" Key="74">
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="IN" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2302" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2301" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="\r\n" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="\r\n " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="IN" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2452" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="\t" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam=":" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" : " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="(" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" (" />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="  " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="IN" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="769" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2180" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2304" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam=" " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
            <Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="c" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="o" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="n" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="s" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam="t" />
            <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2452" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="const (" />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="(const " />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="0" message="2302" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2301" wParam="0" lParam="0" sParam="" />
            <Action type="0" message="2305" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="\r\n " />
            <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="\r\n" />
            <Action type="3" message="1702" wParam="0" lParam="896" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            <Action type="0" message="2453" wParam="0" lParam="0" sParam="" />
        </Macro>
#74000 by dhs
Wed May 30, 2018 12:28 am
There was an error in the Replace macro code I posted earlier. You can download the correct version in my Shortcuts.xml file from my web site at http://www.dhsoftware.com.au/downloads/shortcuts.xml. There are brief instructions and description of each macro on the page at http://www.dhsoftware.com.au/dcalconvert.htm

I may update this file or add new macros from time to time, so it is easier to provide the above link than to keep posting the source here!

Best Regards,
David H

Who is online

Users browsing this forum: No registered users and 0 guests

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.

DataCAD

Software for AEC Professionals Since 1984