ZX Format #07
05 декабря 1997

Programmers - Basic - 7: The End of the description of Beta-Basic.

<b>Programmers</b> - Basic - 7: The End of the description of Beta-Basic.
        Teams BB.

        (End)

music by MIDISOFT
(C) D. Rudovsky
_______________________________

In this article I will complete the description of BB and
I will give some tips on using it.
 OS Spectrum has its own internal clock,
ie variable that stores the number of the fiftieth of a second 
(interrupts), who came from the time the computer. 
Advertisement BB decided to use this opportunity to arrange 
hours in the program.  Team CLOCK "string" - allows you to set 
the current time, as well as set the alarm. To set the alarm 
the first character in the string must  be the symbol A (alarm 
- wake up.).  The string should be entered as:

 "Hh: mm: ss" for seconds, not alarm
indicated.
 To use the Alarm ka additionally introduced the format:
 CLOCK n, where:


  n = 0 - do not show the testimony, an alarm clock

       disable;

  n = 1 - indicate the time in the upper right corner

       screen, turn off the alarm;

  n = 2 - the time skip, to give sound
       kovoy signal an alarm clock;

  n = 3 - specify the time and the issue of sound
       kovoy signal an alarm clock;

  n = 4 - does not specify a time for tripping
       Vania alarm switch to strictly
       ku;

  n = 5 - similar to n = 4, with the withdrawal time

       on the screen;

  n = 6 - similar to n = 4 with the issue of sound
       Vågå signal before the transition;

  n = 7 - n = 5 and n = 6 together;

  n = 8 .. 9999 - set the line number

       which will be made re
       progress when the alarm.

 Example:

  10 PRINT "346 * 789 =?"

  20 CLOCK "00:00:00": CLOCK "A00: 01"

  1930 1000 CLOCK: CLOCK 7
F 40 INPUT X

  50 IF X = 346 * 789 THEN PRINT

     "Very Good!" ELSE "Bad rezult!":

  GO TO 40
F 60 0 CLOCK

  70 STOP
F1000 CLOCK 0
1010 PRINT "No more time!"
1020 STOP

 Legend:
 At 20 bar we set the system
clock to 0 and the alarm set for 1 minute.
 At 30 bar we set the line of transition and operation hours 
(see above).  Then we ask for input of numbers and if

the result is true, and it took less than a minute
then we obtain the inscription "Very Good", clock
would be placed in a passive state (
Line 60) and the program will stop.
 If the result is false, but yet
there, then displays a message will transition back to the line 
40.  If time expires, then regardless

the result will be given a sound
and will move to line 1000.
 WARNING! Go to the alarm clock is only after all! current 
line. Also, this mode does not work  during editing.


 The SORT command is used to sort
arrays and character strings. Its format is:

    SORT [INVERSE] var, where:

 INVERSE - optional, indicated
          cates the condition of toilets
           ki, ie, if you have one litter
           Adjustments will occur on

          descending order, otherwise, to
 ascending;

   var - the name of the array or string.
 Sort going to symbolical
arrays for the first character by default.
To sort by another character uses a design: SORT S $ () (N TO), 
where: 

 S $ - character array;

  N - number of characters that will be

      produced by sorting.
 To sort an array of uses:

  SORT S $ (N TO M), where:
 N, M - border sorting.

Example:

   10 DIM a $ (100,10)

   20 FOR I = 1 TO 100

   30 FOR J = 1 TO 10

   40 LET A $ (I, J) = CHR $ (RND * 25 +65)

   50 NEXT J: PRINT A $ (I)

   60 NEXT I

   70 PRINT "Sorting for 1st char:"
SORT A $ 80

   90 FOR I = 1 TO 100

  100 PRINT A $ (I)
110 NEXT I

  120 PRINT "Sorting for 2st char:"

  130 SORT A $ () (2 TO)

  140 FOR I = 1 TO 100

  150 PRINT A $ (I)
160 NEXT I

  170 STOP

 On it I finish the description of the commands BB
