How to set document type?
How to set document type?
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
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
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...
Thanks again.
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
Re: How to set document type?
One thing to note is by default there is already a COBOL Document Type defined.I'd appreciate a gentle nudge in the right direction.
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
Re: How to set document type?
Thank you, it turns out that it was case sensitive, not insensitive.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)
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.
it turns out that it was case sensitive, not insensitive.

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.
By default Zeus provides no direct way of renaming or deleting files.Just in case you missed my edit.... how do you rename files from within Zeus?
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
There is no way to do this directly, but once again it should be fairly easy to script.One last question, is a search/replace possible across all files in a project or workspace?
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
Here is an example of a script that will search the current open workspace: http://www.zeusedit.com/zforum/viewtopic.php?p=9194Even if not natively, an included script would be nice
Cheers Jussi