\OVERVIEW

 ELF(tm) Extended LISP Function Library (c) Mountain Software

 ELF is a library of nearly 200 new functions for AutoLISP In
 addition, it contains 16 utility and file management commands,
 all contained in a single EXP file.

 ELF gives the AutoLISP programmer a professional programming
 language rivaling  many commercial compiled language  libraries.
 The range  of functions include those for text screen  video and
 window control; popup menus and data entry with a build in  help
 system; sound; keyboard; string manipulation; math;  sorting and
 searching; list handling; file  and directory handling; entity
 creation; and several utility functions.

 Non-programmers  will   also  appreciate   the  mini-applications
 (ELFapps), including  the ELF  notepad; and  the several  utility
 commands.

 In addition, ELF contains ELFDOS, which implements many DOS
 commands within  AutoCAD for filemanagement, a file  and symbol
 browser, and integrated help.


\COMMANDS

  ELF Commands

  cd
     change directories; chdir, dcd
  cls
     clear (erase) the text screen;
  c:
     logs to C: drive (also A:, B: and any other valid drives);
  dcopy
     copy DOS file(s);
  derase
     erase / delete DOS file(s); ddel
  dir
     prints a file directory list; ddir
  drename
     rename / move file(s); dmove
  elf
     displays a list of all ELF commands and functions;
  ff
     find file(s) on the AutoCAD library path and DOS path;
  look
     display ASCII file(s) to the screen using the ELF browser;
  mkdir
     create a directory; md, dmd
  password
     register  ELF  with your  password  (obtain from  Mountain
     Software);
  rmdir
     remove (delete) a directory; rd, drd
  sd
     set default disk drive; dsd
  symbol
     displays the value of an AutoLISP symbol;
  ver
     prints ELF, DOS and AutoCAD version numbers;
  what
     a compact "LIST" command to display entity values;

\VIDEO

  Video Functions

  box
     draws a box  (rectangle) on the text screen  using graphic
     ascii characters.; (box col row ecol erow attr btype)
  cls
     clear text screen to optional color attribute; (cls attr)
  get_video
     get current text screen video parameters; (get_video)
  printf
     formatted  "C"  type  print  to  text  screen or  graphics
     command prompt area; (printf format ...)
  prts
     fast  write  to text  screen  at  col,  row position  with
     optional attribute; (prts col row string attr)
  puts
     fast write to text screen at cursor position with optional
     attribute; (puts string attr)
  restore_screen
     restores    a    previously    captured    text    screen;
     (restore_screen)
  save_screen
     captures  the contents  of  the  text screen  to  a memory
     buffer; (save_screen)
  scr_fill
     fill a rectangle  of the text screen  with a character and
     color attribute; (scr_fill col row cols rows ch attr)
  scr_printf
     formatted "C" type print to text screen using direct video
     buffer write; (scr_printf format ...)
  set_color
     sets the internal  "color" variable for use  by subsequent
     uses of routines  which can use  the default  color (r11);
     (set_color attr)

\CURSOR

 Cursor Functions

  get_cursor
     get cursor size / shape; (get_cursor)
  getxy
     get cursor screen coordinates; (getxy)
  gotoxy
     position the screen cursor; (gotoxy col row)
  set_cursor
     set cursor  size; start  to  end scan  lines;  (set_cursor
     start end)

