call_draw(3f) - [M_drawplus] Given a string representing a M_draw procedure and parameters call the routine (LICENSE:MIT)
Synopsis
Description
Options
Returned
Example
Author
License
subroutine call_draw(verb,parameters,found)
character(len=*),intent(in) :: verb character(len=*),intent(in) :: parameters logical,intent(out) :: found
Used to allow input files to directly call arbitrary low-level graphics procedures. This is a simple interpreter for M_graph(3fm) routines.
verb name of M_draw(3fm) routine to call parameters string representing options to pass to the routine specified by the verb. Numeric values are evaluated using the M_calc(3fm) module to allow expressions.
found returns .TRUE. if the verb was found, otherwise .FALSE.
Simple Example
program demo_call_draw use M_drawplus, only : call_draw use M_io, only : read_line implicit none character(len=:),allocatable :: line logical :: found integer :: iend INFINITE: do while (read_line(line)==0) line=adjustl(line) iend=scan(line, #;)-1 if(iend.le.0)iend=len_trim(line) if(iend.ne.0)then line=line// call call_draw(line(:iend),line(iend+2:),found) if(.not.found)then write(*,*)ERROR: ,line(:iend),[,line(iend+1:),], not found endif endif enddo INFINITE end program demo_call_drawSample
demo_call_draw <<eof prefsize 400 400 vinit X11 circleprecision 100 color 1 circle 0 0 A=1.0 color 2 circle 0 0 A=A-.1 color 3 circle 0 0 A=A-.1 color 4 circle 0 0 A=A-.1 color 5 circle 0 0 A=A-.1 color 6 circle 0 0 A=A-.1 color 7 getkey LET vexit eof
John S. Urban
MIT License
Nemo Release 3.1 | call_draw (3) | February 23, 2025 |