given in the end help for relevance
Keys and commands (all commands are typed in
pseudographics mode):

 [A] - ALTER [6] - AUTO
 [C] - CLOCK [1] - DEF KEY
 [1] - DEF PROC [7] - DELETE
 [D] - DO [P] - DPOKE
 [0] - EDIT [E] - ELSE
 [3] - END PROC [I] - EXIT IF
 [F] - FILL [G] - GET
 [CS] + [6] - JOIN [CS] + [6] - KEYIN
 [8] - KEYWORDS 0 [9] - KEYWORDS 1
 [L] - LOOP [O] - ON
 [N] - ON ERROR [Q] - POP
 [2] - PROC [9] - RENUM
 [R] - ROLL [S] - SCROLL
 [M] - SORT [T] - TRACE
 [P] - USING


          Options BB.

 Besides additional commands BB offers several new features 
that are introduced as well as usual, is determined user, but 
are perceived by WB, as internal.

 All functions can be divided into
three groups: logic, math and
others.

By logical functions include:

 AND (n, m) [FN A (] - logical AND;

  OR (n, m) [FN O (] - logical OR;
 XOR (n, m) [FN X (] - XOR.


  By mathematical functions include:

 a) The functions convert formats:
. BIN $ (n) [FN B '& (] - transformation of the Tenth
                   mean-square of a binary
                   ary line;
 DEC (string) [FN D (] - transformation

                   line containing

                   hexadecimal numbers
                   Lo, in decimal.
- HEX $ (n) [FN H (] - transformation of the Tenth
                   tichnogochislav

                   hex

                   line;
- USING $ (format, number) [FN U $ (] - sign-
                   curve in record numbers

                   specified format.

 b) enhanced standard features:
. COSE (n) [FN C (] - faster and more

                   rough version cos;
 SINE (n) [FN S (] - analog. For sin;
 DPEEK (n) [FN P (] - the same way:

                  256 * PEEK (N +1) + PEEK (N);
 RNDM (n) [FN R (] - the same way:

                   n * RND.

 The remaining functions are functions
determine the amount of memory contents
screen, etc.

 CHAR $ (n) [FN C $ (] - converting numbers
                   la in the range 0-65535

                   the equivalent row
                   Since the two characters;
 FILLED () [FN F (] - the number of elements

                   images, filled
                   United latest to
   executing FILL;
 INSTRING (n, Row1, Row2) [FN I (] - return
                   schaet position of the first

                   the sign of line 2 at

                   viewing line 1,

                   starting with a given

                   starting position.

                   If the inside of row 1

                   no line 2, then

                   returns 0.
 MEM () [FN M (] - returns the amount of free
                   the free memory;
 MEMORY $ () [FN M $ (] - returns the value
                   of all the memory from 0

                   65535 interpreted
                   synchronize, as one

                   string;
 MOD (n1, n2) [FN V (] - returns the remainder

                   dividing n1 by n2;
 NUMBER (string) [FN N (] - transformation

                   string of two characters

                   a two-byte number,

                   where every byte of
                   Keep the number corresponding to
                   yuschee given code

                   ASCII;
 SCRN $ (y, x) [FN K $ (] - returns the sign

                    located on the screen

                    in a given position;
 STRING $ (n, string) [FN S $ (] - repeats

                    string specified number
                    honors again;
 TIME $ () [FN T $ (] - returns a string

                    soderzhaschuyutekuschee

                    time.


  Features programmirvaniya

             in BB.

 Extending the capabilities of the standard BASIC, WB revises 
and programming methods themselves, so when working in BB 
desirable to consider the following points: 

  1) As a result of changes in the action of FOR ... NEXT speed 
of its execution increases significantly when working with 
integers in the range 0 .. 65535, so try to do integral cycle. 

  2) The emergence of the procedures and
associated local variables appeared to significantly save 
memory by localizing variables. It also allows you to move to 
the concept of structuring the program. 

  3) Having the opportunity to Rich
O, and the introduction of windowing
an orderly display of necessary information.

  4) Team Sorting allows for more
effective use of WB in organizaii databases.

_______________________________





Other articles:

From the authors - a few words about the next issue.

Ator magazine - ZX-Format No.7

Content - short contents of the magazine ZX-Format No.7

Toys - an overview of new products: Los Angeles Drugs Bust, Jungle Warfare, Dragonia, 3D Starfighter, Rock star ate my hamster, Star Cobtrol, Malstese joe's pool challenge, Dynamite dux, Blood Brodthers, Galactic Games, Motor Masscre, International Kickboxing.

Toys - Tai-Pan: a masterpiece of classic ZX Spectrum. The game that combines the quest and the manager. Interesting story and a rather detailed description.

Toys - Operation R.R. Opening a new graphic novel from quest'u GALAXY.

Toys - Adventyury: description of the game-parody "Bored of the ring" - "sick of the Rings" can be used as a description, but can simply be read as a parody of JRR Tolkien.

Toys - 3D construction kit: a detailed description of the editor of 3D games such as Castle Master. The article describes the internal language sistemmy, which in fact, makes a set of locations and objects in a full game.

Programmers - Basic - 7: The End of the description of Beta-Basic.

Programmers - library of mathematical procedures. Series of articles for those wishing to learn how to program in assembly language.

Programmers - algorithms and examples of procedures for quick calculations on asemblere: multiplication and division of 3-byte numbers

Programmers - Mod Format files. Describe the format of the standard MOD file used in the General Sound.

Programmers - BMC 2. Esche few words about the conversion of PC-shnyh images in 3-color.

Review - An overview of the passage of the regular Demo-party ENLiGHT 1997 with photographs of some of the guests.

Review - A few moments with the exhibition of video and audio Video FAIR, held in autumn in Saint-Petersburg.

Iron - Captain Nemo invites to share technology KAY all willing to do production.

Iron - Information on a new project by Scorpion - motherboard expansion graphics and memory GMX.

Iron - An article about the audio amplifier and a price list (for those wishing to buy a ready-amp or kit assembly).

animated cartoon - Description of a new turbo-assembler from STORM X-Trade.

animated cartoon - Riff Tracker New Music Editor for General sound.

animated cartoon - Description tekstovgo editor of ZX-Winword, allowing to make graphical inserts in the text, and its utility Sprite Cutter - Cutting these insertions.

animated cartoon - Head Ball - Golovobol: Description of a new game.

Interview - interviews with participants ENLiGHT'97: Digital Reality.

Interview - interviews with participants ENLiGHT'97: Extreme.

Interview - interviews with participants ENLiGHT'97: MMA, ALK.

Interview - interviews with participants ENLiGHT'97: Flash inc.

Interview - interviews with participants ENLiGHT'97: Progress.

Interview - interviews with participants ENLiGHT'97: Felix / Softland.

Interview - interviews with participants ENLiGHT'97: Slash.

Interview - interviews with participants ENLiGHT'97: Vyacheslav Mednonogov.

It was you - Lord of the teeth - 2. Continuation of the adventures of the brave Hobbits.

It was you - Switch - A small philosophical parable.

Mail - A masterpiece. Another interesting letter - "the majority of applications and system software - complete nonsense, and Labuda!

Mail - readers' letters: Nikolai Sergeyev, Jobman, Nikolai Parfenov, Dmitry Zalissky.

Mail - free advertising and announcements.

Miscellaneous - prospects for the software. A new RPG game from Odessa Group "Oberon" - an unknown world.

Miscellaneous - prospects for the software. STATE OF THE ART: a new graphical editor for the Spectrum.

Miscellaneous - Electronic Samizdat: A few words about a new kind of software - Electronic books.

Amiga Club - A new article of the former Spektrumista Max Petrov on Amiga.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
about everything about everything - "In Search of Nessie."
Poll - Questionnaires user BBS.

В этот день...   21 November