Omikron BASIC for Apple Power Mac

5-10. SCREEN - TEXT HEIGHT Contents | 5-12. Index of Command Groups

 

Chapter 5-11

The Command Set

TEXT ROTATION - XOR


TEXT ROTATION
Type: Command
Syntax: TEXT ROTATION=<num.expression>
TEXT ROTATION=<angle>
Explanation: This command sets the angle by which a graphics text issued with TEXT is rotated. Angles are expressed in 1/10 degree (that is, 900 corresponds to 90 degrees). Rotation occurs in a mathematical positive sense (counterclockwise) and by the point (X,Y), which you indicate with the following TEXT commands (TEXT X,Y,T$). Currently, only the values 0, 900, 1800, and 2700 as well as their corresponding negative values are possible for <angle>. Some printers, depending on the driver, may offer additional values.

Note: Since most of the device drivers (e.g., for monitor and many printers) do not support text rotation, Omikron Basic features its own rotation routine. The rotation is realized on postscript-enabled printers with so-called "Picture Comments." In these cases, you will receive the rotated text in a high print resolution. If the connected printer cannot understand "Picture Comments," then Omikron Basic's rotation routine for the monitor jumps into action. However, this rotation routine does not provide a higher resolution for the rotated text than displayed on the monitor either.
Example:
TEXT ROTATION = 2700
TEXT 10,10,"Text moves down."
Result:

    Starting at point (10,10), the text is moved down.

See also: TEXT
 


TEXT STYLE
Type: Command
Syntax: TEXT STYLE=<num.expression>
TEXT STYLE=<style attribute>
Explanation: Defines the style attributes of the graphics text to be output with TEXT. In this case, every bit in <style attribute> has a text effect. If set, the effect is used. Any combination is permitted. The individual bits have the following purpose:

Bit 0: Bold
Bit 1: Italic
Bit 2: Underlined
Bit 3: Outlined
Bit 4: Shadowed
Bit 5: Condensed
Bit 6: Extended
Example:

    TEXT STYLE = 1
    TEXT 10,20,"This text appears bold"
    TEXT STYLE = 2 + 4
    TEXT 10,40,"This text, however, is in italics and underlined"

Result:

    This text appears bold
    This text, however, is in italics and underlined

See also:  TEXT    Set_Text_Face
 

THEN
Type: Command
Syntax: THEN
Explanation: Located behind an IF statement and will be executed at the precise moment the statement behind IF is true (not equal to 0).
Example:

    IF 1=1
    THEN PRINT "1 equal 1"
    PRINT "That is always true!"
    ELSE PRINT "0 is not equal to 1"
    PRINT "This text is never printed!"
    ENDIF

Result:

    1 equals 1
    That is always true!

See also:  IF   ELSE   ENDIF
 


TIME$
Type: Command
Syntax: TIME$=<string expression>
Explanation: Assigns the time <string expression> to the system clock. The string expression must be in the form "HH:MM:SS" (H=hour, M=minute, S=second) utilizing the 24-hour clock format.

Note: Your local time format might differ from the one indicated here. Please pay attention to any differences.
The time passed since booting the computer determinable with TIMER is not affected.
Example:  
Result:  
See also:  TIME$ as Function   DATE$ as Command    TIMER 

 

TIME$
Type: Function
Syntax: TIME$
Explanation: Returns the system clock as a string. The format corresponds to the one set by the user in the computer's control field 'Date & Time'.
Example:  
Result:  
See also:  TIME$ as Command    DATE$ as Function    TIMER 

 

TIMER
Type: Function
Syntax: TIMER
Explanation: Returns the time passed since booting the computer in 1/200 seconds.
Example:

    T=TIMER
    FOR I=0 TO 10000000
    NEXT I
    PRINT (TIMER-T)/200

Result:

    The time needed by the computer to pass the FOR ... NEXT loop 10 million times is returned in seconds.

See also: TIME$ FN Microseconds#
 


TROFF
Explanation: Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use.
 