\WINDOW

 Text Window Functions

  set_menu_help
     sets the user  help string list for  wmenu; (set_menu_help
     <slist>)
  wclose
     closes the  top  window restoring  the  screen  under  the
     window; (wclose)
  wcloseall
     closes all windows; (wcloseall)
  wclreol
     erase from window cursor to end of line; (wclreol)
  wcls
     clear window to optional color attribute; (wcls attr)
  werase_line
     erase a line of text from a window; (werase_line line)
  wgetstr
     open a window centered on the text screen, prints a prompt
     on the top border and gets  string input.; (wgetstr prompt
     default length wattr battr btype)
  wgetdrive
     select  a disk  drive from  a menu,  all valid  drives are
     listed   with    their   respective    drive   type    (eg
     removable/floppy, fixed, network, and redirected devices);
     (wgetdrive col row wattr battr hattr btype)
  wgetfile
     select a  file from a  menu of DOS files  from the current
     directory. The user can change  directories and access all
     available disk  drives.; (wgetfile  filespec fileattr  col
     row wattr battr hattr btype)
  wgetxy
     get window screen position; (wgetxy)
  wgotoxy
     move window cursor; (wgotoxy col row)
  winfo
     gets the top window size and position; (winfo)
  wmenu
     opens a centered window  and displays a menu. The user can
     then select  one of  the  displayed items.;  (wmenu  slist
     wattr battr hattr btype shadow title)
  wmsg
     opens a centered window, displays a message and optionally
     waits for  a keystroke  and closes the  window; (wmsg  str
     wait attr battr btype)
  wopen
     open a window on the text  screen with specified location,
     size,  border,  and  colors;  saving  the  area under  the
     window; (wopen col row cols rows wattr battr btype)
  wpopup
     open a window  centered on the  text screen;  (wpopup cols
     rows wattr battr)
  wprintf
     printf  to  window  at  window  cursor  position; (wprintf
     format ...)
  wprts
     write  to  window  at  col,  row  position  with  optional
     attribute; (wprts col row string attr)
  wputcen
     write a  centered string  to window at  window cursor  row
     position; (wputcen str)
  wputs
     write to window  at window  cursor position with  optional
     attribute; (puts string attr)
  wscroll
     scroll window text; (wscroll dir start end lines)
  wshadow
     adds  a drop  shadow  to  the top  (last  opened)  window;
     (wshadow attr)
  wtitle
     prints on  the border of a  window in one  of 6 positions;
     (wtitle <str> [<pos>])

\KEYBOARD

  Keyboard Functions

  getch
     get a character from the keyboard; (getch)
  getche
     get a character from the keyboard with echo; (getche)
  getkey
     get a keystroke from the keyboard; (getkey)
  kbhit
     checks  the  keyboard  buffer  for  a  waiting  keystroke;
     (kbhit)
  key_clear
     clears the  keyboard  buffer of  any  pending  keystrokes;
     (key_clear)
  key_ready
     returns immediately with a waiting key; (key_ready)
  key_stat
     gets the state of  keyboard shift and other  special keys;
     (key_stat)
  key_stuff
     "pushes" keys into the keyboard buffer; (key_stuff str)


\DISK

 Disk/Directory Functions

  access
     determines if a  file exists and can  be accessed by mode;
     (access path mode)
  chdir
     change disk directory; (chdir path)
  chpath
     change current disk drive and directory; (chpath path)
  disk_ready
     verifies that  a removable  (floppy)  drive is  ready  and
     readable; (disk_ready drive)
  disk_type
     ; (disk_type drive)
  disk_valid
     verifies  that a  disk drive  is a  valid device  (but not
     necessarily   ready    if   a   removable/floppy   drive);
     (disk_valid drive)
  erasefile
     erase file(s); (erasefile filename)
  file_exists
     determines if a file exists; (file_exists path)
  findfirst
     finds  the  first  instance  of  a  file  who's  name  and
     directory  attributes  match  the  arguments.;  (findfirst
     filespec attribute)
  findnext
     finds the next  occurrence of  the file specification  and
     attribute after a findfirst call; (findnext)
  fullpath
     expands  a  partial path  into  a  full  DOS path  string;
     (fullpath path)
  getdir
     returns a string with the current drive:\path; (getdir)
  getdiskfree
     returns size statistics in the specified drive number as a
     list; (getdiskfree 3)
  getdisk
     returns the  current drive  number (A=1,  B=2, C=3,  etc);
     (getdisk)
  load_dirs
     returns a list of strings containing file directories from
     the current directory; (load_dirs)
  load_drives
     returns  a  list  of  strings  containing  all valid  disk
     drives; (load_drives)
  load_files
     returns a  list of  strings  containing files  matching  a
     filespec  and  directory  attribute; (load_files  filespec
     attribute)
  makepath
     Combines  the four components into a full DOS path string;
     (makepath drive dir name ext)
  mkdir
     creates a new directory; (mkdir dirname)
     dirname <string> directory to create
  rmdir
     removes (deletes) a directory; (rmdir dirname)
  setdisk
     logs to the specified disk drive; (setdisk drive)
  splitpath
     splits  a  DOS  path  string  into  its  four  components;
     (splitpath path)
  unlink
     erase file(s); (unlink filename)

