home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Science
/
Science.zip
/
splot184.zip
/
splot.hlp
< prev
next >
Wrap
Text File
|
1997-03-10
|
118KB
|
3,484 lines
<Product Info>
This is an integrated editor, C subset interpreter,
and scientific graphics program.
THIS PROGRAM WAS WRITTEN BY THOMAS W. STEINER
COPYRIGHT 1992 - 1997, ALL RIGHTS RESERVED
THERE IS NO WARRANTY OF ANY KIND. USE AT YOUR OWN RISK.
THIS IS NOT FREEWARE. TO REGISTER YOUR COPY SEND \$50 TO
T.W. Steiner
2246 E. 6th Ave.
Vancouver, BC, V5N - 1R1
Canada
e-mail steiner@sfu.ca or
tsteiner@creo.bc.ca
Registered users will be able to download
upgrades as they become available.
<Help>
Select each menu item in the help menu to get an
overview of the program capabilities. Some important
user interface details that go beyond the standard
are discussed in the menu help item.
<Cursor Motion>
The cursor may be moved around with the following keys:
#4 -- left one space
#6 -- right one space
#8 -- up one line
#2 -- down one line
#1 -- end of line
#7 -- beginning of line
#3 -- scroll down one screen
#9 -- scroll up one screen
#T -- left one word
#V -- right one word
#X -- up five lines
#R -- down five lines
#Q -- end of file
#W -- beginning of file
#S -- end of file
#Y -- beginning of file
#q -- end of page
#w -- top of page
#s -- down half a page
#y -- up half a page
<Mouse>
The mouse may be used to position the cursor as an
alternative to using the keyboard. Click on the
desired text location. The text may be scrolled using
the scroll bars at the sides.
All three mouse buttons are used to mark regions of
text by dragging. The marking mode button assignments
are made in the editor configuration menu.
Double clicking on a word in a regular file causes
the editor to search for this word in an *.ndx file
and if found there starts up the info viewer. This is
useful in conjunction with function reference material
from compiler vendors. The path to *.ndx files is
specified in the editor configuration menu. Once set
up this enables context sensitive help on any
recognized word in the text.
Double clicking on a word in an "editsys.tmp" file causes
the editor to interpret that word as a file name and
loads that file. Integer numbers after the name if any
are interpreted as the line and column numbers
respectively. This is very convenient with the output
from a compiler invoked from the command line since the
output is added to the editor ring as a read only file.
<Menus>
The menus function in a somewhat non-standard way.
The standard ALT f file menu access has not been
implemented since these keys are used for direct
accelerators. However key board menu access is still
possible by using the ALT key by itself if this is
enabled in the editor configuration.
To get help on any menu item click on it using the
right rather than the left mouse button. This does
not work under versions of WNT previous to 4.0.
Almost every menu item has an associated accelerator
which may be mapped to any other key or keys. Note
that if the keys are re-mapped this mapping will
appear in the menus.
Since there are so many accelerator key definitions
the accelerators are case sensitive so look
carefully.
<Quit>
Exits from the currently displayed file. The next
file in the ring is displayed provided one exits. If
no other files are loaded the editor itself quits.
The number of loaded files is reported in the title
bar along with the current file name. If the file has
been modified a confirm dialog will be shown. To exit
from all the files and terminate the editor use the
"close" (or Alt F4) from the system menu.
The default accelerator is Ctrl q mapped to ^Q
<Save>
The editor writes the currently displayed file to
disk using the current name and path. If a newer file
of the same name exist then a confirm dialog will be
displayed. Before over writing a file with the same name
the editor will rename the previous file to
'editfile.bak'. Thus one previous version will always be
on the disk in case a file was accidentally written. The
next write of any file however will create a new
'editfile.bak'
The default accelerator is Ctrl w mapped to ^W
<Save As...>
The editor saves the currently displayed file to disk
using the specified name and path. A standard file
dialog is opened so that a filename can be typed or
chosen.
The default accelerator is Ctrl W mapped to ^w
<Save All Changed>
All files loaded that have had changes made to them
are saved to disk.
The default accelerator is Ctrl A mapped to ^a
<Open...>
A standard file dialog is displayed which allows
selection of a file to be edited. A wild card '*' in
the name will load all matching files. Files may also
be loaded from the command line by typing
'^[ e yourfile.name ^M'.
The default accelerator is Ctrl O mapped to ^o
<Next>
The next file in the ring of loaded files is displayed.
The default accelerator is Ctrl n mapped to ^N
<Prev>
The previous file in the ring of loaded files is
displayed.
The default accelerator is Ctrl p mapped to ^P
<Other...>
Opens a list box dialog which displays a list of all
the files currently loaded. A file to be displayed
may be selected by double clicking on the chosen
filename. Changed files have the word changed
appended to the file name.
The default accelerator is Ctrl H mapped to ^h
<Config...>
Opens the editor configuration notebook. Many editor
preferences such as the colours may be set. The
results are saved in the ASCII file editor.cfg so
that the next time the editor starts it will use the
selected configuration. If multiple editor instances
are started only the first one will write the
editor.cfg file.
The default accelerator is Ctrl C mapped to ^c
<Cmd...>
Opens a command line dialog. Commands to the
operating system as well as editor command line
commands may be entered. The list box displays a
history of the recently used command line commands
for reuse by double clicking on them. Command line
commands may also be entered without opening this
dialog by hitting the ^[ key. The editor command line
commands are as follows:
The default accelerator is Ctrl M mapped to ^m
Command Line Operations
^[ goto or leave command line
Change current line.
number goto line number n
+number down n lines
-number up n lines
Change current column offset.
@number start at column n
@+number scroll left n columns
@-number scroll right n columns
Search and Replace.
/str1[/-bclrw]
find string str (/ may instead be other punct)
c/str1/str2[/-bclrw] replace str1 with str2
The optional search suffixes are
/- search up (down is the default)
/b search marked block only
/c ignore case
/l loop through all loaded files
/r interpret as regular expression
/w match whole words only
For regular expressions the following symbols have
special meaning:
^ start of line
\$ end of line
. any character
\\ literal next character
+ match one or more times
* match zero or more times
[aei0-9] match a,e,i and 0 through 9
[\^aei0-9] match anything but a,e,i and 0 through 9
( ) sub expression
a(ab)*b matches ab aabb aababb aabababb etc.
loading additional files to edit
e name1,name2,...[-brfl]
edit name1,name2,...[-brfl]
The optional edit suffixes are
-b binary mode
-r read only
-f num first line is line number num (-r implied)
-l num last line is line number num (-r implied)
cfg or configure show and modify editor config
quit exit without saving changes
m [name] or insert named file at cur location
merge [name]
r [name] or rename current file to name
rename [name]
d [name] or diff between current and named file
diff [name] diff between current and named file
up arrow previous command line entered
down arrow next command line entered
fill [string] fill B marked block with string
sort [col] sort lines using field col as key
hex [num] or hex 'c' convert decimal num or char to hex
dec [num] or dec 'c' convert hex num or char to decimal
asc [num] convert hex or dec number to char
g [regexp] or passed to OS but regexp becomes
grep [regexp] new search string
cd [y:\path] set default drive and path
os [command] send command to operating system
[command] sent to operating system
The results of the above operating system calls will
end up in a temp file in the ring of files. There is
a difference between the above two methods. When a
command is prefixed by "os" the command runs
synchronously i.e. the editor is blocked until the os
command completes. If the "os" prefix is absent the
system call runs in back ground. This is useful for
compiling code or doing long searches in background
for example.
Lastly, any string that is sent to the operating system
will first have any occurrence of \$EDNAME translated to
the current filename. In this way a generic macro that
does an os call may be built.
<Delete Character>
Deletes the character under the cursor.
The default accelerator is Ctrl d mapped to ^D
<Delete Prev Char>
Deletes the character to the left of the cursor. If
the cursor is at the start of a line it will join the
current line to the previous line.
The default accelerator is Backspace mapped to ^H
<Delete Word>
Deletes all characters under and to the right of the
cursor up to the next space or punctuation.
The default accelerator is Ctrl z mapped to ^Z
<Delete to Line end>
Deletes all characters under and to the right of the
cursor up to the end of the line.
The default accelerator is Ctrl e mapped to ^E
<Delete Line>
Deletes the entire current line.
The default accelerator is Ctrl Back mapped to ^?
<Insert New Line>
The behaviour of this command is dependent on the
'conventional return' configuration setting. If
conventional return is on then the current line is
split at the cursor and the remainder is put on the
next line. If however, conventional return is not
enabled then this command inserts a blank line below
the current line leaving the current line intact.
This behaviour is compatible with the 'e' series of
editors.
The default accelerator is Enter mapped to ^M
<Change Char Case>
Changes the case of the character under the cursor.
The default accelerator is Ctrl c mapped to ^C
<Swap two Chars>
Swaps the character under the cursor with the one
to the right of the cursor.
The default accelerator is Ctrl s mapped to ^S
<Insert Ctrl Char>
This command starts a dialog for entering the 3 digit
ASCII code of a character to be inserted in the text.
This is useful for inputing characters without a key
board key.
The default accelerator is Alt x mapped to %X
<Insert Literal Char>
This is only active if key mapping is turned on in
the editor configuration menu. If it is turned on
then this command will for the next key stroke
disable the translation so that the original
functionality may be accessed.
The default accelerator is Alt k mapped to %K
<Cut Line at Cursor>
This command splits the current line at the cursor
putting the remainder of current line on the next
line. Similar to Insert New Line if conventional
return is enabled. Used to split lines if
conventional return is not enabled.
The default accelerator is Ctrl k mapped to ^K
<Join two Lines>
This command joins the next line to the end of the
current line.
The default accelerator is Ctrl j mapped to ^J
<Toggle Ins/Del>
This command toggles the character insertion mode
between insertion and replacement. The current status
is reported on the right end of the status line.
The default accelerator is Ctrl t mapped to ^T
<Undo>
The last changes to a line or block of lines are
restored. The number of undo levels are essentially
unlimited but can be optionally disabled in the editor
configuration menu.
The default accelerator is Ctrl u mapped to ^U
<Redo>
Steps undone with the undo command can be redone with
this command.
The default accelerator is Ctrl r mapped to ^R
<Restore Current Line>
If the undo record for the current line is of the
line change type then the line can be restored to its
previous state using this command. The difference
between this command and undo is that this command
can restore a line in some cases without having to
undo changes made after the current line was
modified.
The default accelerator is Alt q mapped to %Q
<Reflow Paragraph>
This command has two different modes of operation. If
syntax colouring is not on then this command
reformats a paragraph of text using the margins and
indentation specified in the editor configuration
notebook. The reformatting starts at the current line
and ends at the first blank line. Alternatively a
block mark may be set to specify the margins and text
to reflow.
If syntax colouring is on then it is assumed that the
text is C code and it is reformatted with smart
indentation At this point the rules are not
configurable and may not suit everyone's taste.
The default accelerator is Alt r mapped to %R
<Reflow Code>
This command has two different modes of operation. If
syntax colouring is not on then this command
reformats a paragraph of text using the margins and
indentation specified in the editor configuration
notebook. The reformatting starts at the current line
and ends at the first blank line. Alternatively a
block mark may be set to specify the margins and text
to reflow.
If syntax colouring is on then it is assumed that the
text is C code and it is reformatted with smart
indentation At this point the rules are not
configurable and may not suit everyone's taste. This
feature is also not yet complete.
The default accelerator is Alt r mapped to %R
<Reflow Block>
This command has two different modes of operation. If
syntax colouring is not on then this command
reformats a paragraph of text using the margins and
indentation specified in the editor configuration
notebook. The reformatting starts at the current line
and ends at the first blank line. Alternatively a
block mark may be set to specify the margins and text
to reflow.
If syntax colouring is on then it is assumed that the
text is C code and it is reformatted with smart
indentation At this point the rules are not
configurable and may not suit everyone's taste. This
feature is also not yet complete.
The default accelerator is Alt r mapped to %R
<First Column Lines>
This command folds up the current file so that only
those lines starting in the first column are visible.
This is useful for rapidly locating functions in a
file. If the file is already folded then this command
unfolds the file around the line current line.
The default accelerator is Ctrl v mapped to ^V
<Lines with Search String>
This command folds up the current file so that only
those lines containing the last used search string
are visible. If the file is already folded then this
command unfolds the file around the line current
line.
The default accelerator is Alt s mapped to %S
<Changed Lines>
This command folds up the current file so that only
those lines which have been modified since the last
save are visible. If the file is already folded then
this command unfolds the file around the line current
line.
The default accelerator is Alt v mapped to %V
<Lines with Placemark>
This command folds up the current file so that only
those lines which contain a placemark are visible. If
the file is already folded then this command unfolds
the file around the line current line.
The default accelerator is Alt h mapped to %H
<Tagged Foldup>
This command folds up the current file so that the
lines between the numerically greatest remaining fold
tag and the next fold tag are hidden. The fold tag is
a regular expression set in the editor configuration
dialog and should be picked to be a comment in the
language in use. For example the default regular
fold tag expression is //[ ]*L[0-9]+ which is a comment
in C++. This will match // L1 and // L21 for example.
The number represents the fold level.
Tagged foldup is the only folding mode that requires
special entries in the file. However, a file written
with folding in mind can make use of these tags to
selectively hide details to present an overview.
The default accelerator is Alt - mapped to %-
<Tagged Unfold>
Unfolds previously folded text by one level if folded
by tagged foldup. If folded in another mode the file
is completely unfolded. The file is unfolded around the
current line.
The default accelerator is Alt + mapped to %+
<Tabbed Foldup>
This command folds up the current file so that the
most indented text which remains visible is hidden.
This provides a means of hiding the details of a
large switch() for example to get an overview.
The default accelerator is Ctrl - mapped to ^-
<Tabbed Unfold>
Unfolds previously folded text by one level if folded
by tabbed foldup. If folded in another mode the file
is completely unfolded. The file is unfolded around the
current line.
The default accelerator is Ctrl + mapped to ^+
<Split Screen>
The screen is split into an upper and lower half each
of which can show the same or a different file. If the
screen is already split then it is un split.
The default accelerator is Ctrl y mapped to ^Y
<Unsplit Screen>
The screen is split into an upper and lower half each
of which can show the same or a different file. If the
screen is already split then it is un split.
The default accelerator is Ctrl y mapped to ^Y
<Other Split Half>
This command is only active if the screen is split in
which case it moves the cursor to the other split half.
It is also possible to click with the mouse to select
the other half.
The default accelerator is Ctrl o mapped to ^O.
<Alternate Binary Rep>
If the file being edited is a binary file then this
command switches from the hex representation to a text
and control key representation.
The default accelerator is Alt a mapped to %A.
<Hex Binary Rep>
If the file being edited is a binary file then this
command switches from the hex representation to a text
and control key representation.
The default accelerator is Alt a mapped to %A.
<Normal Mark>
This is the industry standard mode of text marking which
is of more use with standard text than with program code.
Use this command to mark the start and end of a region. A
region may start in the middle of a line extend over
several lines and end in the middle of a line.
The default accelerator is Alt n mapped to %N.
<Unmark>
Unmark any text marked in any one of the three marking
modes.
The default accelerator is Alt u mapped to %U.
<Delete Region>
This deletes a region marked in any one of the three
marking modes.
The default accelerator is Alt d mapped to %D.
<Move Region>
This moves a region marked in any one of the three
marking modes to the location in the same or different
file specified by the current cursor location.
The default accelerator is Alt m mapped to %M.
<Copy Region>
This copies a region marked in any one of the three
marking modes to the location in the same or different
file specified by the current cursor location.
The default accelerator is Alt c mapped to %C.
<Yank Back Last Del>
The last region deleted can be restored once or many
times using this command. The last deleted text is
inserted at the current cursor location in the same
or different file. Note that the text may be brought
back in any location so that this provides a means
of moving text in a method conceptually similar to
using a clip board.
The default accelerator is Alt y mapped to %Y.
<Write Region>
The currently marked region is written to a temp
disk file with name 'editblck.tmp' in the current
directory.
The default accelerator is Alt w mapped to %W.
<Mark Lines>
This is the preferred marking mode for program
text. Only whole lines are marked and line marked
text when inserted on a copy does not split the
current line as in normal marked case but inserts
the marked lines below the current line.
The default accelerator is Alt l mapped to %L.
<Justify>
This command left adjusts the current line with the
first non-blank line above and then moves the cursor
down to the next line. As a special case if the last
operation was a marked region move or copy then the
whole block is shifted left or right as necessary
to left adjust the first line.
The default accelerator is Alt j mapped to %J.
<Mark Rect Block>
This command is used to mark a rectangular block
for column manipulations.
The default accelerator is Alt b mapped to %B.
<Fill Rect>
A previously marked rectangle may be filled with
a single character. To fill with a word use the
command line command 'fill xyz'. Alternatively,
this command may be used to change the case of
all the characters in the marked block. Lastly,
this command may be used to fill with a sequence
of incrementing or decrementing numbers starting
with the number found at the top of the block
marked region region.
The default accelerator is Alt f mapped to %F.
<Overlay Rect>
The block marked region is used to overwrite a
same sized region the top left corner of which
is specified by the current cursor location.
The default accelerator is Alt o mapped to %O.
<Move Rect Left>
A block marked region may be moved to the left
by one space with this command. The contents of
the column to the left of the block is deleted.
The text to the right of the marked block moves
with the text. This command is useful for adjusting
the indentation of a section.
The default accelerator is Alt Left mapped to #t.
<Move Rect Right>
A block marked region may be moved to the right
by one space with this command. The text to the
right of the marked block moves with the text.
This command is useful for adjusting the indentation
of a section.
The default accelerator is Alt Right mapped to #v.
A block marked region may be shifted to the left
by one space with this command. The contents of
the left most column of the block is deleted and
the width of the block shrunk by one
The text to the right of the marked block moves
with the text. This command is useful for adjusting
the indentation of a section.
The default accelerator is Alt Left mapped to #t.
<Move Rect Up>
A block marked region may be moved up by one line
with this command. The contents of the line above
the block is split to accommodate the block.
The default accelerator is Alt Up mapped to #x.
<Move Rect Down>
A block marked region may be moved down by one line
with this command. The contents of the line below
the block is split to accommodate the block.
The default accelerator is Alt Down mapped to #x.
<Shift Rect Left>
A block marked region may be shifted to the left
by one space with this command. The left most column
of the block is deleted and the marked region's width
is reduced by one provided the width of the column is
wider than one. If not the block width stays at one and
a new column is shifted in from the right. Text to the
right of the marked block shift with the text in the
block. This command is useful for adjusting
the indentation of a section.
The default accelerator is Ctrl ^ mapped to ^^.
<Shift Rect Right>
The text in block marked region may be shifted to the
right by one space with this command. The right most
column of the block is filled with spaces Text to the
right of the marked block shift with the text in the
block. This command is useful for adjusting
the indentation of a section.
The default accelerator is Ctrl _ mapped to ^_.
<Copy to Clipboard>
This command copies a region marked in any one of the
three marking modes to the system clip board.
The default accelerator is Ctrl ins mapped to #P.
<Paste from Clipbrd>
This inserts lines of text from the system clipboard
below the current line.
The default accelerator is Shift Ins mapped to #a.
<Copy to Clip and Del>
This command copies and deleted a region marked in any
one of the three marking modes to the system clip board.
The default accelerator is Shift Del mapped to #d.
<Set Placemark>
This command sets a placemark on the current line if
there is not already a placemark otherwise it removes
the place mark.
The default accelerator is Ctrl a mapped to ^A.
<Clear Placemark>
This command sets a placemark on the current line if
there is not already a placemark otherwise it removes
the place mark.
The default accelerator is Ctrl a mapped to ^A.
<Goto Last Place>
This command moves the cursor to the next location
marked by a previously set placemark.
The default accelerator is Ctrl l mapped to ^L.
<Clear Placemarks>
This command clears all previously set placemarks.
The default accelerator is Alt i mapped to %I.
<Goto Last Pos>
This command returns the cursor to the line it was on
previously. This command is useful in case the cursor
was accidentally removed from the region of interest
with an unintended search for example.
The default accelerator is Alt p mapped to %P.
<Match Bracket>
This command moves the cursor to the location matching
the bracket or comment start underneath the cursor.
Note that the cursor must currently be positioned on a
bracket or comment delimiter.
The default accelerator is Ctrl b mapped to ^B.
<Goto Line Num>
This command opens a dialog for entering the line number
of the desired current line. There is also a command
line equivalent which is:
^[ nnn Enter
<Start Macro Learn>
This command starts or ends the recording of keystrokes
for a macro. At the end of macro recording it may be
optionally bound to a function key for preservation
between editing sessions. Otherwise it will be stored
for re-execution with the Exec Last Macro command until
the end of the current editing session unless over
written by another recorded macro.
Macros can be used together with command multiplication
to carry out repetitive complex editing tasks.
The default accelerator is Alt t mapped to %T.
<Stop Macro Learn>
This command starts or ends the recording of keystrokes
for a macro. At the end of macro recording it may be
optionally bound to a function key for preservation
between editing sessions. Otherwise it will be stored
for re-execution with the Exec Last Macro command until
the end of the current editing session unless over
written by another recorded macro.
Macros can be used together with command multiplication
to carry out repetitive complex editing tasks.
The default accelerator is Alt t mapped to %T.
<Exec Last Macro>
This command executes the last recorded macro. Bound
macros are executed by hitting the corresponding
function key.
The default accelerator is Alt e mapped to %E.
<Zero Cmnd Mult>
This command is used re set a previously entered
command multiplier to zero,
The default accelerator is Alt z mapped to %Z.
<Cmnd Multiplier>
This command opens a dialog to enter a command
multiplier. Command multiplication is very useful in
conjunction with recorded macros for executing complex
repetitive editing tasks. The default accelerators are:
Alt 0 to Alt 9 mapped to %0 to %9.
<Find...>
This command opens the search dialog used to enter the
search string and search options. Search options are:
search up (down is the default)
search marked block only
ignore case
loop through all loaded files
interpret as regular expression
match whole words only
For regular expressions the following symbols have
special meaning:
^ start of line
\$ end of line
. any character
\\ literal next character
+ match one or more times
* match zero or more times
[aei0-9] match a,e,i and 0 through 9
[\^aei0-9] match anything but a,e,i and 0 through 9
( ) sub expression
a(ab)*b matches ab aabb aababb aabababb etc.
The default accelerator is CTRL S mapped to ^s.
<Replace...>
This command opens the search and replace dialog used to
enter the search and replace strings as well as the
search options. Search options are:
search up (down is the default)
search marked block only
ignore case
loop through all loaded files
interpret as regular expression
match whole words only
For regular expressions the following symbols have
special meaning:
^ start of line
\$ end of line
. any character
\\ literal next character
+ match one or more times
* match zero or more times
[aei0-9] match a,e,i and 0 through 9
[\^aei0-9] match anything but a,e,i and 0 through 9
( ) sub expression
a(ab)*b matches ab aabb aababb aabababb etc.
The default accelerator is CTRL R mapped to ^r.
<Find Next>
This command uses the last set search string and option
to find the next match.
The default accelerator is CTRL f mapped to ^F.
<Reverse and Find>
This command uses the last set search string and option
to find the next match after toggling the current
search direction
The default accelerator is CTRL F mapped to ^f.
<Find Next Cur Word>
This command uses the word under the cursor as the
temporary search string and finds the next such match.
The default accelerator is Alt * mapped to %*.
<Find Prev Cur Word>
This command uses the word under the cursor as the
temporary search string and finds the previous such
match.
The default accelerator is Alt / mapped to %/.
<Margins>
The entry fields in this dialog are used to set the text
margins. The left, right and indent values are used by
the reflow (edit menu) command to reformat a paragraph if
the editor is in text mode (syntax colouring not on). If
right justify is on then the reflow command will also
introduce spaces in the line so that the right margin
lines up as well.
If auto wrap is on then once the cursor goes past the
right margin setting then a new line is started. If auto
indent is on then the cursor is positioned so that the
left edge of the new line lines up with the previous
line. For programming it is best to have auto warp off
and auto indent on while for plain text auto wrap should
be on and auto indent off.
The tab size entry field determines the number of spaces
per tab setting. If tab compression is turned on then
this value is used as the number of spaces corresponding
to one tab when reading or writing a file unless the
default I/O tab size is also on in which case this value
is 8.
<Miscellaneous>
The undo entry field allows setting the maximum number of
undo records saved in memory. The default setting is
30000 which is essentially unlimited for normal editing
tasks. The editor relies on the undo records for some
internal operations so do not change this except in the
following circumstance. If the editor is being used to do
column manipulation of very long columns then the memory
usage by the undo mechanism gets very high and much
better performance is attained by turning undo off by
entering a zero value.
Conventional return. If this is on then hitting the Enter
or Return key splits the current line at the cursor as is
the case for most editors. If, however, conventional return
is not on then hitting Enter will insert a new line below
the current line while leaving the current line unchanged.
This is the standard mode of operation for many of IBM's
editors. This mode may take some getting used to but is
really very nice for programming since a new line can be
started without always having to go to the end of the
current line.
Overwrite Warning. If this is on then you will be warned
before a file of the same name is over written.
Error Beep. If this is on then the editor will beep when
an error occurs as well as pop up the error dialog.
Tab Compress. If this is on then when the editor writes
a file to disk a sequence of n spaces is replaced instead
with a tab character. This reduces the size of a saved
file a bit but is not recommended since the formatting
of a file can be corrupted if multiple people are working
on a file and using different values of n. It is however
the only way to get an explicit tab character in a saved
file in text mode. This is necessary for example with
UNIX make files. The value of n is determined by the
tab size entry field in the margins dialog except if the
default I/O tab size check box is also checked in which
case n is 8. When reading a file tabs are always replaced
with n spaces regardless of the setting of the tab
compress check box.
Key Map. If this is on then the associated editkey.map
file is read to redefine the actions of the specified
keys. If exclusive map is also on then only mapped keys
are active so this is only useful if a complete set of
keys necessary for editor operation are mapped.
Alt menu bar access. If this is on the menu bar may be
accessed from the key board by hitting the ALT key by
itself. The only reason for turning it off is that
sometimes this happens accidentally and it is not always
immediately obvious why the editor is not responding as
expected. Thus if you only access the menus with the
mouse turn it off.
<Colours>
The entry fields in this dialog are used to select the
text colours for both the main window and the command
line. The colours for syntax colouring are selected in
the syntax colouring dialog.
<Font>
This dialog is used to select a font for the editor. Only
mono spaced, image fonts are available.
<Mouse Buttons>
These entry fields are used to assign one of the three
marking modes to a mouse button so that a region may be
marked by dragging with the mouse. An existing region is
expanded by holding the Control key down while dragging.
Regions may also be marked from the key board by
positioning the cursor at the start, hitting the
appropriate marking key, moving to the end and hitting the
key again (See mark menu).
A region may also be marked in the normal mode by holding
the shift key down and moving the cursor.
<Syntax Colour>
Syntax colouring is enabled by clicking on the check box.
The bracket matching component may be separately enabled
with the other check box. The colours for the identified
elements is set with the colour entry fields. The
delimiters for line comments and/or comment start, end
are set with the entry fields at the bottom. There are
also entry fields for setting the escape or next
character literal delimiter and one for preprocessor
directives. The default values are for C/C++ but by
editing these syntax colouring may be used with other
languages.
With syntax colouring on the reflow command in the editor
menu reflow using fixed formatting rules for C code
rather than re flowing in text mode. These rules are not
yet configurable.
Syntax colouring requires significantly more from the processor
and hence may cause the editor to be unacceptably slow on
some systems. In this case turn syntax colouring off.
<Strings>
In this dialog the path to be used to find *.ndx files
may be specified. Ndx files contain information that
allows a key word to be used to start the info viewer on
that topic. These index files and corresponding *.inf
files are often supplied by compiler vendors. Once set up
this allows double clicking on a word in a file and
having help on this item pop up. Note that double
clicking in this fashion only works on files that are not
read only otherwise the word under the cursor is
interpreted as a file name to be loaded.
The second string is the fold tag used by the tagged
folding mechanism. See help for tagged folding.
<Splot Settings>
The path is the path(s) to any include files needed by the
interpreter. Most drawings include "splot.h" and hence this
path should point to the directory containing this file.
Mutiple paths should be separated by a semi-colon.
If the check box Always load is selected then any data files
are read from disk everytime the file is executed. If this
is not selected the data is not re-read which is faster but
means that the data may not be modified without copying.
If the checkbox Incremental Draw is checked only the changed
items are drawn. This is feature is however incomplete and
not recommended.
<Macro List>
This command causes all the currently defined macros to
be listed. They may then also be edited using plain
english although the easiest method of creating a macro
is to use the key stroke recording menu item. In order to
interpret any changes to the list this command needs to
be used twice. First, load the macro list then make some
changes and then use this command again. If the macro
list is currently displayed this command interprets the
list. Note that not all the function keys are actually
available depending on the implementation. For example
under OS/2 the Alt F4 key is the quit application system
key and is trapped before ever reaching the editor's
message queue. Hence these keys are unavailable despite
appearing in the list.
Note also that the macro keys must be specified in terms
of the un mapped key strokes even if key mapping is on.
The default accelerator is Ctrl L mapped to ^l
The format of macro definitions is as follows: A function
key name such as Shift F3 is followed by an arrow (->)
and then a list of up to 128 key names each separated by
a space. Key names may have a modifier in front of it
again separated from the key name by a space. The
available modifiers are Ctrl, Alt and Shift. Key names
are any letter, punctuation or number or function key
name as in F3. Additionally, the following special key
names and combinations are also recognized.
Ctrl Back
Enter
Backspace
Tab
Esc
Shift Tab
Home
Up
PgUp
left
KeyCenter
Right
End
Down
PgDn
Ins
Del
Ctrl Ins
Ctrl Del
Ctrl Left
Ctrl Right
Ctrl Home
Ctrl Pgdn
Ctrl End
Ctrl Pgup
Ctrl Up
Ctrl Down
Alt Up
Alt Left
Alt Right
Alt Down
Alt Home
Alt End
Alt PgUp
Alt PgDn
Alt Del
Alt Ins
Shift Ins
Shift Del
Shift Home
Shift Pgdn
Shift End
Shift Pgup
Shift Left
Shift Right
Shift Up
Shift Down
Alt Back
Alt Enter
Shift Enter
Ctrl Enter
Alt Tab
Ctrl Tab
Ctrl Break
Space
<Macro Read>
This command causes all the currently listed macros to be
read so that they become active. To list the current
macro definitions use the macro list command. The macro
definitions in the list may be edited using plain english
although the easiest method of creating a macro is to use
the key stroke recording menu item. Note that not all the
function keys are actually available depending on the
implementation. For example under OS/2 the Alt F4 key is
the quit application system key and is trapped before
ever reaching the editor's message queue. Hence these
keys are unavailable despite appearing in the list.
Note also that the macro keys must be specified in terms
of the un-mapped key strokes even if key mapping is on.
For a description of the macro definition format consult
the help for the macro list command.
The default accelerator is Ctrl D mapped to ^d
<Keymap List>
This command causes all the currently defined key
mappings to be listed. They may then also be edited using
plain english In order to interpret any changes to the
list this command needs to be used twice. First, load the
key map list then make some changes and then use this
command again. If the key map list is currently displayed
this command interprets the list. In order for this
command to be active key mapping must be enabled in the
editor configuration notebook.
The default accelerator is Ctrl K mapped to ^k
The format of key map definitions is as follows: A list
of key names (eg. Ctrl K Ctrl D) each separated by a
space followed by an arrow (->) and then the name of the
default key equivalent which is in all cases a single,
possibly modified, key. As a special case the key map on
key ^\, if mapped, must be last in the list and is
never un mapped provided mapping itself is enabled in
the configuration notebook. These keys are required
for emulating a modal editor such as vi.
Key names may have a modifier in front of it again
separated from the key name by a space. The available
modifiers are Ctrl, Alt and Shift. Key names are any
letter, punctuation or number or function key name as
in F3. Additionally, the following special key names
and combinations are also recognized.
Ctrl Back
Enter
Backspace
Tab
Esc
Shift Tab
Home
Up
PgUp
left
KeyCenter
Right
End
Down
PgDn
Ins
Del
Ctrl Ins
Ctrl Del
Ctrl Left
Ctrl Right
Ctrl Home
Ctrl Pgdn
Ctrl End
Ctrl Pgup
Ctrl Up
Ctrl Down
Alt Up
Alt Left
Alt Right
Alt Down
Alt Home
Alt End
Alt PgUp
Alt PgDn
Alt Del
Alt Ins
Shift Ins
Shift Del
Shift Home
Shift Pgdn
Shift End
Shift Pgup
Shift Left
Shift Right
Shift Up
Shift Down
Alt Back
Alt Enter
Shift Enter
Ctrl Enter
Alt Tab
Ctrl Tab
Ctrl Break
Space
<Keymap Read>
This command reads the currently displayed key mappings.
To list the current key mappings use the Keymap list
command. The mappings may be edited before reading.
In order for this command to be active key mapping
must be enabled in the editor configuration notebook.
For details on the key definition format consult the
help for Keymap List
The default accelerator is Ctrl Y mapped to ^y
<Keymap On>
Turns key mapping on if currently off. This command is
only available if key mapping is enabled in the editor
configuration dialog. Note that if this key is mapped
to another key it must be the last key in the mapping
list and then this key is always mapped so that
key mapping can be turned on again.
<Keymap Off>
Turn key mapping off if currently on. This command is
only available if key mapping is enabled in the editor
configuration dialog.
<Execute>
Starts interpretation and execution of the code starting
at the current program line if stopped at a break point or
at the start of the main() routine. If not currently at a
break point then a part of the code may be executed by
marking the lines to be done. In this case it is imperative
that the marked section does not contain any unbalanced
braces otherwise an error will be generated.
The default accelerator is Ctrl g mapped to ^G
<Execute Marked>
Starts interpretation and execution of the code starting
at the current program line if stopped at a break point or
at the start of the main() routine. If not currently at a
break point then a part of the code may be executed by
marking the lines to be done. In this case it is imperative
that the marked section does not contain any unbalanced
braces otherwise an error will be generated.
The default accelerator is Ctrl g mapped to ^G
<Stop Execution>
Terminates interpretation of the code and returns control
to the editor without setting a break point.
The default accelerator is Alt S mapped to %s
<Break>
Stops interpretation of the code and returns control
to the editor after setting a break point on the currently
executing line.
The default accelerator is Ctrl Break mapped to &^
<Reset>
Resets the program counter to the beginning and causes
the internal flags to be reset so that the next time
the file is executed the #includes are processed again.
This is useful if changes have been made to an included
file. Normally #include files are read only the first time
the file executes.
The default accelerator is Alt R mapped to %r
<Set Breakpnt>
Toggles on or off a break point on the current line.
Subsequent execution of the file will then stop at
this location allowing inspection of the variables
etc.
The default accelerator is ALT B mapped to %b
<Clear Breakpnt>
Toggles on or off a break point on the current line.
Subsequent execution of the file will then stop at
this location allowing inspection of the variables
etc.
The default accelerator is ALT B mapped to %b
<Step into>
Single steps the execution to the next line stepping
into a subroutine if the current line calls a
subroutine.
The default accelerator is ALT I mapped to %i
<Step over>
Single steps the execution to the next line stepping
over any subroutine calls on the current line.
The default accelerator is ALT O mapped to %o
<Global vars...>
Opens a dialog showing the values of all the currently
defined global variables. This dialog may be repositioned
and left open while the code is single stepped to watch
the variable values.
The default accelerator is ALT G mapped to %g
<Local vars...>
Opens a dialog showing the values of all the currently
defined local variables. This dialog may be repositioned
and left open while the code is single stepped to watch
the variable values.
The default accelerator is ALT L mapped to %l
<Defines...>
Opens a dialog showing the values of all the current
defines.
The default accelerator is ALT D mapped to %d
<abs>
int abs(int i);
Returns the absolute value of i;
<acos>
double acos(double x);
Returns the arc cosine of the value x. x must be
between -1 and 1. Returns a value between 0 and pi.
<arraydim>
int arraydim(void *array,int i);
Returns the number of elements in the ith dimension
of the array. Returns -1 if it is not an array or if
i is greater than the number of dimensions of the array.
Dimension counting starts at 0. The second parameter is
optional and if omitted the function returns the
dimensions of the array.
This is not a standard C library function.
<arraydup>
void *arraydup(void *array, int dim , int num);
Returns a pointer to a duplicate of the array.
Memory is malloced for the new array and the values
in the old array copied to the new one.
The last two parameters are optional and if included
allow the size of the target array to be changed. The
second parameter is the dimension to be changed and
the third parameters the change in size of a the
specified dimension. Thus for a 2D data array with
these optional parameters it is possible to add or
subtract some rows or columns.
This is not a standard C library function.
<arraymalloc>
double *arraymalloc(int dimen,int dsize,int no,...);
Returns a pointer to a malloced array of elements of
size given by dsize. If dsize is 1 char type is assumed,
if 2 short, 4 int and 8 double. The first parameter is the
number of dimensions, the second the base element size and
then a series of size values one for each dimension.
This is not a standard C library function.
<asin>
double asin(double x);
Returns the arc sine of the value x. x must be between
-1 and 1. Returns a value between -pi/2 and pi/2.
<atan>
double atan(double x);
Returns the arc tangent of the value x. Returns a value
between -pi/2 and pi/2.
<atan2>
double atan2(double y,double x);
Returns the arc tangent of the value y/x. Returns a value
between -pi and pi.
<atoi>
int atoi(char *str);
Converts a string to an integer. The string is converted up to
the first non-digit.
<atof>
double atof(char *str);
Converts a string to a double. The string is converted up to
the first character that is not a digit or 'e', 'E', '.', '-'
and '+' .
<ceil>
double ceil(double x);
Rounds up x to nearest integer value.
<cos>
double cos(double x);
Returns the cosine of x. x is specified in radians.
<ctime>
char *ctime(int tim);
Returns a pointer to an ASCII string containing the
current date and time. The passed parameter should
be the value returned by the time() function for
the current time and date.
example:
puts(ctime(time()));
<exit>
void exit(int status);
Terminates the execution of the program. If the status is 0
then it will be considered a normal exit otherwise an error
induced exit.
<exp>
double exp(double x);
Calculates the exponential function e^x.
<fabs>
double fabs(double x);
Returns the absolute value of x. It is like abs() but works
with floating point numbers rather than integers.
<fclose>
int fclose(FILE *fil);
Closes an open file pointed to by the passed file pointer.
Returns non-zero if any errors occurred. File buffers are
flushed before closing.
<fft>
void fft(double *data,int rcol,int icol,int inv)
Does a fast Fourier transform of the data. The last
parameter is optional and if TRUE the inverse
transform is done. The rcol parameter specifies the
column of data which is the real part while icol is
the column of data which is the imaginary part. To do
a transform of a real function just arrange to have a
column of zeros in your data. Note that the number of
rows in the data set must be a multiple of 2. If not
add rows to pad. This is not a standard C library
function.
<fgets>
char *fgets(char *str,int n,FILE *fil)
Reads a string from the file pointed to by fil into the
string str. Reading ends when either a newline character
is read or n-1 characters have been read. The newline
character is not retained if read and a terminating '\0'
is added to the end of the string. This function returns
a pointer to the string str or NULL if an error occurred
or the end of file was reached.
<floor>
double floor(double x);
Rounds down x to the nearest integer.
<fmod>
double fmod(double x,double y);
Returns the remainder of x/y.
<fopen>
FILE *fopen(char *name,char *mode);
Opens a file with the passed name and returns a
FILE pointer. If the named file could not be
opened a NULL pointer is returned. The mode string
is one of the following:
"r" - open for read only.
"w" - open for write. Previous contents destroyed.
"a" - open for append to end of existing file.
Only text mode files are supported by the interpreter.
<fputs>
int fputs(char *str,FILE *fil)
Writes the string str to the file pointed to by the
passed file pointer. No new line characters are inserted
unless a "\n" explicitly appears in the string str.
The return value is non-zero if an error occurred.
<free>
void free(char *ptr);
Frees the block of memory pointed to by ptr. The memory
must have been previously allocated using malloc().
<gets>
char *gets(char *str);
This function queries the user for a string by opening a
dialog box. The entered string is returned in the char
array str which must be previously declared and large
enough to hold the result. The return value is a pointer
to the same string. As an extension to the standard C
library behaviour the value of str upon entry is used
as the dialog title. I.e. it can be used as a prompt.
<log>
double log(double x);
Returns the natural log of x.
<log10>
double log10(double x);
Returns the log base 10 of x.
<malloc>
char *malloc(int size);
Allocates a block of memory of size bytes and returns a
pointer to the block. malloc returns NULL if there is
insufficient free memory.
<max>
double max(double x,double y);
Returns the larger of x or y. This is NOT a standard
C library function.
<min>
double min(double x,double y);
Returns the smaller of x or y. This is NOT a standard
C library function.
<pow>
double pow(double x,double y);
Calculates x to the power y.
<puts>
int puts(char *str);
This routine writes the string str to the output file and
starts a new line.
<printf>
int printf(char *format,...);
Prints the formatted data to the output file. The format
string specifies the type and number of values to print.
Some common examples include:
printf("i = %d",i); prints the
integer value i.
printf("x = %g",x); prints the
floating point value x.
printf("text = %s",str); prints the
string str.
Multiple values can be printed as in
printf("%d %d %g %s",i,j,x,str);
The format specifiers can also include field width
information and justification etc. Consult a standard C
text for more details.
<print>
void print(v,...);
Prints the value v which can be of any scalar type. i.e
int, char, float, double or a pointer. This is not a
function found in the standard C library.
<rand>
int rand();
Returns random number between 0 and
0x7FFF. Re-seed using srand();
<readdata>
void readdata(char * filename, double * data, int mod);
Reads a file of name filename and puts the data into the
array "data". The file should be in ASCII format with the x
data in one column and the y data values next column(s).
Any line containing non numeric characters or is blank will
be considered a comment and ignored. WARNING! In Splot as
an optimization data is only read from disk once if the
configuration parameter always_load is off. Subsequent
executions use the stored data already in memory (except
after a reset). This means that if you modify the array
"data" after reading in values the next time the file is
executed you will get strange results. Similarly, if you
reuse the same array for different plots in the same
drawing you will have trouble. The motto is never change
the values in the array "data". If you want to change the
values declare another array and copy the values. Also
remember that readdata() implicitly allocates memory for
the data array so it is correct to declare the data array
as double *data; at the top. If however, you are going to
fill in a new array with calculated values you need to
declare the array as double newdata[ysize][xsize]; so that
space will be allocated. The last parameter is optional
and if included and non-zero the data is read in as a
single dimension array. Furthermore, x values are not
generated if there is just a single column of numbers in
the file. This modified form of readdata is useful for
reading in numbers into an array to be used in the Splot
function lineto() etc.
<sin>
double sin(double x);
Returns the sine of x. x must be specified in radians.
<sleep>
void sleep(int millisec);
Stops execution for a duration in milliseconds as
specified by the passed parameter.
<smooth>
void smooth(double *data, int ycol, int pnts, int cycl)
Does a pnts point smooth on the specified column of
the data array. The last parameter specifies that the
data is cyclical and that to smooth the endpoints the
algorithm should wrap around back to the beginning or
end. The last two parameters are optional and are set
to 5 and FALSE by default. This is not a standard C
library function.
<sqrt>
double sqrt(double x);
Calculates the square root of x. x must be a positive
number.
<srand>
void srand(int seed);
Re-seeds the random number generator.
Implicitly started with a seed of 1.
<sizeof>
int sizeof(t);
Returns the number of bytes required to store the value of
type t. In standard C this is not a function but here it is.
<sprintf>
int sprintf(char str,char
*format,...);
Prints the formatted data to the string str. The format
string specifies the type and number of values to print.
Some common examples include:
sprintf(str,"i = %d",i); prints the
integer value i.
sprintf(str,"x = %g",x); prints the
floating point value x.
sprintf(str,"text = %s",string); prints the
string string.
Multiple values can be printed as in
sprintf(str,"%d %d %g %s",i,j,x,str);
The format specifiers can also include field width
information and justification etc. Consult a standard C
text for more details.
<strcat>
char *strcat(char *dest, char *source);
Concatenates the string source to the string dest.
Returns a pointer to the dest string.
<strcpy>
char *strcpy(char *dest, char *source);
Copies the string source to the string dest.
Returns a pointer to the dest string.
<strindex>
int strindex(char *str, char *sub);
Look for the sub string sub in str.
Returns the offset into the character array if the sub
string was found otherwise -1.
<strcmp>
int strcmp(char *s1, char *s2);
Compares the string s1 to the string s2.
Returns < 0 if s1 is lexically < s2
returns 0 if s1 equals s2
Returns > 0 if s1 is lexically > s2
<strlen>
int strlen(char *str);
Returns the length of the string str.
<tan>
double tan(double x);
Calculates the value of the tangent of x. x should be
specified in radians.
<time>
int time();
Returns the number of seconds elapsed since 00:00:00
GMT January 1, 1970. Similar to the standard C library
function time() but does not take a parameter.
Generally used in conjunction with ctime();
<writedata>
void writedata(char *filename, double *data); or
void writedata(FILE *fil, double *data);
Writes a file of name filename with the contents of the
data array "data". The array must be a two dimensional array.
The format of the output is such that a file created
using writedata() can be read in again using readdata().
The first form overwrites an existing file of the same
name and opens and closes the file internally. To add
to an existing file use the second form after obtaining
a file handle with fopen();.
<break>
C keyword
Used to prematurely terminate a loop;
Example:
for (i = 0;i< 100; i++)
{
if (cond == 1) break;
/* if cond == 1 break out of the
loop regardless of the value of
i and continue at end of loop. */
}
<case>
C keyword
Used in conjunction with a switch to select one of a set of
choices.
Example:
switch(code)
{
case 0:/* do something if code = 0*/
break;
case 1:/* do this if code = 1*/
break;
case 2:
case 3:/* do this if code = 1 or 2*/
break;
default:/* do this if none of the
above */
break;
}
<char>
C keyword
Used to allocate memory for a variable of size one byte.
All chars are between -128 and 127. All variable
declarations must be done outside of the main routine for
of the main routine for globals. Unlike standard C and more
like C++ local variable declarations for local variables
can be anywhere in the routine. Also specifying the size
of local arrays using variables rather than constants is
acceptable for the interpreter.
Example:
char c;
Arrays of base types can be specified using the syntax:
char tmp[80];
Pointers to a base type are specified as
char *tp;
<continue>
C keyword
Used to skip the remainder of a loop and test the condition
again.
Example:
for (i = 0;i< 100; i++)
{
if (cond == 1) continue;
/* if not cond == 1 do the rest
of the loop below the above line
otherwise increment i and test
again. */
}
<default>
C keyword
Used in conjunction with a switch to select the remaining
not explicitly specified choices.
Example:
switch(code)
{
case 0:/* do something if code = 0*/
break;
case 1:/* do this if code = 1*/
break;
case 2:
case 3:/* do this if code = 1 or 2*/
break;
default:/* do this if none of the
above */
break;
}
<do>
C keyword
Used in conjunction with while to set up loops that are
executed at least once. For Example:
do
{
/* loop body */
}
while (cond == 1);
<double>
C keyword
Used to allocate memory for a double precision floating
point value. All variable declarations must be done outside
of the main routine for globals. Unlike standard C and more
like C++ local variable declarations for local variables
can be anywhere in the routine. Also specifying the size
of local arrays using variables rather than constants is
acceptable for the interpreter.
Example:
double d;
Arrays of base types can be specified using the syntax (2 x
400 array):
double data[2][400];
Pointers to a base type are specified as
double *tp;
<else>
C keyword
Used as part of an if statement to select the converse
case. Example
if (cond == 1)
{
/* execute this if cond = 1 */
}
else
{
/* execute this if cond not 1 */
}
<enum>
C Keyword
Only partially implemented. Its okay to declare an enum but
all the elements are internally stored as separate constant
integer values. Do not try to cast a variable to an enum.
<float>
C keyword
Used to allocate memory for a single precision floating
point value. All variable declarations must be done outside
of the main routine for globals. Unlike standard C and more
like C++ local variable declarations for local variables
can be anywhere in the routine. Also specifying the size
of local arrays using variables rather than constants is
acceptable for the interpreter.
Example:
float f;
Arrays of base types can be specified using the syntax (2 x
400 array):
float data[2][400];
Pointers to a base type are specified as:
float *tp;
<for>
C keyword
Used to set up loops which are meant to run for a
predetermined number of iterations. For example:
for (i = 0;i< 100; i = i + 2)
{
/* execute this loop body 50
times. i.e. until i = 100 with
i starting at zero and incremented
by 2 after each iteration */
}
<int>
C keyword
Used to allocate memory for a variable of size one integer.
All variable declarations must be done outside of the main
of the main routine for globals. Unlike standard C and more
like C++ local variable declarations for local variables
can be anywhere in the routine. Also specifying the size
of local arrays using variables rather than constants is
acceptable for the interpreter.
Example:
int i,j;
Arrays of base types can be specified using the syntax (2 x
400 array):
int data[2][400];
Pointers to a base type are specified
as
int *tp;
<if>
C keyword
Used to conditionally execute a block of code depending if
the conditional expression is true (non zero) or false
(zero). Can be used in conjunction with the keyword else.
For example:
if (i > j && k != 10)
{
/* execute this block if i greater
than j and k not equal to 10 */
}
else
{
/* otherwise to this block */
}
<long>
C keyword
Used to allocate memory for a variable of size one long
integer. All variable declarations must be done outside of
the main of the main routine for globals. Unlike standard
C and more like C++ local variable declarations for local
variables can be anywhere in the routine. Also specifying
the size of local arrays using variables rather than
constants is acceptable for the interpreter. In this
implementaton a long is 32 bits the same as an int.
Example:
long i,j;
Arrays of base types can be specified using the syntax (2 x
400 array):
long data[2][400];
Pointers to a base type are specified as
long *tp;
<main>
C keyword
This is actually a function and is the starting point of
the code. The function main is called by hitting CTRL G.
The syntax is
main()
{
/* program to be executed */
}
<return>
C Keyword
This exits a sub routine and returns an optional value to
the calling routine. For example:
main()
{
int x;
i = sub(x);
print(i);
}
int sub(int x)
{
/* calculate i based on input x */
return i;
}
<short>
C keyword
Used to allocate memory for a variable of size one small
integer. All variable declarations must be done outside of
the main of the main routine for globals. Unlike standard
C and more like C++ local variable declarations for local
variables can be anywhere in the routine. Also specifying
the size of local arrays using variables rather than
constants is acceptable for the interpreter.
Example:
short i,j;
Arrays of base types can be specified using the syntax (2 x
400 array):
short data[2][400];
Pointers to a base type are specified as
short *tp;
<struct>
C Keyword
Structures are not yet implemented. Do not use.
<switch>
C keyword
Used to select one of a number of choices based on the
value of the expression code.
Example:
switch(code)
{
case 0:/* do something if code = 0*/
break;
case 1:/* do this if code = 1*/
break;
case 2:
case 3:/* do this if code = 1 or 2*/
break;
default:/* do this if none of the
above */
break;
}
<union>
C Keyword
Unions are not yet implemented. Do not use.
<unsigned>
C keyword
Used as a type modifier for the integer variable types
char, short, and int.
example
unsigned int ui;
<void>
C Keyword
Only partially implemented. void pointers are internally
changed to char pointers. Other voids are ignored.
<while>
C keyword
Used to construct loops which run an non predetermined
number of times. For example:
cond = 1;
while (code == 1)
{
/* execute this loop body until
something in here sets cond to
something other than 1. */
}
<Print...>
This command opens a printer selection dialog if more
than one printer driver is available on your installation.
After the printer is chosen the graphics image is spooled
to the printer. To change various printer configuration
settings open the settings dialog of your printer object.
<EPSfile...>
This command opens a filename selection dialog to start
with. The default name is the current splot file name
with the extension .eps. The generated file is in the
encapsulated postscript format. This is a device
independent format and is suitable for inclusion in a
larger postscript document as a figure or for printing
directly on a postscript printer. To print an eps figure
copy it directly to the printer bypassing any printer
drivers.
<Metafile...>
This command opens a filename selection dialog to start
with. The default name is the current splot file name
with the extension .met. The generated file is in the
metafile format. This is a device and resolution
independent format and is suitable for inclusion in other
programs that accept the metafile format.
<Bitmapfile...>
This command opens a filename selection dialog to start
with. The default name is the current splot file name
with the extension .bmp. The generated file is in the
bitmap format. Bitmaps unlike metafiles or eps files
are not device and resolution idependent. The number
of pixels in the bitmap exactly matches the number of
pixels in the graphics window. Hence a bitmap cannot
be scaled without loss of quality. The resulting
bitmap file is suitable for import to any other program
that accepts a bitmap.
<Redraw>
Redraws the graphics elements in the graphics window
without reinterpreting the code. This can be useful if
Splot is in the incremental draw mode in order to fix up
blemishes caused by out of order drawing and erasing.
<Stop Draw>
Stops the drawing process. This is only effective once
drawing starts after interpretation of the code. Usually
but not always interpretation takes longer than drawing.
To stop interpretation choose Break in the exec menu of
the editor.
<Trace Only>
This is a toggle and if on lines are drawn single pixel
wide regardless of the specified width and filled regions
are just drawn using single pixel outlines. This
significantly speeds up drawing of complex figures and
may be useful while constructing a figure.
<Reset Graph>
Clears the graphics page and restores the graphics
state to its initial start up settings. This will also
force a complete re interpretation of the source code
the next time the execute command is selected.
<Coord Match>
The coordinates used for the graphics cursor are usually
in terms of centimeters from the bottom left corner of
the graphics window. If this menu item is toggled on
however the coordinate system is changed to match that
of the current axes box. The current axes box is the
last drawn or right clicked axes box. Coordinates entered
by double clicking while match is on are also in terms
of the current axes box system. This probably requires
a previous cmatch(ON); call in the code to provide the
desired results.
<Relative Coords>
The coordinates used for the graphics cursor is usually
in terms of centimeters from the bottom left corner of
the graphics window. If this menu item is toggled on
however the reported coordinates are relative to the
last insertion point. An insertion point is set anytime
a mouse button is clicked in the graphics window.
<Snap Toggle>
Toggles on or off the coordinate snapping. If the setting
is on the coordinates are always rounded to the nearest
snap point as set by the snap spacing. In this way it is
possible to force mouse entered coordinates to always be
an even centimeter for example.
<Snap Spacing...>
Opens a dialog to set the snap spacing. If snap is
toggled on then coordinates are always rounded to the
nearest snap point as set by the snap spacing. In this
way it is possible to force mouse entered coordinates
to always be an even centimeter for example.
<Grid Toggle>
Toggles on or off the drawing of grid lines on the
graphics window. These lines are a drawing aid and
do not appear in printed output.
<Grid Spacing...>
Opens a dialog to set the grid line spacing. Grid
lines are draw on the graphics window as a drawing
aid if toggled on and do not appear in printed output.
<Copy to Clipbrd>
This command causes the current graphics window to be
copied to the system clipboard in both the metafile
and bitmap formats. This may be useful for exporting
a figure to another program.
<Box Zoom>
The figure is zoomed to the size specified by the
mouse drawn box. Drag with the left mouse button
to set a box. If the shift key is also down then
the box zoom will be immediately invoked without
the need to chose this command. Note that the actual
box used may be different from that drawn since
the aspect ratio is never changed. To pan a zoomed
figure use the scroll bars.
<Undo Zoom>
Restores the image to the previous zoom state. Any
number of zooms may be undone until the original
full size image is restored.
<Save View>
The current zoom/pan state may be saved for later
restoration using the Rest View menu item. Several
views may be saved in a ring.
<Rest View>
A previously saved zoom/pan state may be restored
using this menu item. If several views have been
saved this command will cycle through them.
<Draw>
To plot a figure load a .spt file.
For example:
<esc> edit demo\logaxes.spt or use the 'Open'
button in the 'File' menu.
then hit CTRL G or 'Execute' button.
The next section explains how to use the mouse. For
help with the editor select help in the editor window.
Using The Mouse
Double clicking the left mouse button with the mouse on
the drawing page inserts the current x,y coordinates into
the text file at the current text cursor location. If the
mouse cursor is in the text region then hitting the left
mouse button will move the current text cursor to the mouse
cursor location. The left mouse button is also used to
select items in drop down menus. A rubber band box is drawn
by pressing the left mouse button with the mouse over the
plot window and dragging the mouse with the left button held
down. The second point of the box is set to the location at
which the button is released. Double clicking the left mouse
button in the text window results in an action depending on
the type of file and type of word under the mouse cursor.
If the word under the cursor is a variable the value of the
variable or constant is displayed. If the word is a
function then the help screen for that function will be
loaded. If the current file has a read only attribute then
the editor attempts to interpret the word under the cursor
as a file name and subsequently load in that file.
The right mouse button is used for highlighting
elements of a drawing. If the mouse cursor is on top of a
displayed element on the drawing page and the right mouse
button is hit then the corresponding element is highlighted
in intense white and the text cursor jumps to the
corresponding line in the text that generated that element.
Conversely, if the mouse cursor is on the text side hitting
the right mouse button will highlight any graphics elements
generated by the line under the mouse cursor. This feature
is very useful for finding the code associated with a
particular element of a drawing or the reverse. Clicking the
right mouse button on a drop down menu item will open a
help window for that item if available.
When the mouse cursor is on the drawing page the
current coordinates are printed at the bottom. The units
and origin used are those in effect at the end of the last
program execution. The default units are cm with the origin
in the bottom left corner of the page. Pressing the middle
mouse button (or both the left and right mouse buttons
together on two button mice) with the mouse pointer on the
drawing page causes the current coordinate reference point
to be reset so that the current coordinate line
subsequently reports the distance from this point.
In the editor window the mouse can also be used to mark a
region. Three types of regions are available and can be
assigned to any one of three mouse buttons as set up in the
"config" notebook of the "file" menu.
Actions associated with the menu buttons
There are several menu buttons along the top of the
display. The action of these buttons is as follows.
Starting at the left top there are four buttons labelled
'Draw', 'Slib', 'Cnst', 'SetO' and 'Keyw'. These activate
drop down menus which allow a function to be selected and
inserted into the text. The 'Draw' functions are a suite of
drawing routines which cause lines, arcs, text etc. to be
drawn to the page. The 'SetO' menu is a list of textual
names for numerical constants which are used in conjunction
with the set(); command to change attributes of the current
graphics state such as the current colour, line width, line
style, axes type, etc. Choosing set from the list of
drawing functions automatically opens a menu with only an
appropriate subset of these and is the recommended
approach. The 'Slib' button allows selection of a standard
C library function. Most of these are math functions such
as sin() and will not be required for making ordinary
plots. They are however useful for manipulating data before
plotting or generating data mathematically all from within
Splot. The 'Cnst' button opens a menu containing all the
constants defined in splot.h. The last button of this group
'KeyW' opens a list of C keywords for selection. The only
one of these that is of interest for ordinary plots is
'main'. Every file that generates a plot or drawing must
start with
#include <splot.h>
main()
{
/* List of drawing commands go here */
/* between the braces on as many */
/* lines as necessary. */
}
This is all automatically inserted in the text by
selecting 'main'. The remaining keywords in this list are
only of interest when constructing loops or branches.
The next button labelled 'Misc' opens a sub menu
containing the options 'Reset', 'Redraw' , 'Coord Match'
and 'Relative Coord'. 'Reset' resets splot to its initial
state and erases the current drawing. The 'Redraw' button
can be useful if Splot is in the incremental draw mode in
order to fix up blemishes caused by out of order drawing ad
erasing. 'Redraw' just re draws the current plot. The button
'Coord Match' toggles the current units from cm to units
matching those defined in the last axes_box() and back. The
button 'Relative Coord' toggles the coordinate display from
reporting the absolute coordinate to reporting the distance
between the mouse position and the current point defined
using the middle mouse button or double clicking the left
mouse button over the plot window.
The next button along the top is concerned with
displaying the drawing. The default size of the drawing is
one which fits on a standard 8 x 11 inch piece of paper if
printed. However, as the screen resolution is not as good
as that of printers it is possible to zoom in on part of a
drawing in order to get a better view. To zoom in on part
of a drawing hold down the left button and drag the mouse
to enclose the region of interest. Then select the zoom
button and pick the drop down menu item 'Box Zoom'. The
button 'Undo Zoom' restores the previous view. The buttons
'Save View' and 'Rest View' allow interesting views to be
saved on a stack and restored respectively.
<Input mode>
This menu item toggles the keyboard input mode. If
enabled then typing will automatically enable the
command line for input and a carriage return causes
the entered line to be sent out on the current comm
port. If not enabled then the regular file editing
mode is in effect.
The default accelerator is ALT M mapped to %m
<Port...>
This command opens the comm port selection dialog.
Available ports are 1-4 hardware permitting.
<Baud...>
This command opens the baud rate selection dialog.
Available baud rates for the current comm port are
standard rates up to 38,400.
<Xmit cur line>
This command causes the line that the text cursor is
currently on to be transmitted on the current comm
port. A carriage return is automatically appended to
the string.
The default accelerator is ALT X mapped to %x
<transmit>
int transmit(char *str);
For versions with serial communication enabled this command
sends out the passed string str on the current comm port. A
carriage return is appended to the string and the number of
characters actually sent is returned.
This is not a standard C library function.
<receive>
int receive(char *buf,int timeout);
For versions with serial communication enabled this command
receives a string from the current comm port. A string is
considered complete when a carriage return is received. The
received string is returned in the character array buf which
must have been previously declared and must be large enough
to hold the result. The timeout parameter is in seconds and
limits the time the receive function will wait for a complete
string. If a timeout occurs the return value is TRUE else the
return value is 0.
This is not a standard C library function.
<waitfor>
int waitfor(char *pattern,int timeout);
For versions with serial communication enabled this
command waits until a string matching the passed pattern
string has been received from the current comm port. The
timeout parameter is in seconds and limits the time the
receive function will wait for a match. If a timeout
occurs the return value is TRUE else the return value is
0.
This is not a standard C library function.
<waitreg>
int waitreg(char *regexp,int timeout,char *mbuf,...);
For versions with serial communication enabled this
command waits until a string matching the passed regular
expression has been received from the current comm port.
The timeout parameter is in seconds and limits the time
the receive function will wait for a match. If a timeout
occurs the return value is TRUE else the return value is
0. If a match is found the matched string is copied to
the buffer pointed to by mbuf which must be allocated
before calling this function. Optional additional regular
expressions may be added at the end in which case this
function waits for any one of the regular expressions to
be matched.
Regular expressions allow much more complicated match
criteria to be specified than is possible in the waitfor
function. For example the following regular expression
will match any floating point number followed by a non
number.
[0-9]+[\.]*[0-9]*[^0-9]
For regular expressions the following symbols have
special meaning:
^ start of line
\$ end of line
. any character
\\ literal next character
+ match one or more times
* match zero or more times
[aei0-9] match a,e,i and 0 through 9
[\^aei0-9] match anything but a,e,i and 0 through 9
( ) sub expression
a(ab)*b matches ab aabb aababb aabababb etc.
This is not a standard C library function.
<abox>
void abox(double xsi, double
ysi, double xorig,
double yorig);
Adds an axes box to the current path. The box is drawn with
a size of xsi by ysi and centered on the page. No internal
coordinate system is set up. Use ascale() for this or use
axes_box() to combine both functions. All the parameters
are optional and if present, specify the box size and
position of the axes origin relative to the page origin. For
the last two parameters the special constants XCENTER and
YCENTER can be used for the x or y position coordinate
respectively and will cause the axes box to be centered on
the page along that axis. Using both XCENTER and YCENTER is
equivalent to the default behaviour with the last two
parameters absent. If no parameters are specified a default
size of 12 by 16 cm is used and the box centered on the page.
abox() is implicitly stroked.
<alineto>
void alineto(double len, double ang);
Adds a line of length len at an angle of ang with respect
to the previous line to the current path. Generates an
error if there is no current point. If there is no
previous line then a horizontal line ending at the
current point is assumed. The angle is in degrees and is
the angle between an imaginary extension to the previous
line and the current line.
<arc>
void arc(double xcen, double ycen, double rad, double
alpha, double beta);
Adds a circular arc of radius rad centered at (xcen, ycen)
to the current path. The starting angle is alpha and the
stopping angle is beta. The arc is drawn in the counter
clockwise direction. A straight line section will be added
from the previous current point if any to the starting
point of the arc.
<arcn>
void arcn(double xcen, double ycen, double rad, double
alpha, double beta);
Adds a circular arc of radius rad centered at (xcen, ycen)
to the current path. The starting angle is alpha and the
stopping angle is beta. The arc is drawn in the clockwise
direction. A straight line section will be added from the
previous current point if any to the starting point of the
arc. Exactly as arc() but draws the arc in the opposite
direction.
<arcto>
void arcto(double x1, double y1, double x2, double y2,
double rad);
Adds a circular arc of radius rad to the current path. The
center and angles are chosen so that the arc is tangent to
the line formed by (x1,y1) and the current point at its
start and tangent to the line (x1,y1) - (x2,y2) at its end
point. A straight line segment is added from the current
point to the start of the arc. An error is generated is
there is no current point.
<arrowto>
void arrowto(double x,double y,...);
or
void arrowto(double *array,int first,int last);
or
void arrowto(double *array);
Adds a line segment to the current path from the current
point to (x,y). The line is terminated by drawing an arrow
head oriented in the direction of the line. More than one
coordinate point can be specified in the command in which
case a series of line segments terminated by arrows
connecting the points will be added to the current path. If
there is no current point then an error will be generated.
The size of the arrow head may be changed with the
set(FONTWIDTH,...); command. The second format is a pointer
to a 2D array of coordinate pairs followed by an optional
pair of integers specifying the first and last pairs to be
plotted.
<ascale>
void ascale(int axes, double xstart, double ystart, double
xend, double yend);
or
void ascale(int axes, double *data, int col,...);
An internal coordinate system is set up for subsequent
plotting of data within the existing axes box. The x axis
start and stop values are xstart and xend respectively and
ystart, yend for the y axis. for the y axis. If the axis
choice is XAXES or YAXES rather than XYAXES then only two
numbers follow the axes specifier rather than four. This
allows the x and y axes scales to be set independently of
each other. The alternate format allows for auto scaling to
the specified data. There can be more than one data array
in the list in which case the scales are chosen so that
they will all fit. Each data array can optionally be
followed by one or two integers specifying which columns to
use for the x and y values. If axes is not XYAXES only one
integer is allowed.
<axes_box>
void axes_box(double xsi, double ysi, double xstart, double
ystart, double xend, double yend,double xorig, double
yorig);
Adds an axes box to the current path. The box is drawn with
a size of xsi by ysi and centered on the page. An internal
coordinate system is set up for subsequent plotting of data
within the box. The x axis start and stop values are xstart
and xend respectively and ystart, yend for the y axis. for
the y axis. The last two parameters are optional and if
present specify the position of the axes origin relative to
the page origin. For the last two parameters the special
constants XCENTER and YCENTER can be used for the x or y
position coordinate respectively and will cause the axes
box to be centered on the page along that axis. Using both
XCENTER and YCENTER is equivalent to the default behaviour
with the last two parameters absent. More flexibility is
provided by the pair of functions abox() and ascale() which
provide the functionality of axes_box() in several steps.
axes_box() is implicitly stroked.
<box>
void box(double x1, double y1, double x2, double y2);
Adds a box to the current path. The two end points of the
box are (x1,y1) and (x2,y2);
<clear>
void clear();
Clears the screen when the program is executed. Also
the list of drawable elements is deleted.
This function should not be needed for ordinary plots.
<clip>
void clip()
Converts the currently defined path into a clipping path.
All subsequent drawing operations are then clipped against
this path and only portions of the drawing on the inside of
the clip path are displayed. What is inside and what is
outside depends on whether even-odd or non-zero wind has
been selected as the fill rule using a set(); If the
current path is not closed then the current path is first
closed. If there is no current path an error is generated.
Clip() is implicitly stroked and takes effect immediately.
<closepath>
void closepath();
Closes the current path. A straight line segment is added
from the current point to the start of the current path as
set by the moveto() of rmoveto() command at the beginning
of the path definition. Generates an error if there is no
current point.
<cmatch>
void cmatch(int on);
If the passed parameter is TRUE then it does the necessary
translations and scaling so that the coordinate system for
the page matches that used within the axes_box. An error is
generated if there is no current axes_box. The font scale
is compensated automatically for the change in coordinate
system so that characters will still be the same size as
before. If the parameter is FALSE then the previous
unmatched coordinates will be restored. If there is no
parameter TRUE is assumed.
<curveto>
void curveto(double x1, double y1, double x2, double y2,
double x3, double y3);
or
void curveto(double *array,int first,int last);
or
void curveto(double *array);
Adds Bezier curve sections to the current path starting
at the current point. The curve starts tangent to
(xcur,ycur) - (x1,x2) and ends tangential to (x2,y2) -
(x3,y3) at (x3,y3); An error is generated if there is no
current point. The number of coordinate points must be
a multiple of three else an error is generated.
Several formats are allowed. The first is a list
of coordinate pairs. The second format is a pointer to a 2D
array of coordinate pairs followed by an optional pair of
integers specifying the first and last pairs to be plotted.
<drawdata>
void drawdata(double *data, int xcol, int ycol,...);
Draws the data contained in the array data in the current
axes_box. The numbers xcol and ycol are the columns of the
array data that are to be used for the x-axis and y-axis
data respectively. Each row of the array data represents
one coordinate point to be plotted. The values will be
plotted using the internal coordinate system established by
the the call to axes_box. If there is no current axes box
an error will be generated. The xcol and ycol params are
optional. If no values are given then xcol = 0 and ycol = 1
are assumed. For the popular case of one column of x values
and a set of y values the whole set may be plotted using
plotdata(data,xcol,ALL_Y);. drawdata() is implicitly stroked.
More than one data set with corresponding xcol and ycol may
be specified.
<errorbars>
void errorbars(int axes,double *data, int xcol, int ycol,
int errcol);
Draws error bars for the data points in the array "data".
The first parameter is either XVALS or YVALS indicating
along which axes the error bars are to be drawn. The
numbers xcol and ycol are the columns of the array data
that are to be used for the x-axis and y-axis data
respectively. Each row of the array data represents one
coordinate point to be plotted. The values will be plotted
using the internal coordinate system established by the the
call to axes_box. The last parameter "errcol" is the column
of the array "data" which holds the size of the error for
the corresponding data point in the same row. If there is
no current axes box an error will be generated.
errorbars() is implicitly stroked.
<epsfile>
void epsfile(char *filename);
Writes the current graphics image to a file with the
given name. The output format is encapsulated postscript.
Such a file can be printed on a postscript printer or
included as a graphic in many other programs. Warning! This
command does not check if it is over writting an existing
file.
<fill>
void fill();
Closes the current path if not already closed and fills the
interior region with the current colour as specified by the
last set() call. What is inside and what is outside the
path depends on the currently chosen fill rule. The fill
rule is either even-odd or non-zero wind (the default) and
is specified using a set() call. An error is generated if
there is no current path.
<fitline>
void fitline(double *data, int xcol,
int ycol,double *yint,double *slope);
Fits the best straight line to the data in the array "data"
using the column xcol of the array as the x values and the
column ycol as the corresponding y values. The best line is
drawn constrained to the current axes box. If there is no
current axes box an error is generated. The last two
parameters are the returned values giving the y intercept
and slope of the fitted line. Note that they are pointers
to doubles which must be declared at the top of the
program. Given a declaration of the form:
double slope,yint;
Call fitline using:
fitline(data,0,1,&yint,&slope);
Assuming that the first and second column of data are the x
and y values respectively. Data points can be excluded from
the fit by using the set(XRANGE,xmin,xmax); or
set(YRANGE,ymin,ymax); commands. Only data points within
the limits will be used for the fit. fitline() is
implicitly stroked.
<get>
int or double get(int option, char *str);
Returns the value of the specified option in the current
graphics state. The numerical value for single valued
elements is returned by the function otherwise the return
value is 0. A text representation of the value is optionally
returned in str. If used, be sure to allocate a character
array with sufficient space for str before calling this
function as in char str[80]; at the top of the program. The
valid option values are defined in splot.h. See also set()
for a description of the various options. The returned
string can be printed using the command puts(str); in the
program where "str" is the name of the array in the call to
get(). Returned numerical values can be printed using
print(value); The second array parameter is optional and is
only really needed for getting options that are more than
just a single value such as line patterns.
<grestore>
void grestore();
Pops a graphics state off the state stack thereby restoring
the graphics state that was in effect at the time the
matching gsave() was executed. In particular, the path, the
clip path, the line styles, line colours etc. are restored
to their previous values.
<gsave>
void gsave();
Pushes the current graphics state onto the state stack. The
current path, clip path, line style, colour etc. are saved
so that they can be restored later using a grestore()
command.
<label>
void label(int axis, char *label);
Add labels to the axes box previously defined. The first
parameter is which axis to label either BOTTOM, TOP, LEFT
or RIGHT. The following parameter is the label to be
printed. The label will be printed centered between the
appropriate edges of the current axes box. An error is
generated if there is no current axes box. All labels
should be after plotdata() if used otherwise spacing from
the axes may not be correct. The spacing can also be
changed using set(LABELMARG,...);. label() is implicitly
stroked.
<legend>
void legend(double x, double y, double leng,
label1,...);
Creates a legend for the current axes. There should be a
matching text label at the end of the parameter list for
each curve plotted in the axes box. The first two parameters
are the x and y position of the top item in the legend. The
leng parameter is the length of the line to draw to the left
of the text label. This line will be drawn with the same
colour and style as was used for the data. If the data was
plotted using the SYM_LINES style the symbol used for the
data is also drawn at each end of this line. If, however the
data was plotted using the SYMBOLS style then only the
symbol is drawn and the length parameter is ignored. The
spacing between the line and the text labels is controlled
using the set(LABELMARG,val); statement. The size of the
text labels and the text label colour are determined by
the current graphics state settings and are modified with
the appropriate set(); command.
<lineto>
void lineto(double x,double y,...);
or
void lineto(double *array,int first,int last);
or
void lineto(double *array);
Adds a line segment to the current path from the current
point to (x,y). More than one coordinate point can be
specified in the command in which case a series of line
segments connecting the points will be added to the current
path. If there is no current point then an error will be
generated. Several formats are allowed. The first is a list
of coordinate pairs. The second format is a pointer to a 2D
array of coordinate pairs followed by an optional pair of
integers specifying the first and last pairs to be plotted.
<moveto>
void moveto(double x, double y);
Sets the current point to (x,y). Also sets the path close
point to (x,y) for subsequent use with closepath(). Many
path building commands such as curveto() and lineto() require
that a current point exist before calling them.
<newpath>
void newpath();
Resets the current path to NULL and also causes the current
point to be undefined. Furthermore, it turns off the
implicit stroking of elements that are normally implicitly
stroked such as text();. Thus using newpath(); these
elements can be added to a path which must then be
explicitly stroked. stroke() turns on implicit stroking
again.
<plotdata>
void plotdata(double *data, int xcol, int ycol,...);
Plots the data found in array data in a box. This command
chooses the scale sizes tick marks etc. to display the data.
The parameters xcol and ycol specify which columns of the
array data to use for the x and y values respectively. The
xcol and ycol params are optional. If no values are given then
xcol = 0 and ycol = 1 are assumed. For the popular case of one
column of x values and a set of y values the whole set may be
plotted using plotdata(data,xcol,ALL_Y);. If the default
choices of plotdata are not acceptable a plot can be generated
using the step by step method using axes_box(), tickmarks(),
ticklabels() and drawdata(). The data must first be read in to
array data using readdata(). plotdata() is implicitly stroked.
More than one data, xcol, ycol triplet may be entered in which
case the auto scaling ensures that the box is scaled to the
max of all the data sets.
<rarrowto>
void rarrowto(double x, double y,...);
or
void rarrowto(double *array,int first,int last);
or
void rarrowto(double *array);
Adds a line segment to the current path from the current
point to the current point plus x, y. The line is
terminated by drawing an arrow head oriented in the
direction of the line. This command is identical to arrowto
except that the displacement is specified relative to the
current point. More than one coordinate point can be
specified in the command in which case a series of line
segments terminated by arrows connecting the points will be
added to the current path. If there is no current point
then an error will be generated. The size of the arrow
head may be changed with the set(FONTWIDTH,...); command.
The second format is a pointer to a 2D array of coordinate
pairs followed by an optional pair of integers specifying
the first and last pairs to be plotted.
<rcurveto>
void rcurveto(double x1, double y1, double x2, double y2,
double x3, double y3);
or
void rcurveto(double *array,int first,int last);
or
void rcurveto(double *array);
This is identical to curveto() except that the list of
coordinates are all relative distances from previous point.
Adds Bezier curve sections to the current path starting
at the current point. The curve starts tangent to
(xcur,ycur) - (x1,x2) and ends tangential to (x2,y2) -
(x3,y3) at (x3,y3); An error is generated if there is no
current point. The number of coordinate points must be
a multiple of three else an error is generated.
Several formats are allowed. The first is a list
of coordinate pairs. The second format is a pointer to a 2D
array of coordinate pairs followed by an optional pair of
integers specifying the first and last pairs to be plotted.
<reset>
void reset();
Restores all set able parameters to their default values.
Clears the current path and clip path.
<rlineto>
void rlineto(double x,double y,...);
or
void rlineto(double *array,int first,int last);
or
void rlineto(double *array);
Adds a line segment to the current path from the current
point to the current point plus x, y. This command is
identical to lineto except that the displacement is
specified relative to the current point. More than one
coordinate point can be specified in the command in which
case a series of line segments connecting the points will
be added to the current path. If there is no current point
then an error will be generated. Several formats
are allowed. The first is a list of coordinate pairs. The
second format is a pointer to a 2D array of coordinate
pairs followed by an optional pair of integers specifying
the first and last pairs to be plotted.
<rmoveto>
void rmoveto(double x, double y);
Sets the current point to the current point plus x,y. This
command is the same as moveto except that a relative move
is specified. It also sets the path close point for
subsequent use with closepath(). Many path building
commands such as curveto and lineto require that a current
point exist before calling them.
<rotate>
void rotate(double ang);
Rotates the figure about the
current origin by the the angle
specified. The angle units are
degrees and the +ve direction
is counterclockwise.
Changes in rotation are cumulative.
<rsplineto>
void rsplineto(double x1,y1,x2,y2,...);
or
void rsplineto(double *array,int first,int last);
or
void rsplineto(double *array);
This is identical to splineto() except that the list of
coordinates are all relative distances from previous point.
This function accepts a list of two or more coordinate
pairs and using the current point as the first point draws
a cubic spline which goes through all of the given
coordinates. It uses Bezier curves internally but
calculates the necessary control points in order to make
the derivative continous everywhere. An error is generated
if there is no current point. Specifying less than two
additional points also generates an error. Several formats
are allowed. The first is a list of coordinate pairs. The
second format is a pointer to a 2D array of coordinate
pairs followed by an optional pair of integers specifying
the first and last pairs to be plotted.
<scale>
void scale(double xs, double ys);
Changes the scale of the figure
by the factors specified for
the x and y axes respectively.
Changes in scale are cumulative.
<set>
void set(int option, ...);
All set able parameters can be set using the set command.
The first parameter specifies which option to set. The
defined constants corresponding to valid options are
defined in the header file splot.h. What follows is a very
brief description of all the values set able using set().
set(AXESCLIP,val);
If val is ON then the data values are clipped to the limits
of the axes box. This is temporarily added to the user set
clip limits if any. If val is OFF (the default) then the
user specified clip limits from the last clip() call are
used.
Alternatively the range of data values plotted can be set
using set(XRANGE,...); set(YRANGE,...); .
set(AXESTYPE,val);
AXESTYPE may be one of the following. LINEAR (the default),
LOGX, LOGY, LOGLOG, INVX, INVY, INVINV, INVXLOGY or
LOGXINVY. The position of data points and tickmarks are
automatically adjusted to account for the axes type.
set(CURSYMBOL,sym);
Sets the symbol to use when plotting data with symbols. sym
must be one of OCIRCLE,OSQUARE,OTRIANGLE,ODIAMOND
OSTAR,OARROW,PLUS,CROSS,MULT,CIRCLE,SQUARE,TRIANGLE,
DIAMOND,STAR,or ARROW. The default symbol is CIRCLE. The
size of a symbol can be changed using set(FONTWIDTH,
val_in_cm); since symbols are just a special font.
The size of a symbol can be changed using set(FONTWIDTH,
val_in_cm); since symbols are just a special font. The
size relative to the current FONTWIDTH can be set using
set(SYMMULT,mult);. To use symbol() to draw data points
in an axes box call cmatch() first to change the scale to
match that of the axes box.
set(FILLRULE,type);
Determines the rule to be used when filling a path. Type
must be one of NONZWIND (default) or EVENODD.
set(FLATNESS,num);
Sets the maximum allowable error in pixels when converting
a curve to a set of straight line segments. Smaller values
of num give smother curves but take longer to process. The
default value of num is 1.
set(FONT,fonttype);
Sets the font type to use for subsequent text written using
the text(); routine. fontname type be either SIMPLEX
(default) or COMPLEX.
set(FONTASPECT,asp);
Sets the ratio of the glyph height to width used for text
written using text();. The default value is 2.0
set(FONTDIR,angle);
Sets the rotation angle with respect to the x axis to use
when writing text using text(); The default is 0.
set(FONTMULT,factor);
Multiplies the current font size by the given factor.
set(FONTWIDTH,wid);
Sets the average width of the characters written using
text(). The default value is 0.7 cm. FONTWIDTH applies also
to symbols.
set(LABELMARG,val);
Sets the additional margin between the axes box and the
labels. The default is 0.0 cm.
set(LINECAP,type);
Determines how thick lines are to be terminated. The
allowed types are BUTTCAP (default), ROUNDCAP and PROJCAP.
set(LINECOLOUR,col);
Where col is one of INVIS, BLACK, BLUE, GREEN, CYAN, RED,
MAGENTA, BROWN or WHITE. This set the colour to use when
the current path is stroked or filled. The default colour
is BLACK with the background WHITE.
set(LINEJOIN,type);
Determines how thick lines are joined together. The allowed
join types are MITERJOIN (default), BEVELJOIN and
ROUNDJOIN.
set(LINESTYLE,pattern,...);
Sets the line style to use for the path when it is stroked.
The constant LINESTYLE is followed by a list of floating
point values that define the pattern. The values are
interpreted as the length along the path that the line is
visible followed by the length that it is invisible as an
alternating sequence wrapping back to the beginning when
the pattern reaches the end. For example a pattern of
1.0,1.0 implies on for 1 cm followed by off for 1 cm. A
pattern of 1.0,0.5 is on for 1 cm followed by off for 0.5
cm. The predefined patterns are: SOLID 0 (default) DASHED
1.0,0.5 DOTTED 0.2,0.2 and DOTDASH 1.0,0.5,0.2,0.5. There
must always be an even number of comma separated values
in a pattern definition.
set(LINEWIDTH,width);
Sets the line width to width cm (default 0.05 cm). This
line width is used when the current path is stroked.
set(MITERLIMIT,maxratio);
Sets the maximum length of spikes formed by miter joining
two lines at an acute angle. If the ratio of the length of
the spike to the width exceeds the value of maxratio then a
BEVELJOIN is done instead. The default value is 10.0.
set(PAGEROT,flag);
Selects landscape orientation if flag is ON.
Default is portrait.
set(PATTOFF,offset);
Sets the offset into the current LINESTYLE pattern. Can be
used to adjust the starting point of a pattern for aesthetic
reasons.
set(PLOTTYPE,type);
Sets the current plot type. type must be one of LINES
(default), SYMBOLS or SYM_LINES. LINES connects data points
with line segments while SYMBOLS causes the current symbol
to be drawn at each data point. SYM_LINES does both.
The size of a symbol can be changed using set(FONTWIDTH,
val_in_cm); since symbols are just a special font. The size
relative to the current FONTWIDTH can be set using
set(SYMMULT,mult);.
set(SCALEALL,val);
If val is ON then the XSHIFT, YSHIFT, XMULT, YMULT values
are applied to all coordinates (i.e. in lineto, moveto etc.).
The default is OFF in which case only data plotted using
plotdata(); or drawdata(); is affected by these values.
set(SCRIPTSCALE,val);
Sets the relative height of a super/sub script as compared
to ordinary text. The default value is 0.5.
set(SCRIPTSHIFT,val);
Sets the distance that a super/sub script is shifted
above/below ordinary text. The value is specified as a
fraction of the ordinary text height. The default value is
0.7.
set(SYMMULT,val)
Sets the symbol size multiplier used when drawing symbols.
The default value is 1.0. The actual symbol size is
determined the current FONTWIDTH multiplied by the curent
SYMMULT value.
set(TICKLENGTH,len);
Sets the length of axis tick marks to be used. The default
value is 0.3 cm.
set(TICKLMARG,len);
Sets the margin between the axes box and the tick labels.
The default is 0.0 cm.
set(XMULT,xmul);
Causes each x value to be multiplied by xmul before being
plotted.
set(XRANGE,xmin,ymin);
data plotted using drawdata is constrained to have x
values between xmin and xmax. There is also a corresponding
YRANGE set option. The default is no constraints. The
values should be specified in user coordinates i.e. those
established by the current axes_box() or ascale().
set(XSHIFT,xshft);
Causes the value xshft to be added to all x values before
plotting.
set(YMULT,ymul);
Causes each y value to be multiplied by ymul before being
plotted.
set(YSHIFT,yshft);
Causes the value yshft to be added to all y values before
plotting.
<showpage>
void showpage();
Transfers the marked page created in memory by the stroke
and fill commands to the physical page. This is
automatically done at the end of the file and thus this
command is only needed if it is desirable to draw parts
of the figure before the end of execution.
<splineto>
void splineto(double x1,y1,x2,y2,...);
or
void splineto(double *array,int first,int last);
or
void splineto(double *array);
This function accepts a list of two or more coordinate
pairs and using the current point as the first point draws
a cubic spline which goes through all of the given
coordinates. It uses Bezier curves internally but
calculates the necessary control points in order to make
the derivative continous everywhere. An error is generated
if there is no current point. Specifying less than two
additional points also generates an error. Several formats
are allowed. The first is a list of coordinate pairs. The
second format is a pointer to a 2D array of coordinate
pairs followed by an optional pair of integers specifying
the first and last pairs to be plotted.
<stroke>
void stroke();
Marks the page in memory with the current path. The path
coordinates are transformed using the current coordinate
transformation matrix and the path is fleshed out using the
current line width, style and colour in effect at the time
of the stroke command.
<symbol>
void symbol(double x, double y, int symbol_const);
or
void symbol(int symbol_const);
Plots the symbol chosen by symbol_const at the point x,y.
symbol_const must be one of OCIRCLE, OSQUARE, OTRIANGLE,
ODIAMOND OSTAR, OARROW, PLUS, CROSS, MULT, CIRCLE, SQUARE,
TRIANGLE, DIAMOND, STAR,or ARROW. If the point x,y is
omitted the symbol is drawn at the current point as set
by a previous moveto();. symbol() is not implicitly
stroked so follow with a stroke();. The size of a symbol
can be changed using set(FONTWIDTH, val_in_cm); since
symbols are just a special font. The size relative to the
current FONTWIDTH can be set using set(SYMMULT,mult);.
<text>
void text(double x, double y, char * str,int just);
Adds the text string str to the current path starting at
location (x,y). The current font, size and orientation as
set using the set() command are used. Super/sub scripts can
be entered as ^2^ and _2_ respectively. Letters surrounded
by '!' or '#' are printed in Greek or italics respectively.
For example !m! generates the Greek lower case mu. The
special characters "^_!#$\" can be printed by preceding them
with \ as in \!. The combination \b back spaces by one
character. Symbols may be included in the text string by
enclosing them with $ as in $3$.
If the starting x,y coordinates are omitted then
the current string is positioned one line below the
previous string added to the path using text(). The last
parameter is the justification and must be one of LEFT,
RIGHT or CENTER. This last parameter can be omitted in
which case the default value of LEFT will be used. text()
is implicitly stroked.
<ticklabel>
void ticklabel(int axis, double v, char *label,...);
Add tick labels to the axes box previously defined. The
first parameter is which axis to label either BOTTOM, TOP,
LEFT or RIGHT. The following parameters are paired values
giving the tick position in data coordinates as established
by a prior call to axes_box() or ascale() and the text
string to be placed at that location. An error is generated
if there is no current axes_box. There are several default
possibilities. If 'ticklabel();' is called without any
parameters then if tick marks have been generated
previously using 'tickmarks();' then they will be
selectively labelled along the left and bottom axes. If
only an axis parameter is given then the corresponding axis
tick marks if any will be labelled. If the axis parameter
is followed by a list of numbers only they will be
assumed to be both the tick position and the desired label.
If the numbers are paired with strings in the parameter
list then the number will be used as the tick label
position and the string will be used as the literal label.
The spacing between the tick labels and the axes box can be
changed using set(TICKLMARG,...); ticklabel() is implicitly
stroked.
<tickmarks>
void tickmarks(int axis, double v,...);
Add tick marks to the axes box previously defined. The
first parameter is which axis either BOTTOM , TOP, LEFT,
RIGHT ,XAXES or YAXES. The following numbers are the
positions were tickmarks are to to be placed. The length of
the ticks is set using a set(TICKLENGTH,val) command. The
tickmarks will be drawn using the current linestyle and
colour. The location of the ticks is specified in data
coordinates as established by the prior call to axes_box().
An error is generated if there is no current axes_box. All
the above parameters are optional. The default behaviour is
as follows. If all parameters are omitted tick marks will
be automatically generated for all axes. If only an axis
specifier is given then tick marks will be generated for
the corresponding axis or axes. In these cases
'tickmarks();' will try to find reasonable positions for a
set of tick marks. If this default behaviour is
unacceptable then the actual tick positions can be
specified as a list of values following the axis specifier.
If there is only one numeric value it is interpreted as a
tick spacing. tickmarks() is implicitly stroked.
<translate>
void translate(double tx, double ty);
Translates the origin of the
figure by the x and y distances
specified. Translations are
cumulative.
<whereis>
void whereis(double *x,double *y);
Returns the coordinates of the current point as set by the
last moveto(), lineto() etc.