F


f!
( fn addr --- )
"f-store". Store the floating point value, fn, at address specified by addr.
      f# 3.1417 pi f!
moves 3.1417 into the floating point variable pi.
~~~
f#
( --- f# )
"f-number". Interpret the next number in the input in the input stream as a floating point number.
     f# 123.45  float-foo f!

f*
( f1 f2 --- f-product )
"f-star". Multiply two floating point numbers leaving the result on the floating point stack.
     f# 2.0  f# 2.0 f* f.
     4.00
multiplies 2.0 by 2.0 and prints the result on the screen.
f+
( f1 f2 --- f-sum )
"f-plus". Add f1 to f2. The sum is placed on the top of the floating point stack.
      f# 1.0 f# 2.0 +
The result, 3.0, is left on the top of the floating point stack.
f-
( f1 f2 --- f3 )
"f-minus". Subtract f2 from f1 and place the result on the top of the floating point stack. (f1-f2=f3).
      f# 2 f# 1 f-
The result, 1.0, is left on the stack.
f.
( fn --- )
"f-dot". Display the number at the top of the floating point stack to the screen. This is a stack destructive operation.
f.s
( ? --- ? )
"f-dot-s". Non-destructive floating point stack display to the screen.
f/
( f1 f2 --- fquotent )
"f-divide". Divide f1 by f2. (f1/f2).
      4 2 /
Leaves 2.0 on the top of the floating point stack. There is no remainder.
      f# 9 f# 2 f/ 
computes to 4.50.
f<
( f1 f2 --- tf )
"f-less-than". Compare the two numbers on the top of the stack and return TRUE or FALSE.
      f# 5 f# 6 f<          ( RETURNS true  )
      f# 5 f# 5 f<          ( RETURNS false )
      f# 6 f# 5 f<          ( RETURNS false )

f=
( f1 f2 --- tf )
"f-equal". Compare the top two values on the stack for equality.
      f# 5 f# 6 f=         ( returns false )
      f# 5 f# 5 f=         ( returns true  )
      f# 6 f# 5 f=         ( returns false )

f>
( f1 f2 --- tf )
"f-greater-than". Compare the top two floating point stack entries. (f1>f2).
      f# 5 f# 6 f>          ( returns false )
      f# 5 f# 5 f>          ( returns false )
      f# 6 f# 5 f>          ( returns true  )

f@
( addr --- fn )
"f-fetch". Fetch the floating point value from address and place on the top of the floating point stack.
      ftrash f@
retrieves the value stored at ftrash and places it on the top of the floating point stack.
fclose
( fd --- )
"f-close". Close the file whose file descriptor is fd.
fconstant
( --- fn )
"f-constant". Create a floating point constant. The compile time stack comment is ( fn --- ). Typical usage is:
      f# 3.1416 fconstant pi
When pi is referenced, the floating point value 3.1416 is pushed onto the floating point stack:
      pi    ( --- 3.1416 )

fcr
( fd --- status )
"f-c-r". Write a carriage return (well actually a newline) to the output file specified by fd.
      descriptor @ fcr

fdrop
( f1 --- )
"f-drop". Remove the top number from the floating point stack.
fdup
( f1 --- f1 f1 )
"f-dup". Duplicate the number on the top of the floating point stack.
      f# 1.0 f# 1.0 fdup
Results in two 1.0s on the floating point stack.
feof
( fd --- 0|eof )
"f-e-o-f". Test the specified stream, fd, for end of file. A zero return means not at EOF. Eof is returned if the last file operation encountered end of file.
   descriptor @ feof
        if   ." Got eof"
        else ." Not eof" then

ferror
( fd --- tf )
"f-error". This word tests the file stream for read or write error. FALSE means no error and TRUE indicates an error has occurred.
        descriptor @ ferror
        if   ." File error"
        else ." No error" endif

fence
( --- )
"fence". This is a special word that forget will not forget past. It protects the default word set from being accidentally deleted.
fflush
( fd --- )
"f-flush". This word flushes the system output buffer for the file specified by fd. The file must have been opened previously by a call to fopen. fflush only makes sense for output files.
        descriptor @ fflush

fgetc
( fd --- c )
"f-get-c". Read the next character from the file specified by the file descriptor fd. The character is true (-1) on End of File.
        descriptor @ fgetc

fgets
( addr size fd --- count )
"f-get-s". Read the next string of a max length of size into the buffer at addr from file fd. The count is the number of bytes actually read or 0 for End of File. A "string" is logically a line in the file. The trailing newline character is included in the result string. fgets reads up to the new line character.
        buffer size descriptor @ fgets
        0= if ." EOF" then
Empty lines have a length of one because fgets reads the trailing <newline> as part of the buffer.
fill
( addr len byte --- )
"fill". Fill memory starting at addr for a length of len with the value specified by byte.
      trash 20 0 fill
will copy 20 zeros into the memory starting at the address of trash.
fload
( --- )
"f-load". fload loads a .BIN file.
	fload anyfile.bin

float>
( f1 --- n )
"from-float". Convert a floating point number to integer.
     f# 123.456 float>
leaves 123 on the parameter stack.
fnsplit
( 'filename --- 'drive 'dir 'file 'ext )
"f-n-split". Break the filename contained in the string whose address is on the top of the stack into its component parts.
        " c:\until\outer.c" fnsplit
        .( Extension> ) dup strlen type cr
        .( File     > ) dup strlen type cr
        .( Dir      > ) dup strlen type cr
        .( Drive    > ) dup strlen type cr

fopen
( 'filename 'fmode --- fd )
"f-open". Open the file whose name is stored in 'filename and has a valid C file mode string. The predefined file modes in Until are BINARY, READ, WRITE, or APPEND. The file descriptor, fd, should be saved and is used other file words to refer to the file.
      : test " filename" READ fopen
The predefined modes are:
for
( n --- )
"for". Start a for ... next loop. n is the number of times to execute the words up to the next.
      : xxx   for i . next ;
      5 xxx
executes the loop 5 times.
forget
( --- )
"forget". Forget the word following in the input stream:
      forget aword
Forget stops at fence. It calls abort if the word is not found in the dictionary. The term forget means to remove all word definitions from the dictionary starting with the latest word back to and including the word to forget.
forth
( --- )
"forth". This is the base vocabulary in this system.
forth-83
( --- )
"forth-83". Types the message "Until is almost Forth-83 compatible."
fover
( f1 f2 --- f1 f2 f1 )
"f-over". Copy f1 to the top of the floating point stack.
      f# 1 f# 2 fover
results in ( 1.0 2.0 1.0 ).
fprintf
( a1 a2 ... an 'format fd --- )
"f-print-f". This is the C fprintf() function. The top of the stack contains a file descriptor, fd, followed by the format string, 'format. 'format is a C fprintf() format string such as:
   " A string: %s  or a decimal number: %d"
The arguments to fprintf are in the order used. For example:
   " string" 65 " A string: %s  or a decimal number: %d\n" fd @ fprintf
will write:
   A string: string  or a decimal number: 65
with a trailing newline character to the file descriptor fd. The first argument goes with the first format specifier (" string" and the %s) and the second argument goes with the second format specifier (65 and %d) in this case.

Note that floating point values cannot be used with fprintf. Use fprintf_f to output floating point values.


fprintf_f
( a1 a2 ... an 'format fd --- )
"f-print-f-underscore-f". This is the C fprintf() function. fprintf_f can only be used to out floating point values. The top of the stack contains a file descriptor, fd, followed by the format string, 'format. 'format is a C fprintf() format string such as:
   " A floating point number: %e"
The arguments to fprintf_f are in the order used. For example:
   f# 123.456 " A floating point number: %e\n" fd @ fprintf_f
will write:
   A floating point number: 123.4560
with a trailing newline character to the file descriptor fd. The first argument goes with the first format specifier (123.456 and the %e).

Note that only floating point values can be used with fprintf_f. Use fprintf to output other values.


fputc
( ch fd --- status)
"f-put-c". Write the character, ch, to the file whose descriptor is fd. The status of the write is returned. The status is either the character on a successful write or EOF on error.
        ascii A fd@ fputc drop

fputline
( 'string fd --- status )
"f-put-line". Write the string whose address is next to the top of the parameter stack to the file whose file descriptor, fd, is on the top of the stack. A <CR> is appended to the string before being written. status is EOF when an error occurs.
fputs
( 'buffer fd --- status )
"f-put-s". Write the string whose address is specified by buffer to the file descriptor, fd. status is the last character written on success or EOF on error.
        string fd @ fputs drop

fread
( addr len fd --- status )
"f-read". Read a block of data from a disk file. This word eventually calls fread(). It reads len bytes into the buffer that starts at addr. The status is the number of bytes read on success or zero for end of file.
free
( addr --- )
"free". Return memory allocated by malloc to the system. See malloc for an example.
frot
( f1 f2 f3 --- f2 f3 f1 )
"f-r-o-t". Rotate the third value on the floating point stack to the top. The other values are pushed down one cell.
      f# 1 f# 2.0 f# 3.0 frot
results in (2.0 3.0 1.0).
fseek
( whence offset fd --- status)
"f-seek". This word positions the file, fd, to the offset specified by offset. The offset is not necessarily the relative number of bytes from the beginning of the file. whence can be:
   0 Beginning of the file (SEEK_SET)
   1 From the current file position (SEEK_CUR)
   2 End of the file (SEEK_END)
The status is zero on success and non-zero on error. DOS only returns an error when attempting to position a file that has not been opened. Other operating systems may return additional errors.
fswap
( f1 f2 --- f2 f1 )
"f-swap". Swap the top two entries on the top of the floating point stack.
      f# 1.0 f# 2.0 fswap
results in the top stack entry being 2.0 and the second entry being 1.0.
ftell
( fd --- offset)
"f-tell". Return the file offset for the file specified by fd. An offset of -1 indicates an error. Most C compilers return the number of bytes from the beginning of the file, but this is not guaranteed!
fvariable
( --- 'fvariable )
"f-variable". At compile time, creates a floating point variable:
      fvariable ftrash
The compile time stack comment for variable is ( --- ). At run time, push the address of the floating point variable onto the stack:
      ftrash    ( --- addr.of.trash )

fwrite
( addr len fd --- status )
"f-write". Calls the C function fwrite(). It writes the buffer at addr for a length of len bytes to the file specified by fd. Status is the number of bytes written or zero for an error.

Table of Contents
Next Section