TRON
Explanation: Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use.
 


TUNE
Type: Command
Syntax: TUNE <num.expression>,<num.expression>[[,<num.expression>,<num.expression>]]
TUNE <sound channel>,<frequency>[[,<sound channel>,<frequency>]]
Explanation: This command may be used to adjust the sound frequency. A value between 0 and 15 must be passed in <sound channel>. The parameter <frequency> may have values of 0 to 127. 0 is the lowest, 127 the highest sound.
Up to 16 different sound channels can be modified with one command.

Note: In order to hear the sound, a sound volume must be assigned to the corresponding channels using VOLUME.
Example:

    VOLUME 0,255,1,255,2,255
    NOISE 0,0,1,0,2,0
    T=0:Dt=12
    REPEAT
    TUNE 0,T,1,T+4,2,T+7:'Chord c-e-g
    WAIT 1:T+=Dt
    IF T<=0 or T>=120 then Dt*=-1
    UNTIL LEN(INKEY$)

Result:

    First, the sound channels 0,1 and 2 are set to max. sound volume and max. purity. Then the program plays the chords c-e-g, whereby the frequency per loop cycle is increased or decreased by one octave. In order to hear the chords long enough, a WAIT 1 command was inserted.

See also:  VOLUME   NOISE    MIDI Notes and Frequency Table
 


UNTIL
Type: Command
Syntax: UNTIL <log.expression>
UNTIL <end condition>
Explanation: Ends the REPEAT ... UNTIL loop. The loop is executed until the end condition is true.
Example:  
Result:  
See also:  REPEAT   NEXT    WEND   EXIT
 


UNLIST
Type: Reserved keyword
Explanation: May not be employed by the user.
 


UPPER$
Type: Function
Syntax: UPPER$(<string expression>)
Explanation: Converts all letters contained in the string expression to uppercase letters. If MODE "D" is set, the umlauts ä, ö, ü  will be converted as well. Counterpart for this function is LOWER$.
Example:  
Result:  
See also:  LOWER$    MODE 
 


USING
Type: Command
Syntax: USING [<string expression>]
Explanation: Establishes the output format for the commands PRINT, LPRINT, PRINT #, and the function STR$. The command USING without <string expression> switches back to normal output again. The characters permitted in the string expression and their effect is explained under PRINT USING.
Example:  
Result:  
See also:  PRINT USING    LPRINT   STR$
 


USR
Type: Function
Syntax: USR(<num.expression>)
Explanation: The machine language function defined with DEF USR is called. The parameter will be passed in the R3 register. The value contained in the R3 register is returned to the BASIC program as a functional result.
Only those registers declared by Apple as 'volatile' may be changed. These are in detail:
R0,R3-R12 FPR0-FPR13 CR0,CR1,CR5-CR7
R31 points to the dynamic stack. The program must be concluded with 'Blr'. If the link register is changed, care has to be taken to restore it again before returning.
Omikron Basic cannot intercept errors caused by the machine program. Therefore, it is recommended to start a suitable debugger first for the duration of the test phase.

Caution: If the USR function is called without first defining an entry address with DEF USR, it is rather likely that the entire computer will crash because a jump to an undefined address was attempted.
Example:  
Result:  
See also:  DEF USR   CALL   INLINE 
 


VAL
Type: Function
Syntax: VAL(<string expression>)
Explanation: If possible, the string expression is converted to a numerical result. The string expression is read from left to right until all valid numerals have been read. Leading blanks are skipped.

Valid numerals are: $ & % 0 1 2 3 4 5 6 7 8 9 + - . D E

Note: VAL may also be used for converting between different number systems by adding the prefixes "$" or "%" (e.g., HEX --> decimal).
Example:

    Hex_In$="0u+A+B+C+D+E+F" :Number$=SPACE$(2)
    INPUT "Input a HEX number: ";Number$ USING Hex_In$,R,2
    PRINT
    Number$= RIGHT$("000"+Number$,3)
    PRINT Number$;"h is decimal: "; VAL("$"+Number$)

