Viewing contents of file '../idllib/user_contrib/creaso/createct.pro'
; Copyright(c) 1992, CreaSo Creative Software Systems GmbH. All rights reserved.
;	Unauthorized reproduction prohibited.
;+
; NAME:
;	CREATECT
;
; PURPOSE:          
;	Create a new colortable file (IDL version 2.4 and above).
;
; CALLING SEQUENCE:
;	createct, filename, [entries]
;
; INPUTS:
;	filename - The name of the new colortable file.
;	entries  - Number of entries in new table. Optional. Default = 1.
;
; KEYWORDS:
;	None.
;
; OUTPUTS:
;	None.
;
; COMMON BLOCKS:
;	None.
;
; SIDE EFFECTS:
;       A new colortable file is created.
;
; RESTRICTIONS:
;     - Tested on VAX/VMS only.
;
; EXAMPLES:
;
;       Create a new colortable with 20 entries. The 20 entries are all
;       zero by default. No colortable names are create. The entries may
;       be modified and extended with the procedure modifyct.
;
;       IDL> createct, 'mycolor.tbl', 20
;
; MODIFICATION HISTORY:
;	November 1992, HJB, CreaSo		Created.
;-
pro createct, filename, entries

   ;a: Check optional input parameter.

   if (n_elements(entries) eq 0) then entries = 1
   if (entries             lt 1) then entries = 1

   ;a: Create the new colortable file (length per entry = 800 = 3*256+32)

   openw,    lun, filename, /get_lun
   writeu,   lun, byte(entries)
   writeu,   lun, bytarr(800*entries)
   free_lun, lun

end