Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Compile DXL in crimson editor
Topic Summary:
Created On: 22-Aug-2005 20:09
Status: Post and Reply
Linear : Threading : Single : Branch
1 2 Next Last unread
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 22-Aug-2005 20:09
User is offline View Users Profile Print this message


Baher Mohamed

Posts: 63
Joined: 21-Jun-2005

looking for the file to call from crimson editor so i can compile the dxl in that environment rather than putting it back into DOORS before its completely finished.

Thanks!
Baher
Report this to a Moderator Report this to a Moderator
 22-Aug-2005 22:55
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I use Crimson. Someone cleverer than me can probably do what you want. But what I do is edit the file in Crimson, lets call it file "c:\DoorsStuff\InProgressDXL\MyDXL.dxl". Then I open my module, open the DXL window and type in "#include <c:\DoorsStuff\InProgressDXL\MyDXL.dxl>". Then [Run]. Notice the DXL window doesn't have a copy, that stays in Crimson. Notice you can make the DXL window pretty small.

- Louie
Report this to a Moderator Report this to a Moderator
 23-Aug-2005 13:42
User is offline View Users Profile Print this message


Baher Mohamed

Posts: 63
Joined: 21-Jun-2005

Thanks! I'll give that a shot for the time being. Much appreciated.
Report this to a Moderator Report this to a Moderator
 23-Aug-2005 18:35
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

What you want to do is check the dxl file you are editing for errors, then if there are any send them to the output window of your editor so that when you double click on an error it will take you to the file and line that caused the error

I note that most of the dxl gurus on this site use crimson editor, but I favour a combination of "EditPlus" and "beyond compare". Whatever - the principle is the same for all of these sorts of editors and any effort you make to output the errors to your editor of choice will very quickly pay for itself. Once I'd done all this all I ever have to do is press a button in Editplus then all the errors are instantly sent to the output window.

What you need to do is: -
1)Create a tool to send the current filename to doors and run a dxl file that uses the checkdxlfile command on the dxl file.
2) Format the generated error file so that when you input the error file to your editor of choice clicking on an error will take you to the line that caused the error.
3) send the error file to the output window of your editor of choice. 

The following is a VB script that I use to do step 1 and should get you started, if you are not used to VB and automation you may struggle, but even a fairly strenuous struggle will pay dividends