\FILE

 File Functions

  copyfile
     copies file(s); (copyfile source destination)
  look
     displays  an  ASCII  file to  screen  using  the ELF  file
     viewer; (look filespec)
  movefile
     moves / renames file(s); (movefile source destination)
  read_file
     reads an  ASCII file and  returns a string  list from file
     records.  Each line  in  the text  file is  parsed  into a
     string  and  appended to  the  returned  list.; (read_file
     filespec mode)
  write_file
     opens an ASCII file and  writes a string list to  the file
     and then  closes the  file. Each  string is placed  in the
     text file as a line of text.; (write_file filespec type)

\BINARY_FILE

  Binary File I/O Functions

  fclose
     closes a binary file; (fclose <handle>)
  feof
     returns nonnil if the  end of file has been reached; (feof
     <handle>
  ferror
     returns nonnil  if OS file error  indicator has been  set;
     (ferror <handle>)
  fgetc
     reads a character (byte) value  from a binary file; (fgetc
     <handle>)
  fgets
     reads a string of up to len characters from a binary file;
     (fgets <handle> <len>)
  fgetsc
     reads a signed character value from a binary file; (fgetsc
     <handle>)
  fgetint
     reads a  short integer (2  byte word) value  from a binary
     file; (fgetint <handle>)
  fgetlong
     reads a  long integer  (4 byte  double word) value  from a
     binary file; (fgetlong <handle>)
  fgetreal
     reads a  real (8  byte  double precision  floating  point)
     value from a binary file; (fgetreal <handle>)
  fopen
     opens a binary file; (fopen <fname><mode>)
  fputc
     writes a  character (byte) value to a  binary file; (fputc
     <handle> <char>)
  fputs
     writes  a  string  to  a   binary  file;  (fputs  <handle>
     <string>)
  fputint
     writes an  integer (2 byte  word) value to  a binary file;
     (fputint <handle> <int>)
  fputlong
     writes  a long  integer (4  byte double  word) value  to a
     binary file; (fputlong <handle> <long>)
  fputreal
     writes a  real (8  byte double  precision floating  point)
     value to a binary file; (fputreal <handle> <real>)
  frewind
     moves the  file pointer  to  the  beginning of  the  file;
     (frewind <handle>)
  fseek
     moves the file pointer; (fseek <handle><origin><offset>)
  ftell
     returns the  current position  of a  binary file  pointer;
     (ftell <handle>)

\MATH

  Math Functions

  |
     returns the  result of a  bitwise OR of  the arguments; (|
   ..)
  ||
     returns the result  of a logical OR  of the arguments; (||
   ..)
  &
     returns the result  of a bitwise AND  of the arguments; (&
   ..)
  &&
     returns the result of  a logical AND of the arguments; (&&
   ..)
  acos
     returns the inverse cosine of the argument; (acos rad)
  asin
     returns the inverse sine of the argument; (asin rad)
  ceil
     returns the  smallest  integer greater  or  equal  to  the
     argument; (ceil rval)
  cosh
     returns the hyperbolic cosine of the argument; (cosh rad)
  dtr
     converts an angle in degrees to radians; (dtr ang)
  floor
     returns the largest integer not greater than the argument;
     (floor rval)
  hibyte
     returns the upper  (most significant) byte of  an integer;
     (hibyte val)
  int2sc
     converts a signed integer into a signed char; (int2sc val)
  lobyte
     returns the lower (least significant)  byte of an integer;
     (lobyte val)
  log10
     returns  the logarithm  to the  base  10 of  the argument;
     (log10 x)
  rand
     generates a pseudo random number; (rand)
  round
     rounds a real value; (round val places)
  rtd
     converts an angle in radians to degrees; (rtd ang)
  sinh
     returns the hyperbolic sine of the argument; (sinh rad)
  srand
     seeds the random number generator; (srand i)
  swapb
     reverses bytes in a (short) integer; (swapb i)
  tan
     returns  the trigonometric tangent  of the  argument; (tan
     rad)
  tanh
     returns the hyperbolic tangent of the argument; (tanh rad)
  xtoi
     converts a hex string to an integer; (xtoi s)

\LIST_HANDLING

  List Handling Functions

  bsearch
     located a value in  a sorted string, integer or real value
     list; (bsearch vlist key)
  delete
     deletes a list  or atom  from another  list; (delete  list
     pos)
  insert
     inserts a list or atom into another list; (insert list pos
     item)
  lfind
     located  a value  in an unsorted  string, integer  or real
     value list; (lfind vlist key)
  lsearch
     located a value  in a string, integer  or real value list;
     (lsearch vlist key)
  qsort
     sorts a string, integer  or real value list; or  a list of
     lists; (qsort lst field)
  replace
     replace a  list or atom  in a list  with another; (replace
     list pos item)
  symbol
     Displays the contents of  a symbol to the screen using the
     ELF file/symbol viewer.; (symbol sym)


\STRING

  String Handling Functions

  field
     returns a substring of str1 from  token delimiters in str2
     and position.; (field str1 str2 pos)
  set_edit_help
     sets the user help  string list for the function (strget);
     (set_edit_help <slist>)
  sprintf
     same as  printf except that nothing is printed, the string
     is returned; (sprintf format ...)
  strchr
     finds  the first  occurrence of  ch in  str and  returns a
     substring starting at that character; (strchr str ch)
  strcmp
     compares  two  strings  for   equality  (case  sensitive);
     (strcmp str1 str2)
  strcspn
     determine the length of  the prefix of str1 made  entirely
     of chars not in str2; (strcspn str1 str2)
  strdate
     returns  the current  date from  the internal  clock as  a
     formatted string; (strdate)
  strdela
     delete  all  occurrences  of  chars  in  str2  from  str1;
     (strdela str1 str2)
  strget
     edit a string on  the text screen with cursor  positioning
     and editing, background mask, color attribute control, and
     on line help.; (strget str len curpos mask attr ...)
  stricmp
     compares  two strings  for  equality  (case  insensitive);
     (stricmp str1 str2)
  strncpy
     copies the first n characters of a string; (strncpy str n)
  strnset
     fills a string; (strnset char len)
  strpbrk
     returns  a  substring  of  the  first  occurrence  of  any
     character of str2 in str1; (strstr str1 str2)
  strrchr
     finds  the last  occurrence  of ch  in str  and  returns a
     substring starting at that character; (strrchr str ch)
  strrev
     returns  the string  argument  with  the  character  order
     reversed; (strrev str)
  strspn
     determine the length of  the prefix of str1  made entirely
     of chars in str2; (strspn str1 str2)
  strstr
     returns a  substring of  the first  occurrence of  str2 in
     str1; (strstr str1 str2)
  strswap
     swaps all occurrences of char1 with char2 in str; (strswap
     str char1 char2)
  strtime
     returns  the current  time from  the internal  clock  as a
     formatted string; (strtime)
  strtok
     returns the first substring of  str1 from token delimiters
     in  str2.  subsequent  calls  after   the  first  with  no
     arguments  will   return  the   second  and   any  further
     substrings; (strtok str1 str2)
  strtrim
     trim  white  space  (all  char  values  <  '!')  from  the
     beginning (left side) and end (right side); and compresses
     white space  within  a string  to a  single space  between
     words; (strtrim str)
  strtriml
     trim  white  space from  the beginning  (left  side)  of a
     string; (strtriml str)
  strtrimr
     trim white  space from the  end (right side)  of a string;
     (strtrimr str)
  tolower
     ; (tolower char)
  toupper
     ; (toupper char)

\CHARACTER

  Character Classification Functions

  isalnum
     returns a non-zero value if argument is a letter or digit;
     (isalnum char)
  isascii
     returns  a  non-zero   value  if  argument  is   an  ASCII
     character; (isascii char)
  iscntl
     returns  a  non-zero  value  if   argument  is  a  control
     character; (iscntl char)
  isdigit
     returns a  non-zero value if argument  is a numeric digit;
     (isdigit char)
  isgraph
     returns  a  non-zero  value  if   argument  is  a  visible
     printable character; (isgraph char)
  islower
     returns  a  non-zero value  if argument  is  a  lower case
     letter; (islower char)
  isodigit
     returns a non-zero value if argument is an octal digit (0-
     7); (isodigit char)
  isprint
     returns  a  non-zero  value  if  argument  is a  printable
     character; (isprint char)
  ispunct
     returns a  non-zero value  if  argument is  a  punctuation
     character; (ispunct char)
  isspace
     returns a  non-zero value  if  argument is  a  white-space
     character (space, tab, newline, etc); (isspace char)
  isupper
     returns a  non-zero  value if  argument is  an upper  case
     letter; (isupper char)
  isxdigit
     returns a  non-zero value  if  argument is  a  hexadecimal
     digit (0-F); (isxdigit char)

\ENTITY

  Entity Creation

  arc
     create an arc entity; (arc cen rad sang eang layer)
  circle
     create a circle entity; (circle cen rad layer)
  grid
     create  a  grid  of line  entities;  (grid  pnt cols  rows
     colwidth rowheight layer)
  line
     create a line entity; (line from to layer)
  point
     create a point entity; (point pt layer)
  pline
     create a polyline entity; (pline vlist layer width flags)
  rect
     create a polygon  rectangle entity; (rect pt  width height
     layer)
  solid
     create a solid entity; (solid pt1 pt2 pt3 pt4 layer)
  text
     create a  text entity; (text  pt str height  layer rot obl
     flg hal val apt)

\SELECTION_SET

  Selection Set Functions

  ss_filter
     filters a selection set removing all entities except those
     in a list of entity types; (ss_filter ss slist)
  ss_move
     uses the AutoCAD dragger to move a selection set; (ss_move
     ss pt)
  ss_rotate
     uses  the  AutoCAD  dragger  to  rotate  a selection  set;
     (ss_rotate ss pt)
  ss_scale
     uses  the  AutoCAD  dragger  to  scale  a  selection  set;
     (ss_scale ss pt)
  ss_union
     merges all entities in two selection sets into a new third
     selection set; (ss_union ss1 ss2)
  ss_inters
     merges  all entities  common to two selection  sets into a
     new third selection set; (ss_inters ss1 ss2)
  ss_diff
     creates a new selection from two selection sets by copying
     the  first and removing entities found  in the second from
     the new selection set.; (ss_diff ss1 ss2)
  ss_xform
     transform   entities   in   a   selection   set  using   a
     transformation matrix; (ss_xform ss mat)

\MISC
\UTILITY

  Utility / Miscellaneous Functions

  adsdump
     prints the  data  type and  value of  an AutoLISP  symbol;
     (adsdump sym)
  beep
     sound a beep on  the PC speaker for optional frequency and
     duration; (beep freq duration)
  clock
     reads the current internal clock; (clock)
  exit
     cancels  execution and  returns  to the  Command:  prompt;
     (exit)
  getver
     returns  the  ELF,   AutoCAD,  and  DOS  version  numbers;
     (getver)
  last_error
     returns the last internal error message; (last_error)
  initialize
     resets ELF and loads ELF.INI symbols; (initialize)
  nosound
     turns off the PC speaker after a sound function; (nosound)
  pause_key
     prints "press  any key  to continue..."  and  waits for  a
     keystroke; (pause_key)
  sound
     turns on  the PC  speaker at  a specified tone  frequency;
     (sound freq)
  system
     executes a DOS command; (system cmd)
  wait
     suspend execution for a specified time duration; (wait ti)

\SYMBOLS

  Symbols (r12 only)

  *last_error*
     the last error message string
  color
     default color attribute
  edit_help
     string  list  with  user  defined  help  for the  (strget)
     function
  error_mode
     controls ELF error message display; 1=display  errors,0=no
     message
  menu_help
     string  list  with  user  defined  help  for  the  (wmenu)
     function

\DATA_TYPES
\PARAMETERS

  Function Parameters and data types

  <string>  string parameter
  <char>    char parameter (passed as either an integer or string)
  <int>     integer parameter
  <...>     variable number of additional parameters
  <item>    AutoLISP list or atom
  <list>    AutoLISP list parameter
  <slist>   AutoLISP string list parameter (\"AAA\" \"BBB\")
  <dlist>   AutoLISP dotted pair string list ((0 \"AAA\") (1 \"BBB\"))
  <fspec>   DOS filespec string
  <handle>  integer ELF internal file handle
  []        square brackets indicate an optional parameter

[ ELF ] Copyright 1992-95 - Mountain Software, all rights reserved

