How to set document type?

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
justpaul
Posts: 6
Joined: Mon Aug 29, 2011 12:17 pm

How to set document type?

Post by justpaul »

Hi

I am starting to learn Cobol and have created a new workspace and added a .cob file. I have changed the colour scheme in the Cobol document type so it should be obvious when Zeus knows it's working with a file, but neither the colour scheme changes or keywords are highlighted in the file I open.

I'd appreciate a gentle nudge in the right direction.

Thanks

Paul
justpaul
Posts: 6
Joined: Mon Aug 29, 2011 12:17 pm

Post by justpaul »

Just to update, it works with C++, but not Cobol. XPx64 and Win 7 x64.

Here's a bit of the sample Cobol code I am working with if anyone wants to try to get the Document Type recognised...

Code: Select all

      $ SET SOURCEFORMAT"FREE"
IDENTIFICATION DIVISION.
PROGRAM-ID.  AcceptAndDisplay.
AUTHOR.  Michael Coughlan.
* Uses the ACCEPT and DISPLAY verbs to accept a student record
* from the user and display some of the fields.  Also shows how
* the ACCEPT may be used to get the system date and time.

* The YYYYMMDD in "ACCEPT  CurrentDate FROM DATE YYYYMMDD."
* is a format command that ensures that the date contains a
* 4 digit year.  If not used, the year supplied by the system will
* only contain two digits which may cause a problem in the year 2000.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 StudentDetails.
   02  StudentId       PIC 9(7).
   02  StudentName.
       03 Surname      PIC X(8).
       03 Initials     PIC XX.
   02  CourseCode      PIC X(4).
   02  Gender          PIC X.

* YYMMDD
01 CurrentDate.
   02  CurrentYear     PIC 9(4).
   02  CurrentMonth    PIC 99.
   02  CurrentDay      PIC 99.

* YYDDD
01 DayOfYear.
   02  FILLER          PIC 9(4).
   02  YearDay         PIC 9(3).


* HHMMSSss   s = S/100
01 CurrentTime.
   02  CurrentHour     PIC 99.
   02  CurrentMinute   PIC 99.
   02  FILLER          PIC 9(4).


PROCEDURE DIVISION.
Begin.
    DISPLAY "Enter student details using template below".
    DISPLAY "Enter - ID,Surname,Initials,CourseCode,Gender"
    DISPLAY "SSSSSSSNNNNNNNNIICCCCG".
    ACCEPT  StudentDetails.
    ACCEPT  CurrentDate FROM DATE YYYYMMDD.
    ACCEPT  DayOfYear FROM DAY YYYYDDD.
    ACCEPT  CurrentTime FROM TIME.
    DISPLAY "Name is ", Initials SPACE Surname.
    DISPLAY "Date is " CurrentDay SPACE CurrentMonth SPACE CurrentYear.
    DISPLAY "Today is day " YearDay " of the year".
    DISPLAY "The time is " CurrentHour ":" CurrentMinute.
    STOP RUN.

      Student
Thanks again.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: How to set document type?

Post by jussij »

I'd appreciate a gentle nudge in the right direction.
One thing to note is by default there is already a COBOL Document Type defined.

So if you created a new one, Zeus might still be using the original one.

To see/edit/delete the document types just use the Options, Document Types menu.

The way it all works is in the General section of the Document Type there is an Extensions field.

Any file with one of these extensions will use that document type (the case insensitive).

One way to check the document type is to start by opening a COBOL file and then use the Options, Properties menu.

This menu will find and edit the Document Type for the currently active file extension.

Cheers Jussi
justpaul
Posts: 6
Joined: Mon Aug 29, 2011 12:17 pm

Re: How to set document type?

Post by justpaul »

jussij wrote: The way it all works is in the General section of the Document Type there is an Extensions field.

Any file with one of these extensions will use that document type (the case insensitive)
Thank you, it turns out that it was case sensitive, not insensitive.

I changed....
COB;CBL;
... to...
COB;CBL;cob;cbl;

and it now works!

Funny, because I have (after it not working) changed xfolder.ini to add lowercase too. Working now in XP64 and Win7x64.

Thanks very much for the nudge. :)

edit: sorry, but how do you rename files from within Zeus?
Last edited by justpaul on Tue Aug 30, 2011 12:30 am, edited 1 time in total.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

it turns out that it was case sensitive, not insensitive.
:oops:

This looks like a bug :(

Thanks for the feedback.

Cheers Jussi
Last edited by jussij on Tue Aug 30, 2011 12:58 am, edited 1 time in total.
justpaul
Posts: 6
Joined: Mon Aug 29, 2011 12:17 pm

Post by justpaul »

No problem, I have a very annoying habit of breaking things within seconds of using them. :)

Just in case you missed my edit.... how do you rename files from within Zeus?
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Just in case you missed my edit.... how do you rename files from within Zeus?
By default Zeus provides no direct way of renaming or deleting files.

But since Zeus is fully scriptable, it is fairly easy to implement these types of commands by just create a macro script and then binding that macro to the keyboard and/or the menu.

There are many examples of Zeus scripts in the zScript install folder.

More scripting example can also be found here: http://www.zeusedit.com/zforum/viewforum.php?f=10

Cheers Jussi
justpaul
Posts: 6
Joined: Mon Aug 29, 2011 12:17 pm

Post by justpaul »

Thanks, that is awesome functionality.

One last question, is a search/replace possible across all files in a project or workspace?
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

One last question, is a search/replace possible across all files in a project or workspace?
There is no way to do this directly, but once again it should be fairly easy to script.

For example there is a way to get a list of all the projects and files in the current workspace.

To see what I mean just open a workspace and run this macro: C:\Program Files\Zeus\zScript\projects.lua

Using these details all you need is call to the user_input macro function to get the find/replace details and then some Python or Lua code to do the actual file find and replace and you are done ;)

Cheers Jussi
justpaul
Posts: 6
Joined: Mon Aug 29, 2011 12:17 pm

Post by justpaul »

Thanks again for the reply. I can see the safety/security reasoning behind not implenting rename/delete but I think having native search/replace options for across a project or workspace is something that you should look at implementing.

Even if not natively, an included script would be nice. ;)
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Even if not natively, an included script would be nice
Here is an example of a script that will search the current open workspace: http://www.zeusedit.com/zforum/viewtopic.php?p=9194

Cheers Jussi
Post Reply