Result:

    The entered hexadecimal number is converted to a decimal number and displayed on the screen.

See also:  STR$    BIN$    HEX$    OCT$ 

 

VARPTR
Type: Function
Syntax: VARPTR(<variable>)
Explanation: VARPTR determines the address of a variable, field, or function and is identical with the operator "&." A precise explanation may be found there.
Example:

    'Search for greatest element'
    DIM Values#(10)
    PRINT FN Get_Max#(VARPTR(Values#()),5) 'Only the first 6
    END

    DEF FN Get_Max#(Pointer,N)
    LOCAL I,Maximum#=0#
    FOR I=0 TO N
    Maximum#=MAX(*Pointer#(I),Maximum#)
    NEXT I
    RETURN Maximum#
    END_FN

Result:

    0

See also:  & (Address Operator)   SEGPTR   Memory Organization in Omikron Basic 
 


VDI
  Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use.
 


VERSION
Type: Function
Syntax: VERSION
Explanation: Returns the version number of the Omikron Basic compiler used for compilation.
Example:  
Result:  
 


VOLUME
Type: Command
Syntax: VOLUME <num.expression>,<num.expression>[[,<num.expression>,<num.expression>]]
VOLUME <sound channel>,<sound volume>[[,<sound channel>,<sound volume>]]
Explanation: The respective sound volume is assigned to the specified sound channels. A value between 0 and 15 must be passed in <sound channel>. Values of 0 to 255 may be assigned to <sound volume>. Zero (0) means that the sound is off; 255 is maximum sound volume.
Up to 16 different sound channels can be changed with one command.

Note: In order to hear the sound, a frequency must be assigned to the corresponding channels using TUNE.
Example:

    TUNE 0,60:'Create the middle c'
    T=0:Dt=1
    REPEAT
    VOLUME 0,T:WAIT 0.01
    T+=Dt
    IF T<=0 or T>=255 then Dt*=-1
    UNTIL LEN(INKEY$)

Result:

    First, a sound is created (the middle c). The sound volume in the loop is then alternately increased and decreased.

See also:  NOISE   TUNE   Table of MIDI Notes
 


WAIT
Type: Command
Syntax: WAIT <num.expression>
Explanation: Waits the time in seconds indicated in the numerical expression. During this time, other processes can continue to run. The system is thus not blocked by WAIT. However, if another process blocks the system during the waiting period, a result might be an increase of the effective waiting period.
Example:

    T=TIMER
    REPEAT
    PRINT "This loop runs precisely 5 seconds"
    WAIT 0.5
    UNTIL TIMER>T+200*5

Result:

    The text standing behind PRINT is output at intervals of 0.5 seconds until 5 seconds have passed by.

 

WEND
Type: Command
Syntax: WEND
Explanation: Ends the WHILE ...WEND loop.
Example:  
Result:  
See also:  WHILE    EXIT    NEXT    UNTIL 
 


WHILE
Type: Command
Syntax: WHILE <num.expression>
WHILE <log.expression>
Explanation: A program loop is triggered with WHILE, which repeats the commands that are dependent on this loop until the logical expression is not met any longer (equal 0). The condition is always checked at the beginning of the loop, i.e., the WHILE ... WEND loop is a rejecting loop. If the condition is not met immediately at the beginning, none of the dependent commands are executed and a branch leading to the end of the loop (behind the WEND) is created.
Example:

    OPEN "I",1,FN Get_Fsspec$(0,0,"NEWOMBAS.INF")
    WHILE NOT EOF(1)
    PRINT INPUT$(1,1);
    WEND
    CLOSE 1

    PRINT "Please, enter several words separated by blank characters:"
    INPUT Sentence$
    P=INSTR(Sentence$," ")
    WHILE P
    PRINT "Blank character found in position:"; P
    P=INSTR(P+1,Sentence$," ")
    WEND

Result:

    First, the content of the NEWOMBAS.INF file is read character by character and displayed on the screen.
    The user has been requested to enter several words in the second example. The program then searches this string for blanks and displays the results on the screen.

