@DATABASE RI Misc Lib V2.5
@Author Conversion program
@NODE OVERVIEW "Overview of RI Misc Lib V2.5"

                                  @{b}@{u}Overview@{ub}@{uu}

This library has been written because the @{"RIAMOSFunc library" link Blitz2:REDHelp/REDBlitzLibs/RIAMOSFuncLib.guide/MAIN} has
reached the point where any extra command additions would make the library
size (and hence any compiled programs which use the library) too big for
comfort.

@ENDNODE OVERVIEW

@NODE TimerReset "RI Misc Lib V2.5"

@{fg shine}Statement: TimerReset@{fg text}
-----------------------------------------------------------------------------
Mode   : Amiga/Blitz
Syntax : TimerReset

  This will reset the CIA timer to 0.

See: the @{"Examples" link Examples} page.

@ENDNODE TimerReset

@NODE PortSigBit "RI Misc Lib V2.5"

@{fg shine}Function: PortSigBit@{fg text}
-----------------------------------------------------------------------------
Mode   : Amiga/Blitz
Syntax : bit.b=PortSigBit(port.l)

  This function will return the signal bit number for the specified port.
Results will lie between 0 and 31.

@ENDNODE PortSigBit

@NODE WorkbenchHere "RI Misc Lib V2.5"

@{fg shine}Function: WorkbenchHere@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : status=WorkbenchHere

  This function determines whether or not the Workbench is open or closed.
It returns -1 if it is open else 0 if its closed.

@ENDNODE WorkBenchHere

@NODE EZRequest
@{fg shine}Statement/Function: EZRequest@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga
Syntax : [choice=]EZRequest([title$,]body$[,gad$]) 
         EZRequest title$,body$,gad$[,arg1..]

  This command calls the intuition EasyRequest() function to bring up the
standard requester. If title$ is omitted, the title of the requester will be
"System Request". If gad$ is omitted, the response button will default to
"Ok".

body$ is the text body part of the requester. New lines are represented
by the | character.

gad$ is the response gadget string. Responses are delimited by the |
chracter.

e.g.

  NPrint EZRequest("Request","Its Sunday|The time is 12:23pm","So|What")
  NPrint EZRequest("Its Sunday|The time is 12:23pm")
  NPrint EZRequest("Its Sunday|The time is 12:23pm","So|What")
 

The [arg1..] parameter represents a list of optional arguments.

e.g.

EZRequest "Request","Its %s|Time is %ld:%ld%s","So|What","Sunday",12,23,"pm"


A value of %s inside body$/gad$ represents a string parameter
A value of %ld represents a longword
A value of %d represents a word
A value of %d represents a float

@ENDNODE EZRequest

@NODE Flip$ "RI Misc Lib V2.5"

@{fg shine}Function: Flip$@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : a$=Flip$(b$)

  This function will reverse the order of character stored in b$ and put the
result in a$

e.g.

    NPrint Flip$("LWEK SI ZTILB")
  
    BLITZ IS KEWL

@ENDNODE Flip$

@NODE ParseInit "RI Misc Lib V2.5"

@{fg shine}Statement: ParseInit@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : ParseInit String$

  This will initialize the argument parsing routine. The String$ argument
is the argument string you wish to operate on.

e.g.

     a$="OPEN FILE C:DIR SHARED"
     ParseInit a$

@ENDNODE ParseInit

@NODE NextParseArg$ "RI Misc Lib V2.5"

@{fg shine}Function: NextParseArg$@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : arg$=NextParseArg$

  This will return the next argument from the string that was passed to
ParseInit.

e.g.    
 
   a$="OPEN FILE C:DIR SHARED"
   ParseInit a$
   Repeat
     b$=NextParseArg$
     IF b$<>"" Then NPrint b$
   Until b$=""


output:   OPEN
          FILE
          C:DIR
          SHARED

@ENDNODE NextParseArg$

@NODE EZRequestArgs "RI Misc Lib V2.5"

@{fg shine}Statement/Function: EZRequestArgs@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga
Syntax : EZRequeatArgs arg1[,arg2[,arg3..]]

  This function is mainly intended for use whilst debugging your programs.
It provides a quick and easy way of showing variable contents.

No title, bodytext or gadgets are supplied, they use the default (window
title, argument values as body, "Ok" for button).

Each argument in the requester is, by default, separated by a new line.

See: EZSeparator

@ENDNODE EZRequestArgs

@NODE EZOutput "RI Misc Lib V2.5"