Sub Main()

    Dim FileName As String

    Dim FileWithQuotes As String

    Dim CodeString As String

    Dim DOORSObj As DoorsDXL

    FileName = Command()

    FileWithQuotes = Replace(FileName, "\", "\\")

    CodeString = "string ThisFile =" & """" & FileWithQuotes & """;" & vbCr & "#include <J: \DXL For Edit Plus\SendErrorsToEditPlus.dxl>"

    Set DOORSObj = CreateObject("DOORS.Application")

    DOORSObj.runStr (CodeString)

End Sub



-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 23-Aug-2005 20:00
User is offline View Users Profile Print this message


Baher Mohamed

Posts: 63
Joined: 21-Jun-2005

what executes the "checkdxlfile" command, and after executing, what file does it call...ie...does it call a dll or something in the DOORS directory to compile the DXL file i am working in? I wanted to install the compiler in crimson editor the same way you do when you install the C compiler in it...ie...you just point to the exe or bat that was installed in Borland C program directory...
Report this to a Moderator Report this to a Moderator
 23-Aug-2005 21:55
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Almost all my DXL is context sensitive, usually it runs in "current module". This context makes it much harder to "push" then DXL from the editor to DOORS, since the "push" needs to also specify the context. "Pulling" the DXL from the DXL window via the $include statement solves the context problem.

Double clicking on an error to jump to that line of code is handy, but only a second faster than cntr-G and going to that line.

And most importantly: I like what I know.

- Louie
Report this to a Moderator Report this to a Moderator
 24-Aug-2005 13:47
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Baher,

Unfortunately Telelogic do not provide an exe that returns the errors to your editor of choice, you therefore have to be inventive and use what they do provide ie the checkdxlfile command. Sometimes life is more difficult than we'd like it to be!

You need to look more closely at the last three lines of the VB script I posted. I am essentially writing a dxl file on the fly. The dxl file contains a variable containing the filename of the code I am editing in Editplus and an include statment to a dxl file I use to process the errors returned when I pass the file to the checkdxl command.

ie it looks something like

string ThisFile = "<NameOfFileBeingEdited>"
#include <MyDXLFile>


The "MyDXLFile" file will contain something like: -

string ErrorString = checkDXLFile(ThisFile)

...
some code to process the errors into the required format

...

then a line to pass the errors back to your editor which in my case is: -
system EditPlusPath " -o \"C:\\Temp\\DXLOutput.txt\""



-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 24-Aug-2005 14:07
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Louie,
You say your typing

"#include <CodeFilePath>"

directly into the dxl editor

What you really want to do is write yourself what I think I remember is a 4 line script to send this line from your editor to the clipboard, therby avoiding the naus of typing this stuff in every time. ie simply press a tool button and <Ctrl>+V.

Regards,
Richard

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 26-Oct-2005 11:30
User is offline View Users Profile Print this message


Richard Hesketh

Posts: 4
Joined: 8-Apr-2003

Great answers above - just wanted to add that Baher is labouring under a misapprehension about the nature of DXL. DXL is interpreted, and there's therefore no pre-emptive compilation process for you to go through. You simply feed the plain text DXL to the interpreter which is built into DOORS. The techniques described previously in this thread should help to automate that process.
Report this to a Moderator Report this to a Moderator
 31-Oct-2005 17:37
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

There is another misconception in this thread - this time from Mr Landale. The misconception is that I am attempting to run a dxl file using the checkDXLFile command - I am not - hence the context is not important. You need to note that the checkDXLFile command looks for syntax errors and has no interest in run time errors as it doesn't run the script. For instance running the a dxl file that uses somthing like "Module m = current" in DOORS without a module open would generate a run time error, but it would not generate a syntax error, therefore no errors would be generated by the checkDXLFile command. I only worry about the context once I have dealt with all the syntax errors. I then go to the next step which would be to run the dxl file from a menu item in a module or cut and past a "#include" statment to the dxl window (very rarely do I find errors at this stage).

You may like to note that the checkDXLFile is also a good way of checking complex attribute dxl for errors - using the little dxl window used to be very annoying. Hope this helps.

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 12-Jul-2007 17:38
User is offline View Users Profile Print this message


David Dawson

Posts: 27
Joined: 11-Mar-2003

Two years later, and the thread is still useful. Thanks to all for the good help and insights on how to avoid editing in the DXL window.

I have PSPad set up and can run checkDXLFile via an #include file (run from the dxl Input window) and have any resulting syntax errors sent to an external text file. What's not clear to me is the how the VB code is operating. From other code I have run across and used, I can see that the idea is to have VB (called from EditPlus?) kick off the DOORs application with the name of the file to be checked and the fully-qualified name of the output file.

I have cut and pasted the included code into my VB editor, but as soon as I attempt to execute it, I get a compile error on the Dim DOORSObj As DoorsDXL statement, which actually doesn't surprise me, as I wouldn't expect VB to have knowledge of a DoorsDXL Type. Am I missing something very obvious?

Anyway, thanks to all again for getting me this far. I can only hope that some of you are still looking at this forum and can give me a little bit more insight into the task.

regards,

david dawson

-------------------------
You never know where you're going 'til you get there
Report this to a Moderator Report this to a Moderator
 12-Jul-2007 17:39
User is offline View Users Profile Print this message


David Dawson

Posts: 27
Joined: 11-Mar-2003

please ignore accidental double post

-------------------------
You never know where you're going 'til you get there

Edited: 16-Jul-2007 at 15:43 by David Dawson
Report this to a Moderator Report this to a Moderator
 12-Jul-2007 23:02
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Don't know VBS but I did shamelessly steal someone else's pioneering work and managed to figure out how we could add a Hyperlink to a Web page that would jump to the hyperlink's specified DOORS object.

The following two VBA lines of code did the trick.

Set DOORSObj = CreateObject("DOORS.Application")
DOORSObj.runStr ("#include <c:\doors-stuff\VBS-Stuff\HyperlinkToObj.inc>; fHyperLinkToObj(""SSUP_3"", """")")

Caveates:
[1] You would use some other #include. [2] IIRC, if DOORS wasn't running then DOORS was started, the login screen displayed, but otherwise the VBA failed. After logging in you would run the VBA again. [3] There was a significant problem when more than one version of DOORS was installed on the client, as "DOORS.Application" wasn't unique. I believe there was a way to invoke a specific version of DOORS and that method requires scanning the Registry looking for some key info and changing "DOORS.Application" to that info.

- Louie
Report this to a Moderator Report this to a Moderator
 13-Jul-2007 14:38
User is offline View Users Profile Print this message


amjad moghul

Posts: 2
Joined: 12-Jul-2007

Louie

Can you provide an example of what is in your c:\doors-stuff\VBS-Stuff\HyperlinkToObj.inc file please



Thanks
Report this to a Moderator Report this to a Moderator
 13-Jul-2007 16:33
User is offline View Users Profile Print this message


David Dawson

Posts: 27
Joined: 11-Mar-2003

Thanks Louie,

Yesterday afternoon I too shamelessly grabbed some code (that Richard had posted) and got things working. As it turns out, I didn't need the Dim DOORSObj As DoorsDXL statement, probably because I already had a dxl window open.

So, although I can run the VB and get the dxl output captured, I still have a problem that I'm struggling with-- how can I have PSPad call the VB code (or something like it) and how can I get PSPad to recognize the output file as its log file? If you, or any others, have figured this out and could point me in the right direction my outlook for this weekend would be considerably brighter.

regards,

david

-------------------------
You never know where you're going 'til you get there

Edited: 16-Jul-2007 at 15:42 by David Dawson
Report this to a Moderator Report this to a Moderator
 16-Jul-2007 18:48
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Its complicated and depends on some local project policies in order to make it work.
Report this to a Moderator Report this to a Moderator
 16-Jul-2007 20:11
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Hi David

Trying to pass the errors from your compiler/interpreter back to your code editor then double clicking to go to the correct line in the correct file makes the dxl writing experience far more comfortable. It is not a difficult thing to do, but you do have to have a little knowledge in a few different areas which many dxlers seem to lack. Mind you I expect that many of the users of this forum have similar schemas to mine.

Good choice of editor by the way, I switched to PSPAD some time ago and and think I've published a syntax file for it on the DXL forum - have a search for it (if its not there let me know and I'll post it again). Also note that the syntax file from one editor can be turned into that for another one in a matter of minutes given the right search replace commands.


The attached dxl file parses the errors into a form that can be understood in pspad.
I trust you have set up a dxl highlighter and have been trying to get the compiler to work as the following refers to that tab and will be a little confusing if you got stuck before getting there!
you will need to put: -
%F(%L,
in the Log parser and set the log file entry to where ever your sending the errors. "c:\temp\DXLOutput.txt" in my case. I compiled the vbs code I previously sent and fire the exe when I hit the "compile" button for the dxl file - Note that the active file is sent as a command line parameter. I see no reason why you shouldn't run a vbs file from the Compiler field although you might have to fire it via wscript, anyway I think you can get a free vb compiler pretty easily. The attached code says its for editplus, but I've actually modified the code for pspad, but not the comments!

-------------------------
Regards,

Richard Good
Report this to a Moderator Report this to a Moderator
 16-Jul-2007 20:15
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

Forgot the include file! Note that theyve fixed a long running regexp problem in v8.2 so the following file will give a dxl error in that version. Also note that you need to add a reference to the DOORS DLL in the vb editor in order for the DOORSDxl object to be made available to the program. Do this via the Tools -> References menu - think all this really needs to be in a two or three page guide as there are admitedly a fair few places to trip up!

-------------------------
Regards,

Richard Good

Edited: 16-Jul-2007 at 20:22 by Richard Good
Report this to a Moderator Report this to a Moderator
 17-Jul-2007 20:08
User is offline View Users Profile Print this message


David Dawson

Posts: 27
Joined: 11-Mar-2003

Richard,

Thanks immensely for all the help. When its all said and done, my life will be much easier. I suspect my case is similar to that of many other dxl'rs; we aren't hard-core software developers, we're just poor souls who are digging into dxl because its the only way to get what we need out of DOORS.

I've set up all the code modules and can run them in a stand-alone mode to show I have them configured properly. When I put syntax errors into my source, I get the desired formatted output ready for use by PSPad. Of course I'm not actually seeing the output in PSPad yet, because I'm not kicking off the run from there. I have the Highlighter configuration all done except for the Compiler entry. The problem here is that I don't have a compiled copy of your earlier code to point to. I rummaged around and found a copy of Visual studio to compile the code, but am of course failing on the Dim DOORSObj As DoorsDXL statement. I've looked on my box and can find no DOORS.dll. Is this really what I'm looking for, or is there some other file name that works? Curiously enough, if I have DOORS running, I can run the code under the VB that comes with Microsoft Word with that line omitted. Of course that defeats the purpose, since the call isn't coming from PSPad, and therefore the log won't get back there.

Color me

david

-------------------------
You never know where you're going 'til you get there
Report this to a Moderator Report this to a Moderator
 18-Jul-2007 09:57
User is offline View Users Profile Print this message


Richard Good

Posts: 152
Joined: 22-Mar-2005

You need to "Browse" for the following file on the Tools -> References dialog then make sure its ticked. I believe the file has the same name in the various doors versions and I think its mentioned somwhere in the dxl help file.

C:\Program Files\Telelogic\DOORS_8.2\bin\doorsdxl.tlb

My memory was faulty its not actually a dll, so apologies for the slightly bum steer. You do realise that the code I included in my later email is referenced in the vb code above ie its the file "SendErrorsToEditPlus", you have to change the vb code to reflect where you are going to put the file and alter the locations in the file to reflect your own setup, compile the vb code then add the exe to the compiler entry in the highlighter. On reflection I appear to be leaving a few clues on how to put the system together rather than a clear map, but I think you should have enough to go on now!

-------------------------
Regards,

Richard Good

Edited: 18-Jul-2007 at 10:05 by Richard Good
Report this to a Moderator Report this to a Moderator
Telelogic DOORS » General Discussion » Compile DXL in crimson editor

1 2 Next Last unread
Topic Tools Topic Tools
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 0 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.