See also:  REPEAT   FOR   EXIT 
 


WPEEK
Type: Function
Syntax: WPEEK(<num.expression>)
WPEEK(<address>)
Explanation: Reads a 2-byte number at the address indicated by the numerical expression. The address should be divisible by two; otherwise, access times will be significantly reduced. The read value is always interpreted as a two's complement representation of a short integer number and is located in the interval of -32768 to +32767.
Example:

    Mem=MEMORY(10)
    WPOKE Mem,$FFFF
    PRINT WPEEK(Mem)

Result:

    -1

See also:  WPOKE    POKE    PEEK   LPOKE   LPEEK 
 


WPOKE
Type: Command
Syntax: WPOKE <num.expression>,<num. expression>
WPOKE <address>,<value>
Explanation: Posts the value as a short integer number at the specified address. The address should be divisible by two; otherwise, access times will be significantly reduced. Only the lower 16 bits of the specified value are always written to the desired memory address.
Example:

    Mem=MEMORY(10)
    WPOKE Mem,$FFFF
    WPOKE Mem+2,-1
    WPOKE Mem+4,65500
    PRINT LPEEK(Mem)

Result:

    -1

See also:  WPEEK    POKE    PEEK   LPOKE   LPEEK 
 


WRITE
Type: Command
Syntax: WRITE <expression>[[,<expression>]]
WRITE <output>[[,<output>]]
Explanation: Just as in the case of PRINT, WRITE displays any expression on the screen. String expressions are placed in quotes, and commas separate all output.
Example:

    Test$="Omikron Basic"
    WRITE ,Test$,PI,1.23

Result:

    "Omikron Basic", 3.14159265358979, 1.23

See also: PRINT
 


WRITE #
Type: Command
Syntax: WRITE #<num.expression>,<expression>[[,<expression>]]
WRITE #<file number>,<output>[[,<output>]]
Explanation: Similarly to the PRINT# command, WRITE # outputs any numerical or string expressions to a file. The file must have been opened previously with OPEN. Compared to PRINT #, WRITE # places all string expressions in quotes and separates all expressions with commas. This proves to be especially advantageous when writing files, which are supposed to be re-read with INPUT #.
Example:
    Text$="Berkhan-Software"
    OPEN "O",1,FN Get_Fsspec$(0,0,"WRITE.TXT")
    WRITE #1,Text$,PI,1.23#
    CLOSE 1
    OPEN "U",1,FN Get_Fsspec$(0,0,"WRITE.TXT")
    GET 1,All$,LOF(1)
    CLOSE 1
    PRINT All$:PRINT
    INPUT "Quit programm with [Return]";E
Result:

    "Berkhan Software", 3.14159265358979, 1.23

See also:  PRINT #     OPEN    INPUT # 
 


WVBL
  Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use.
 


W_CHAR
Type: Function
Syntax: W_CHAR
Explanation: This function returns the width of the screen in characters. Since the width of the letters for proportional fonts varies, the width of the zero is taken as a basis in this case.
Example:  
Result:  
See also:  H_CHAR    W_PIXEL   H_PIXEL 
 


W_PIXEL
Type: Function
Syntax: W_PIXEL
Explanation: This function returns the width of the screen in pixels.
Example:  
Result:  
See also:  H_PIXEL    W_CHAR   H_CHAR
 

XBIOS
Explanation: Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use.
 


XOR
Type: Operator
Syntax: <num.expression>XOR <num.expression>
Explanation: The two expressions are linked bit-wise with the logical operator "exclusive-OR".
Example:

    PRINT BIN$((%1010 XOR %1100)+%10000)

Result:

    %10110

See also:  OR   NOR   AND   NAND   IMP    EQV   NOT
 

5-10. SCREEN - TEXT HEIGHT Contents | 5-12. Index of Command Groups

Tech-Support | Order | Start | Home: http://www.berkhan.com


© 1997-1999 Berkhan-Software