@{fg shine}Statement: EZOutput@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga
Syntax : EZOutput [window#]

  This statement will cause all future EZRequest/EZRequestArgs calls to open
the requester on the same screen as the specified window. If you do not pass
a window number, they will pop-up on the default public screen by default.

@ENDNODE EZOutput

@NODE EZSeparator "RI Misc Lib V2.5"

@{fg shine}Statement: EZSeparator@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : EZSeparator char

  This statement is for use with EZRequestArgs. It lets you alter the default
character used for separating arguments.

@ENDNODE EZSeparator

@NODE ProgPath$ "RI Misc Lib V2.5"

@{fg shine}Function: ProgPath$@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga
Syntax : pa$=ProgPath$

  This function returns the full AmigaDOS path for the current program.
If run as resident or from inside Blitz, the result is the current directory
name and the current task name.

@ENDNODE ProgPath$

@NODE ProgName$ "RI Misc Lib V2.5"

@{fg shine}Function: ProgName$@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga
Syntax : na$=ProgName$

  This function returns just the name component of the path for the current
program. If executed from Blitz, this will return the task name.

@ENDNODE ProgName$

@NODE ProgDir$ "RI Misc Lib V2.5"

@{fg shine}Function: ProgDir$@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga
Syntax : di$=ProgDir$

  This function will return just the directory component of the current
program's path. If executed from Blitz or as a resident prgoram, this will
return the current directory.

@ENDNODE ProgDir$

@NODE FromBlitz "RI Misc Lib V2.5"

@{fg shine}Function: FromBlitz@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : mode=FromBlitz

  This function determines whether the current program is being executed
from within the Blitz interpreter or whether it has been compiled to an
executable standalone program. -1 indicates Blitz, 0 means executable.

@ENDNODE FromBlitz

@NODE LtoS "RI Misc Lib V2.5"

@{fg shine}Function: LtoS@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : l$=LtoS(longword)

  This performs an identical function as Mkl$ (it converts a longword into
a four character string). Non-ASCII characters are replaced with character
128.

@ENDNODE LtoS

@NODE RawASC "RI Misc Lib V2.5"

@{fg shine}Function: RawASC@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : rawcode=RawASC(char$)

  This converts a single letter ascii character string into its RAWKEY code
equivalent. (Note shifted characters (eg A,!,< etc) do not have a rawkey
value.

@ENDNODE RawASC

@NODE ASCRaw "RI Misc Lib V2.5"

@{fg shine}Function: ASCRaw@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : chr$=ASCRaw(rawcode)

  This converts a RAWKEY code into a single ASCII character.

@ENDNODE ASCRaw

@NODE OpenFontPrefs "RI Misc Lib V2.5"

@{fg shine}Statement/Function: OpenFontPrefs@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga
Syntax : [suc=]OpenFontPrefs[(filename$)]

  This will read the system Font preferences into memory, in preparation for
use of the @{"DefaultFontHeight" link DefaultFontHeight} and @{"DefaultFontName" link DefaultFontName} commands.

If filename$ is omitted, the file ENV:sys/font.prefs is used

@ENDNODE OpenFontPrefs

@NODE ClsoeFontPrefs "RI Misc Lib V2.5"

@{fg shine}Statement: CloseFontPrefs@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga
Syntax : CloseFontPrefs

  This will free up memory allocated by the @{"OpenFontPrefs" link OpenFontPrefs} command.

@ENDNODE CloseFontPrefs

@NODE DefaultFontHeight "RI Misc lib V2.5"

@{fg shine}Function: DefaultFontHeight@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : height=DefaultFontHeight(fonttype)

  This will return the height of the default font specified by <fonttype>

fonttype can be one of 3 values :

	Value		Meaning
	  0		Workbench Icon Font
	  1		Default System Font
	  2		Default Screen Font

@ENDNODE DefaultFontHeight

@NODE DefaultFontHeight "RI Misc lib V2.5"

@{fg shine}Function: DefaultFontName@{fg text}
-----------------------------------------------------------------------------
Modes  : Amiga/Blitz
Syntax : height=DefaultFontName(fonttype)

  This will return the name of the default font specified by <fonttype>

fonttype can be one of 3 values :

	Value		Meaning
	-----------------------------------
	  0		Workbench Icon Font
	  1		Default System Font
	  2		Default Screen Font

@ENDNODE DefaultFontName

@NODE MAIN "RI Misc Lib V2.5"
.-----------------------------------------------------------------------------.
|                              @{b}RI Misc Lib V2.5@{ub}                               |
`-----------------------------------------------------------------------------'

                         ©1996 Red When Excited Ltd

                             @{"     Overview     " link OVERVIEW}

                               Command Index                                

             @{" ASCRaw            " link ASCRaw}                @{" EZOutput          " link EZOutput}
             @{" EZRequestArgs     " link EZRequestArgs}                @{" EZSeparator       " link EZSeparator}
             @{" Flip$             " link Flip$}                @{" FromBlitz         " link FromBlitz}
             @{" LtoS              " link LtoS}                @{" NextParseArg$     " link NextParseArg$}
             @{" ParseInit         " link ParseInit}                @{" PortSigBit        " link PortSigBit}
             @{" ProgDir$          " link ProgDir$}                @{" ProgName$         " link ProgName$}
             @{" ProgPath$         " link ProgPath$}                @{" RawASC            " link RawASC}
             @{" TimerReset        " link TimerReset}                @{" WorkbenchHere     " link WorkbenchHere}
             @{" OpenFontPrefs     " link OpenFontPrefs}                @{" CloseFontPrefs    " link CloseFontPrefs}
             @{" DefaultFontHeight " link DefaultFontHeight}                @{" DefaultFontName   " link DefaultFontName}

                                @{" Examples " LINK Examples}

                              @{" Main Document " LINK "Blitz2:REDHelp/REDBlitzLibs/REDBLITZLIBS.GUIDE/MAIN"}
                              @{" Library Index " LINK "Blitz2:REDHelp/REDBlitzLibs/REDBLITZLIBS.GUIDE/LIBRARYLIST"}

@ENDNODE MAIN

@NODE Examples "Example Programs"

                             @{b}@{u}Example Programs@{ub}@{uu}

@{fg shine}EXAMPLE 1@{fg text} - Example usage of RI MiscLib commands :

	@{" Load Example 1 " system "run >NIL: Blitz2:REDHelp/ShowExample FILE=Blitz2:REDHelp/REDBlitzLibs/Examples/RIMiscLib1.bb"}
	@{" Compile It!    " system "run >NIL: Blitz2:REDHelp/REDBlitzLibs/ShowExample FILE=COMPILE"}

@ENDNODE Examples
