Smart Layer Export
Jun 19, 2020 Acorn was part of a bundle I purchased about 5 years ago. I didn't think I'd use it but installed it to try it out - all these years later it has become my goto image editor. I own Affinity Photo, Pixelmator, and Photoshop (CS6) but I still find myself launching Acorn for quick edits as it has all the tools I need. XnConvert is a fast, powerful and free cross-platform batch image converter, It allows to automate editing for your massive photo collections, you can rotate, convert and compress your different images, photos and pictures easily, and apply over 80 actions (like resize, crop, color adjustements, filter.).All common picture and graphics formats are supported (JPEG, TIFF, PNG, GIF, WEBP, PSD.
Overview
Smart layer export is an alternative to traditional slicing found in image editors.Navigate to Layer ⸠Smart Layer Export Settings⦠and the inspector palette will populate with the various export options.A movable and adjustable canvas frame will appear on your canvas that represents the export bounds of your layer.Click and drag on the frame to change its position, or hover over a corner of the frame while clicking and dragging to resize.There is also the option to adjust the size and position of the frame in the inspector palette fields.
Smart Layer Export Options
Smart Layer Export checkbox - Check this box to have your smart layer export palette settings used when choosing File ⸠Export ⸠Smart Layer Export.
File Name - Enter a name for the layer you are exporting.Acorn will default to the filename.
|
Format - Choose your export file format from PNG, JPG, JPEG 200, GIF, or TIFF.
Sizes - Choose from 1x to 5x.
Quality Slider - Adjust the quality of your export via the slider if your file format is JPG or JPEG 2000.
If you are ready to export your layer, click the âexportâ button on the inspector palette.If you want to come back to your settings at a later time, click âDoneâ.
Alternative Method
The technique outlined here is an alternative option if you have the âSmart Layer Exportâ box unchecked in the palette.When you have the âSmart Layer Exportâ box checked, Acorn will default to the export settings you have created in the palette.
This tutorial will use the example of smart layer export being used on an image of 'submit' buttons.You can download the sample image here: FancySubmitButtonSmartExport.acorn.This is what the sample image looks like:
The sample image file has two buttons meant for a website.They are different sizes so the smaller one can be shown on regular screens, and the larger one for Retina class devices (such as an iPhone 4, iPad 3, or a Retina MacBook Pro).
Smart Layer Export Steps:
- Name your layer or layer groups with the name of the file you would like to save it as.You'll have to use one of the following file extensions on the file name: .png, .jpeg/jpg, .tiff/tif, or .gif.
- Optionally create a layer at the bottom of each group and name it '@frame' or '@bounds'.The layer doesn't need to be visible.This layer tells Acorn exactly which part of the image you want written out.In this example the @frame is a shape layer with a single rectangle object defining the area of the group to be exported.You could also use a bitmap layer, in which case the opaque areas of the bitmap layer would define the frame of the area to be exported.If no @frame or @bounds layer is added, then Acorn will default to the size of the canvas for the export size.
- Choose the File ⸠Smart Layer Export⦠menu item.
- That's it!
To see how this is done, take a look at the layers list of the example image:
There are a total of 11 layers.You'll notice that two layer groups are named as files.When you use smart layer export, Acorn will use the layers which are part of the group (and only that group) to make a brand new image.Since the 'Background' layer is outside of both groups, it will not be used when exporting.However, if you renamed 'Background' to 'Background.png', there would be 3 files exported out instead of 2.
Below are the two images created from the smart layer export:
Auto-Scaling
Acorn can do the work of automatically exporting the image at different sizes without maintaining multiple copies of the same image in the canvas.
Instead of creating multiple layer groups for your images, just create one size. In the example below, the image is at @2x. In the layer name, put the name of the image you are starting with ([email protected]), followed by the names of the other images you would like auto-scaled and exported after it. For âsubmit.png' Acorn will take the layer and scale it down for export.For '[email protected]', Acorn will scale it up for export.
You can download this sample image from here: FancySubmitButtonSmartExportAutoScale.acorn.
BBC BASIC for Windows
Introduction to VDU commands
On the BBC Microcomputer and Acorn Archimedes the VDU commands performa number of important actions, primarily involving the screen display and graphics.Although not strictly part of BASIC, most of these commands have been emulated by BBC BASIC for Windows.
The VDU statement takes a list ofnumeric arguments (constants or variables) and sends their least significant bytes as characters to the currently selected output stream.
A 16 bit value (word) can be sent if the value is followed by a semi-colon. It is sent as a pair of characters, the least significant byte first.
VDU code summary
Number | Meaning |
---|---|
0 | Null - it does nothing. |
1 | Send the next character to the printer ONLY. |
2 | Enable the printer. |
3 | Disable the printer. |
4 | Write text at the text cursor position. |
5 | Write text at the graphics cursor position. |
6 | Enable output to the screen. |
7 | Bell - make a short 'beep'. |
8 | Move the text cursor backwards one character. |
9 | Move the text cursor forwards one character. |
10 | Move the text cursor down one line. |
11 | Move the text cursor up one line. |
12 | Clear the text area - identical to CLS. |
13 | Move the text cursor to the start of the current line. |
14 | Enable the auto-paging mode. |
15 | Disable the auto-paging mode. |
16 | Clear the graphics area - identical to CLG. |
17 | Define a text colour - identical toCOLOUR. |
18 | Define a graphics colour - identical to GCOL. |
19 | Select a colour palette. |
20 | Restore the default logical colours. |
21 | Disable output to the screen. |
22 | Select the screen mode - identical to MODE. |
23 | Create user-defined characters and screen modes, etc. |
24 | Define a graphics viewport. |
25 | Identical to PLOT. |
26 | Restore the default text and graphics viewports. |
27 | Send the next character to the screen. |
28 | Define a text viewport. |
29 | Set the graphics origin - identical to ORIGIN. |
30 | Home the text cursor to the top left of the screen. |
31 | Move the text cursor - identical to TAB(x,y). |
127 | Backspace and delete. |
VDU 0
Does nothing. In other words, it is ignored.VDU 1
Provided the printer has been enabled (with VDU 2),the next character (byte) is sent to the printer driver and not to the screen. If the printer is not enabled, the character is discarded. Any 8-bit value (0 to 255) can be sent.
VDU 1 provides a simple way of sending single characters to the printer driver. It works whether the VDU has been disabled with the VDU 21 command or not. For example VDU 1,12 will senda 'form feed' and force the current page to be printed.
Note that you should not attempt to send printer-specific control characters (e.g. forsetting the font, style etc.) as this won't work. BBC BASIC for Windows usesthe Windows⢠printer drivers and changes to the font or style must be made with the*PRINTERFONT command.
VDU 2
VDU 2 enables the printer. It causes all subsequent text output to be sent to both the screen and the printer.
The following control characters are acted upon by the printer:cursor left (VDU 8), cursor right (VDU 9),cursor down (VDU 10), cursor up (VDU 11),form feed (VDU 12), carriage return ( VDU 13) andhome (VDU 30).
Bytes which are parameters for VDU commands are not sent to the printer. For example,
does not send 'A' (CHR$65) to the printer.
If you need to line up columns on the printer using TAB(X)ensure you select a monospaced (fixed-pitch) font, for example:
Note that BBC BASIC for Windows assumes that the printer is a pageprinter. That is, output will not be printed until the current page is complete(i.e. a CLS or VDU 12 was sent, or the BASIC program terminates).This ensures that printer output is not mixed up with that from other programsrunning at the same time. You can force the current page to print using:
VDU 3
VDU 3 disables the printer. It cancels the effect of VDU 2 so that subsequent output to the screen is not also sent to the printer.If you want to force the page to be printed immediately, send a form-feed (VDU 12) before the VDU 3.VDU 4
VDU 4 causes text to be written at the text cursor position in the normal way. This is the default mode.
Characters can be positioned only at text coordinates within the text viewport; the text viewport scrolls as necessary. Characters are written using the current text foreground colouron an opaque background of the current text background colour (seeCOLOUR).
VDU 5
VDU 5 causes text to be written at the graphics cursor position. It works in all modes except MODE 7.
Characters may be positioned at any graphics coordinate within the graphics viewport. The top left corner of the character cell is the reference point. Characters are clipped to the limits of the graphics viewport if necessary. No scrolling takes place.
Characters areplotted using the current graphics foreground colour and in the currentgraphics foreground plotting mode (see GCOL).
The character background is 'transparent', i.e. it does not change what waspreviously displayed underneath. VDU 127 (DEL) is an exception; it backspaces and deletes just as it does in the normal text mode, using the current background GCOL rules and colour.
VDU 6
VDU 6 enables output to the VDU screen. It cancels the effect of VDU 21.VDU 7
VDU 7 causes a short audible 'beep'.VDU 8
VDU 8 moves the text cursor one character in the negative 'X' direction(normally left, but this can be changed using VDU 23,16).By default, if the cursor was at the start of a line, it moves to the end of the previous line (right edge of the text viewport). If it was also at the top line of the text viewport, the viewport scrolls down (except in the VDU 5 mode). The cursor is constrained to remain within the text viewport.VDU 9
VDU 9 moves the text cursor one character in the positive 'X' direction(normally right, but this can be changed using VDU 23,16).By default, if the cursor was at the end of a line, it moves to the start of the next line (left edge of the text viewport). If the cursor was also at the bottom of the text viewport, the viewport scrolls up (except in the VDU 5 mode). The cursor is constrained to remain within the text viewport.VDU 10
VDU 10 moves the text cursor one line in the positive 'Y' direction(normally down, but this can be changed using VDU 23,16).By default, if the cursor was on the bottom line of the text viewport, the viewport scrolls up (except in VDU 5 mode).Scrolling is paused if <Ctrl> and <Shift> are held down together.The cursor is constrained to remain within the text viewport.VDU 11
VDU 11 moves the text cursor one line in the negative 'Y' direction(normally up, but this can be changed using VDU 23,16).By default, if the cursor was on the top line of the text viewport, the viewport scrolls down (except in VDU 5 mode). The cursor is constrained to remain within the text viewport.VDU 12
VDU 12 clears the text viewport to the current text background colour and moves the text cursor to column 0, row 0 (normally the top-left corner of thetext viewport, but this can be changed using VDU 23,16); it is identical to CLS. If sent to theprinter (e.g. using VDU 2,1,12,3) it causes the current page to be printed.VDU 13
VDU 13 moves the text cursor to column 0 within the current row(normally the left edge of the text viewport, but this can be changed using VDU 23,16).The cursor is constrained to remain within the text viewport.VDU 14
VDU 14 enables auto-paging mode. Scrolling will stop after each page. When the text viewport has been filled, output is paused until <Shift> is pressed.VDU 15
VDU 15 disables auto-paging mode. This is the default condition.VDU 16
VDU 16 clears the graphics viewport using the current background GCOL action and colour. It does not move the graphics cursor. VDU 16 is identical to CLG. VDU 16 does nothing in MODE 7.VDU 17
VDU 17 is identical to COLOUR. The next byte determines the text foreground or background colour. See COLOUR for more details. The example below sets the text foreground colour to red (assuming that VDU 19 has not been used to change the default logical to physical colour assignments).VDU 18
VDU 18 is identical to GCOL. It takes the next two characters as the plotting mode and graphics colour respectively. Thus,andhave the same effect. See the Graphics and colours section for more details.VDU 19
VDU 19 sets the colour palette, i.e. the mappingbetween logical colours andphysical colours.
VDU 19 takes the next five characters as parameters. The first parameter is the logical colour to be set and the remaining parameters determine the physical colour that it is to be set to.
If the second parameter is in the range 0 to 15 this determinesthe physical colour as an offset into the physicalpalette, in this case the remaining three parameters are ignored.
If the second parameter is â1 (or 255) the physical colour is determined byinterpreting the remaining three parameters as red, green and blue values inthe range 0 to 63, where 0 is none and 63 is maximum.
If the second parameter is 16 the physical colour is determined byinterpreting the remaining three parameters as red, green and blue values inthe range 0 to 255, where 0 is none and 255 is maximum.
VDU 20
The VDU 20 command performs two distinct actions:- It sets the text and graphics foreground and background to their default logical colours and plotting modes. This action is the same as issuing the commands:
- It sets up the default palette.This is equivalent to the program segment:
VDU 21
VDU 21 disables the VDU drivers until a VDU 6 is received. All VDU commands except 1 and 6 are ignored. If the printer is enabled, VDU commands 8 to 13 will still be sent to the printer.VDU 22
VDU 22 is identical to MODE, except that MODE zeros the value of COUNT whereas VDU 22 does not. The mode is set according to the value of the byte following the VDU 22 command. The example below sets mode 3.VDU 22 also resets all the screen driver variables (colour, palette, viewports, cursor position, graphics origin, etc). In particular, VDU 22 performs the actions of VDU 4, VDU 12, VDU 15,VDU 20 and VDU 26.
See the Graphics and colourssection and the keyword MODE for further details.
VDU 23
VDU 23 is used for several different purposes: to create user-defined characters,to control the appearance of the text cursor (caret), to scroll the display, to select auser-defined display mode, to determine line thickness and to control theway the text cursor moves.User-defined characters
Characters from &20 to &FF (32 to 255) may be programmed using the VDU 23 command. The programmable characters are not available inMODE 7.
The format of the VDU 23 command is;
'Char_no' is the character number to be programmed and 'r1' to 'r8' are the values of the bytes which define the character, top to bottom. For example, the character illustrated below is defined as character 130 by the following VDU 23 command.User defined characters occupy a 'cell' which is 8 dots wide by 8 dots high.The number of rows of user defined text which may be displayed on thescreen depends on the vertical resolution of the display mode in use.
Note that although the current character font can be changed to any size usingthe *FONT command, user-defined characters are alwaysthe same size in a particular display MODE.
Text cursor control
The text cursor (caret) may be disabled and enabled using the VDU 23 command as shown below. The first is equivalent to the BASIC statementOFF and the second to the statementON.The shape of the text cursor can be controlled (to some degree) by using VDU 23to set the start line and end line of the cursor 'block'; this affects its heightand vertical position. The 'start line' and 'end line' are controlled by thefollowing commands:For example, the text cursor is normally a flashing underline in 'insert'mode and a flashing block in 'overtype' mode. To turn it from an underlineinto a block without changing to 'overtype' mode you can use the followingcommand:This facility should be used with care.
The width of the text cursor can also be set:
This sets the width of the cursor to w pixels. If w is zero (the default) thecursor is set to the average character width of the current font.
For example, to set the cursor to a vertical line two pixels wide use the following code:
Scrolling the window
The contents of BASIC's output window (or just thecurrent text viewport) can be scrolled, by one characterwidth or height, using VDU 23,7:where m and d are as follows:m = 0 | scroll just the text viewport |
m = 1 | scroll BASIC's entire output window |
d = 0 | scroll right one character |
d = 1 | scroll left one character |
d = 2 | scroll down one row |
d = 3 | scroll up one row |
User-defined modes
Although the MODE statement givesa wide choice of different display modes, there may be circumstances whena mode with different characteristics is required. The VDU 23 command can beused to select a user-defined mode as follows:where:width = window width in pixels (e.g. 640)Note that the width and height values must be followed by semicolons. Youshould choose the width and height values to be integer multiples of thecharx and chary values respectively. For example, you can select a modewhich has 10 (large!) characters per line and 8 lines of text as follows:The maximum values for width and height are 1920 and 1440 respectively.
height = window height in pixels (e.g. 512)
charx = character width in pixels (e.g. 8)
chary = character height in pixels (e.g. 16)
ncols = number of colours (e.g. 16)
charset = 0 for ANSI, 1 for OEM (IBM PC), 8 for UTF-8
By default the background colour is black and the text colour is white. To select amode with a white background and black text add 128 to the charset value.
If the charset value is set to 8, text output to the screen or printer is assumed to be in UTF-8 format. This gives access to thecomplete Basic Multilingual Plane (including alphabets like Greek, Cyrillic, Arabic, Hebrew etc.)whilst remaining compatible with ASCII. To utilise thismode you should select a Unicode font after the VDU 23 command:
Line thickness
Straight lines and outline shapes, plotted using VDU 25(or, equivalently, using DRAW, LINE,CIRCLE, ELLIPSE,RECTANGLE etc.), are normally one pixel thick. The thicknesscan be changed to a different value as follows:where t is the required line thickness in pixels. Note that only solid lines can have theirthickness changed, not dotted or dashed lines.Cursor movement control
The way the text cursor (caret) moves after a character has been output is determined by the state of eight flag bits; both screen and printer output are affected.One or more of the flag bits can be modified as follows:where the existing 8-bit flags byte is first ANDed with y and then exclusive-ORedwith x. To set the entire flags byte to the value f you can do:The flag bits control the cursor movement as follows (bit 7 must be zero):Bit 6 = 0 | The text cursor is constrained to remain within the viewport/page (e.g. by wrapping or scrolling). |
---|---|
Bit 6 = 1 | The text cursor can move beyond the edge of the viewport/page (except in VDU 4 mode). |
Bit 5 = 0 | The text cursor moves after a character is output. |
Bit 5 = 1 | The text cursor does not move after a character is output. |
Bit 4 = 0 | If appropriate the text viewport scrolls, or the printer page is ejected. |
Bit 4 = 1 | The text cursor wraps to the opposite edge of the viewport/page. |
Bit 3 = 0 | The 'X' direction is horizontal and the 'Y' direction is vertical. |
Bit 3 = 1 | The 'X' direction is vertical and the 'Y' direction is horizontal. |
Bit 2 = 0 | The 'positive' vertical direction is downwards. |
Bit 2 = 1 | The 'positive' vertical direction is upwards. |
Bit 1 = 0 | The 'positive' horizontal direction is rightwards. |
Bit 1 = 1 | The 'positive' horizontal direction is leftwards. |
Bit 0 = 0 | In VDU 4 mode, 'pending scroll' is enabled. |
Bit 0 = 1 | In VDU 4 mode, 'pending CRLF' is enabled. |
In 'pending scroll' mode, if a character would normally cause thetext viewport to scroll (thus causing the top line to be lost) it will not do sountil just before the next character is output. If the cursor isrepositioned (e.g. using VDU 13,VDU 30 or VDU 31) before thenext character is output, no scroll will take place.
In 'pending CRLF' mode, if a character would normally cause a CRLFaction (the text cursor wrapping to the beginning of the next line) it willnot do so until just before the next character is output. If the cursor isrepositioned before the next character is output, no CRLF will take place.
VDU 24
In all modes except MODE 7,VDU 24 defines a graphics viewport. The following four words (pairs of bytes) are the X & Y coordinates of the bottom left corner of the viewport and the X & Y coordinates of the top right corner of the viewport, inclusive, in that order. The coordinates are with respect to the current graphics origin.
It is particularly easy to select invalid viewport limits if the graphics origin has been moved. It is advisable, therefore, to precede a VDU 24 command with a VDU 29,0;0;command or ORIGIN 0,0statement to reset the graphics origin.
The following example defines a graphics viewport with the bottom left corner at 200,100 and the top right corner at 500,300.
Be very careful not to omit the final semicolon.
VDU 25
VDU 25 is identical to the PLOT statement. See the Graphics and colours section or the keyword PLOT for more details.The following example draws a line in the current foreground colour to the point 350,525:VDU 26
VDU 26 resets the text and graphics viewports to their default positions (filling the whole screen), homes the text cursor to the top left of the screen (0,0), resets the graphics origin to the bottom left of the screen (0,0) and moves the 'current point' to the graphics origin.
Important note: VDU 26 resets the text and graphics viewports to the currentsize of BASIC's screen (output window), not to the default size appropriateto the current MODE. In the event that BASIC'soutput window has been resized by the user (by dragging a corner or side) or has areduced size because the display resolution is inadequate for the selected MODE, VDU 26may alter the relative alignment of text and graphics. If this could be a problem,avoid the use of VDU 26 (or make sure the display resolution is sufficient andprevent the user resizing the window).
VDU 27
VDU 27 sends the next byte to the screen without interpreting it as a control character. It allows graphics characters corresponding to VDU 0 to VDU 31 and VDU 127 to be displayed. It acts for characters sent to the screen in a similar manner to the way VDU 1 does for characters sent to the printer.VDU 28
VDU 28 defines a text viewport. The following four bytes are the X & Y coordinates of the bottom left corner of the viewport and the X & Y coordinates of the top right corner of the viewport, inclusive, in that order. The coordinates are with respect to the text origin (top left) and are measured in 'character positions'.
If the text cursor is outside the new viewport, it is moved to the new home position (top left of the viewport). If it is inside the new viewport, it is not moved.
The following example defines a text viewport with the bottom left corner at X=0, Y=15 and the top right corner at X=30, Y=3 .
VDU 29
VDU 29 moves the graphics origin to the coordinates specified by the following two words (pairs of bytes). The first word specifies the X coordinate of the new origin and the second specifies the Y coordinate. Subsequent graphics commands operate with respect to this origin. VDU 29 has the same effect as theORIGIN statement.
The following example sets the graphics origin to 640,400:
Acorn 6 0 4 B1 â Bitmap Image Editor Tutorials
VDU 30
In VDU 4 mode, VDU 30 homes the text cursor to column 0, row 0(normally the top-left corner of the text viewport, but this can be changed usingVDU 23,16). In VDU 5 mode,VDU 30 homes the graphics cursor to the 'top left' corner of the graphics viewport.VDU 31
VDU 31 is identical to PRINTTAB(x,y). It positions the text cursor according to the following two bytes, the first determining the column numberand the second the row number. Normally column 0 is the left of the textviewport and row 0 is the top of the text viewport, but this can be changed usingVDU 23,16. The example below positionsthe text cursor in column 15 and row 10.See the keyword TAB for further details.VDU 127
Deletes the character to the left of the cursor and backspaces the cursor tothis position. In VDU 4 mode this has the same effect as the sequence backspace-space-backspace (VDU 8,32,8).Introduction to star commands
On the BBC Microcomputer and Acorn Archimedes, star (*) commands provide access to the 'operating system'. These commands can either be'resident' (i.e. permanently part of the Operating System) or 'transient'(i.e. loaded when required). Windows⢠does not have 'resident'commands in quite the same way, so BBC BASIC for Windows implements its own resident commands as part of the interpreter. However,'transient' or 'external' commands can still be activated via the star commands(or OSCLI). When a star command is issued,BBC BASIC for Windows first checks to see if it is one of its built-in resident commands. If not it is passed to Windows⢠for action.File specifiers
Many of the 'star' commands are concerned with files; whenever a filenameor file specifier is used it must comply with the standard Windows⢠namingconventions:drive: | The single letter name of the drive where the file will be found. The colon is mandatory. If the drive name is omitted, the current drive is assumed. |
path | The list of directories and sub-directories (folders) which must be followed in order to find the specified file. The names of each directory in the path must be separated by the backslash character. If the path is omitted, the current directory on the specified drive is assumed. |
filename | The name of the file. If this contains spaces the entire filespecifier should be enclosed in quotation marks (see below). |
ext | The optional extension of the file. If an extension is used it must be separated from the filename by a full-stop. If the extension is omitted, .BBC is (usually) assumed. |
When an 'ambiguous' file specifier is needed the standard wildcard characters(? and *) may be used.
Control characters, DEL, quotation marks and other special charactersmay be incorporated in filenames etc. by using the 'escape' character '|',however the host operating system (e.g. Windowsâ¢) may notaccept them:
|A | gives ^A (control A). |
|? | gives Del. |
|' | gives the quotation mark '. |
|| | gives the escape character |. |
|! | sets bit 7 of the following character. |
Accessing star commands
The star commands may be accessed directly or via the OSCLI statement. OSCLI must be usedwhen all or part of the star command needs to be determined at run-time (i.e.is a variable rather than a constant). The two examples below both access the *HELP command.A star command must be the last (or only) command on a program line and its argument may not be a variable. Unlike keywords, star commandsare not case-sensitive(and are not affected by *LOWERCASE).Similarly named star commands
If you wish to execute a Windows⢠command with the same name as a resident command, precede it with a second star. For example,will execute BBC BASIC for Windows' resident file copy command butwill pass the command to Windowsâ¢.Errors in star commands
If a star command is mistyped, or does not exist, it will be interpreted asan 'external' command and passed to Windows⢠for execution. If itis not the name of a valid Windows⢠GUI or Console command, the message 'Bad command or file name' will be reported in a console window. However this mayappear on the screen very transitorily and it may not be apparent what has happened.In addition this error cannot be detected or trapped by BBC BASIC for Windows,and execution of the BASIC program will continue.
For this reason, the *FX (with the exception of *FX 15 and *FX 21) and *TV commands are trapped and ignored.These two star commands are commonly found in programs for the BBC Micro, but they have no counterpart in Windowsâ¢.
Star command summary
Command | Function |
---|---|
*BYE | exit the BASIC program and close its window |
*CHDIR (*CD) | display or change the current directory |
*COPY | copy a file |
*DELETE (*DEL) | delete a file |
*DIR (*.) | list the directory contents |
*DISPLAY | display a Windows Bitmap (BMP) file |
*EGA | emulate an EGA or CGA display |
*ERASE (*ERA) | delete a file |
*ESC | enable or disable the Escape key |
*EXEC | accept console input from a file |
*FLOAT | select floating-point numeric precision |
*FONT | select a screen font and style |
*FX | flush keyboard and/or sound buffers |
*GSAVE | synonymous with *SCREENSAVE |
*HARDCOPY | copy graphics to the printer |
*HELP | display version information |
*HEX | control hexadecimal conversion and shift operators |
*INPUT | redirect console input |
*KEY | program a function or special key |
*LIST | display the contents of a program file |
*LOAD | load a file into memory |
*LOCK | set a file to read-only status |
*LOWERCASE | enable or disable lower-case keywords |
*MARGINS | set the printer page margins |
*MKDIR (*MD) | create a sub-directory (folder) |
*MDISPLAY | display a BMP image stored in memory |
*NOEGA | cancel the effect of *EGA |
*OUTPUT (*OPT) | redirect console output |
*PLAY | play a MIDI file |
*PRINTER | select a printer |
*PRINTERFONT | select a printer font and style |
*QUIT | exit the BASIC program and close its window |
*REFRESH | control when the screen is refreshed |
*RENAME (*REN) | rename a file |
*RMDIR (*RD) | remove (delete) a directory |
*RUN | execute a Windows GUI or Console command |
*SAVE | save memory to a file |
*SCREENSAVE | save the output window as a BMP file |
*SPOOL | copy console output to a file |
*SPOOLON | append console output to an existing file |
*SYS | enable trapping of additional system messages |
*TEMPO | control the speed of the SOUND statement |
*TIMER | control the periodicity of the ON TIME interrupt |
*TV | accepted but ignored |
*TYPE | display the contents of a text file |
*UNLOCK | set a file to read-write status |
*| | a comment |
*BYE
Exit the interpreter and return to the calling program. If the BASIC programis running in the interactive environment, the program's output windowcloses and control is returned to thecommand and editing window.
If the BASIC program is running stand-alone (either using the BBCWRUNutility or having been converted to an executable with theCompile command) the programquits and returns control to Windowsâ¢
*BYE is synonymous with the *QUIT command andthe QUIT statement.
Syntax:
*CHDIR (*CD)
Change the current working directory (folder) to a different drive and/or path.The syntax is similar to the CHDIR command available at a Command Prompt.*CD followed only by a backslash will change the current working directoryto the root (top level) directory of the current drive. *CD followed only by adrive name will change the current working directory to the root directoryof that drive.*CD on its own will display the current working directory (folder). If your program needs toknow the current directory you can either use *CD and SPOOL theoutput to a file, or you can use the GetCurrentDirectory API function:Syntax:
*COPY
Copy a file. The syntax is similar to the COPY command available at a Command Prompt,except that the filename extension defaults to .BBC if omitted. To specify afilename with no extension, add a final full-stop.If the summed lengths of the source and destination filenames exceeds 254 characters aString too long error will result. In that case youcan use the Windows⢠API instead (the extensions must be included explicitly):The above commands will copy only one file at a time; wildcards are not permitted in the file specifiers. If you wish to include wildcards in order to copy more than one file, you can use the **COPY commandwhich will be executed by Windowsâ¢. Alternatively you can use thefollowing routine based on the FindFirstFileand FindNextFile Windows⢠API functions:The parameters are the source and destination directories and a file specificationcontaining wildcards (* or ?).Syntax:
*DELETE (*DEL)
Delete the specified disk file. The syntax is similar to the DEL commandavailable at a Command Prompt except that the extension defaults to .BBC if it is omitted.To specify a filename with no extension, add a final full-stop.This command will delete only one file at a time; a wildcard is not permitted in the file specifier. If you wish to include wildcards in order to delete more than one file, you can use the **DEL commandwhich will be executed by Windowsâ¢. Alternatively you can writeyour own routine based on the FindFirstFile and FindNextFileWindows⢠API functions.Syntax:
*DIR |
*. |
BBC BASIC for Windows version 6.11a or later, or BBCSDL, only
If you specify the width and/or height as negative values the image will be automaticallyflipped: horizontally, vertically or both. The specified position still corresponds to the bottom-leftcorner of the original (unflipped) image. This feature does not work if the 'transparent'or 'key' colour option is used.
If you specify the width and/or height as negative values the image will be automaticallyflipped: horizontally, vertically or both. The specified position still corresponds to the bottom-leftcorner of the original (unflipped) image. This feature does not work if the 'transparent'or 'key' colour option is used.
Syntax:
*EGA
This command is provided for BBC BASIC (86) compatibility. *EGA ON causes screen modes 0 to 15 to be mapped to the dimensions and number of colours they would have in BBC BASIC (86) when the *EGA commandis used, i.e. modes of which an EGA adaptor and monitor are capable.
*EGA OFF causes screen modes 0 to 15 to be mapped to the dimensions and number of colours they would have in BBC BASIC (86) when the *EGA commandis not used (or the *EGA OFF command is used), i.e. modes of which a CGA adaptor and monitor are capable.
BBC BASIC (86) programs which include a *EGA (or *EGA ON) command shouldtherefore select an appropriate mode without needing to be modified. BBC BASIC(86) programs which don't include a *EGA command should be modified by addinga *EGA OFF command. This will cause BBC BASIC for Windows to selectan appropriate mode, but will not affect the operation of the program in BBC BASIC(86).
If you need to cancel the effect of *EGA, use *NOEGA.
Syntax:
*ERASE (*ERA)
This command is synonymous with *DELETE.Syntax:
*ESC
Disable or enable the abort action of the ESCape key.After *ESC OFF the <Esc> key simply returns the ASCII code for ESCape (27). *ESC ON (or *ESC) restores the normal abort action of the <Esc> key.Syntax:
*EXEC
Accept console input from the specified file instead of from the keyboard. If the extension is omitted, .BBC is assumed. To specifya filename with no extension, add a final full-stop.Once the entire file has been read, keyboard input is restored. *EXECwithout a filename closes the file and restores keyboard input immediately.Syntax:
*FLOAT
Select the required floating-point numeric precision (40, 64 or 80); the default is *FLOAT 40:The *FLOAT command affects the precision with whichfloating-point values are stored and retrieved using floating-pointindirection or in data files (PRINT# andINPUT# statements). When reading or modifying a data fileyou should always use the same *FLOAT mode as when it was originally written.
BBC BASIC for Windows version 5.95a or earlier only
The *FLOAT command additionally controls the precision of variant(suffixless) numeric variables; only *FLOAT40 (the default) and *FLOAT 64 are available.In *FLOAT40 mode variant (real) numbers have approximately a 9 significant-figureaccuracy; in *FLOAT64 mode they have approximately a 15 significant-figure accuracy.BBC BASIC for Windows doesn't necessarily run any more slowly in *FLOAT64 mode (infact, it may run more quickly because it uses the CPU's numeric data processor) but variantnumeric variables and arrays occupy more memory.
The *FLOAT command additionally controls the precision of variant(suffixless) numeric variables; only *FLOAT40 (the default) and *FLOAT 64 are available.In *FLOAT40 mode variant (real) numbers have approximately a 9 significant-figureaccuracy; in *FLOAT64 mode they have approximately a 15 significant-figure accuracy.BBC BASIC for Windows doesn't necessarily run any more slowly in *FLOAT64 mode (infact, it may run more quickly because it uses the CPU's numeric data processor) but variantnumeric variables and arrays occupy more memory.
BBC BASIC for Windows version 5.95a or earlier only
Variant variablescreated in *FLOAT40 mode are independent of variables created in *FLOAT64 mode, and canco-exist. In the rare circumstance that you need to copy a 40-bit variable into a 64-bitvariable, or vice versa, you can do that only in *FLOAT40 mode by adding a # suffix to the nameof the 64-bit variable. One use for that facility is to read a data file written in a different *FLOATmode:
The above program segment reads a 40-bit value from a data file, then copies it into a64-bit variable.
Variant variablescreated in *FLOAT40 mode are independent of variables created in *FLOAT64 mode, and canco-exist. In the rare circumstance that you need to copy a 40-bit variable into a 64-bitvariable, or vice versa, you can do that only in *FLOAT40 mode by adding a # suffix to the nameof the 64-bit variable. One use for that facility is to read a data file written in a different *FLOATmode:
BBC BASIC for Windows version 5.95a or earlier only
Numeric constants are converted to 40-bit or 64-bit binary floating-point format according to which *FLOAT mode is currently selected. If you want to force conversion to a 64-bit double, evenwhen in *FLOAT40 mode, you can do so by adding a # (hash) suffix:
Numeric constants are converted to 40-bit or 64-bit binary floating-point format according to which *FLOAT mode is currently selected. If you want to force conversion to a 64-bit double, evenwhen in *FLOAT40 mode, you can do so by adding a # (hash) suffix:
*FONT
Select the specified font (typeface) and size, and optionally select anattribute (bold, italic, underscoreand,in BBC BASIC for Windows version 6.00a or later only,
If the *FONT command is mistyped, or if the requested font is not installed,Windows⢠will do its best to select a font similar to the one you requested.Unfortunately it doesn't always do this very well, and the result can be theselection of a 'symbols' font. If this happens, what is displayed won't makemuch sense! You can find out which font has been selected using the GetTextFace Windows API function.
If no typeface, size or style is specified, *FONT selects the System Fixed Font:
Note that the size at which the font is displayed on the screen depends on thecurrent dots per inch(dpi) setting. This is most commonly 96dpi, but maybe 120dpi (or another value) if Large Fonts have been selected or when usingsome high-resolution displays. Ideally you should ensure that your program workssatisfactorily with either setting.
Use the *FONT command with care, as selecting a font other than the default can causeunwanted side-effects. For example, if you select a proportional-spaced font and then usethe INPUT statement, theinput editing featuresprovided will not work correctly. The <backspace> key will not correctly 'blank' (onthe screen) the previous character entered, nor will the <cursor left> and<cursor right> keys have the desired effect. This problem can be circumvented byusing the FNpsinput function listed below; this implements most of the features ofthe INPUT statement but will work correctly with a proportional-spaced font:
The function takes as parameters the column and row numbers (as would be neededby TAB(X,Y)) and a prompt string. It returns thestring which was entered by the user.
Syntax:
*FX
With the exception of *FX 15 and *FX 21, all the *FX commands are ignored.
*FX 15,n and *FX21,n flush selected internal buffers as follows:
*FX 15,0 flushes all the internal buffers
*FX 15,1 flushes the currently selected input buffer
*FX 21,0 flushes the keyboard buffer
*FX 21,4 flushes the channel 0 SOUND buffer
*FX 21,5 flushes the channel 1 SOUND buffer
*FX 21,6 flushes the channel 2 SOUND buffer
*FX 21,7 flushes the channel 3 SOUND buffer
Syntax:
*GSAVE
This command is synonymous with *SCREENSAVE.Syntax:
*HARDCOPY
Copy graphics from the screen to the printer.A rectangular region of BASIC's output window is copied to the printer (assuming your printersupports bit-mapped graphics). The parameters are as follows:
If you omit the destination parameters (X, Y, W, H) the selected region is automatically scaled and centered to fit the page. If you omit all the parameters, the entire outputwindow is scaled and centered to fit the page.
Syntax:
*HELP
Display the name and version number of BBC BASIC for Windows.This results in the following message (or something like it) being displayed:Syntax:
*HEX
BBC BASIC for Windows version 6.00a or later onlyControl whether the hexadecimalconversion (& and ~) and bit-shift (<<and >>) operatorstreat their operands as 32-bit or 64-bit integers. In the (default) *HEX 32mode the operators work ina fashion which is compatible with earlier versions of BBC BASIC; the operands are treated as 32-bitsigned integers. In *HEX 64mode the operands are treated as 64-bit signed integers. For example consider the following program:In *HEX 32 mode the output is:In *HEX 64 mode the output is:
*INPUT
Redirect console input to come from a communications port rather than from thelocal keyboard:The number following *INPUT corresponds to the channel number returned by the OPENUP function used to open the required comms port; this will bein the range 1 to 4 (see the Serial I/Osection for details). Since this is determined at run-time, you will normallyneed to use OSCLI to access this command.
*INPUT 0 restores normal (keyboard) console input.
The following special values provide improved support for console mode programs:
*INPUT 13 | as *INPUT 1, except that 'non overlapped' I/O is used. |
*INPUT 14 | as *INPUT 2, except that 'non overlapped' I/O is used. |
*INPUT 15 | as *INPUT 3, except that 'non overlapped' I/O is used. |
Syntax:
*KEY |
*K. |
No | Key | No | Key |
---|---|---|---|
1 | f1 | 12 | |
2 | f2 | 13 | |
3 | f3 | 14 | |
4 | f4 | 15 | |
5 | f5 | 16 | Ctrl/ (or mouse wheel down) |
6 | f6 | 17 | Ctrl/ (or mouse wheel up) |
7 | f7 | 18 | Home |
8 | f8 | 19 | End |
9 | f9 | 20 | PgUp |
10 | f10 | 21 | PgDn |
11 | Shift/Tab (or f11) | 22 | Ins |
24 | Backspace | 23 | Del |
The string may contain the 'escape' symbol '|' in order to include non-printing characters. For example, |M indicates CR (carriage-return), |? indicates DEL, || indicates the escape character itself and |! causes bit 7 of the following character to be set. If the string is enclosed in quotes (which is optional), |' allows the character ' to be included in the string.
If there is insufficient room for the string, a 'Bad string' error will occur and the key will be loaded with as much of the string as would fit.
*KEY num without a string will empty the specified key and return it to its normal code (see GET).
Compatibility with some BBC Micro programs can be improved by redefining theBackspace key to return the code 127 (DEL) rather than 8 (BS). That can beachieved as follows:
Syntax:
*LIST |
*LI. |
You can use this command to display the contents of a program file saved inBBC BASIC (.BBC) format. You can pause the display either by holding down <Shift> and<Ctrl> simultaneously, or by first entering 'paged' mode by typing Ctrl/N (VDU 14). In 'paged' mode, the display pauses until<Shift> is pressed. To cancel 'paged' mode press Ctrl/O (VDU 15).
To display a program saved in ASCII text (.BAS) format use *TYPE.
Syntax:
*LOAD |
*L. |
You can optionally specify the maximum number of bytes to be loaded (prefixedby a + sign) or, equivalently, the first address not to be loaded.The value must be specified as a hexadecimal number:
You must specify the maximum size when loading into an area of memoryallocated by DIM LOCAL or aWindows⢠API function.
Syntax:
*LOCK
Set the specified file to 'read-only' status. If the extension is omitted, .BBC is assumed. To specifya filename with no extension, add a final full-stop.Once a file has been made read-only, any attempt to write to it will resultin the Access denied error.Syntax:
*LOWERCASE
Allow BASIC keywords, hexadecimal numbers and numbers in'exponent' (E) format to be accepted in lower-case: This affects the recognition of keywords by EVAL. For exampleif *LOWERCASE ON has been executed, EVAL('pi') will return the value ofPI. Otherwise it would result in aNo such variable error.
A word will only berecognised as a keyword if it is entirely capitals or entirely lower-case.A word consisting of a mixture of capitals and lower-case characterswill never be mistaken for a keyword.
*LOWERCASE ON also allows lower-case hexadecimal numbers to be accepted(for example &abcd) and the use of a lower-case 'e' in numbers enteredin 'exponent' format (e.g. 1.2e-3).
To disable the acceptance of lower-case keywords etc. use *LOWERCASE OFF.
When entering statements or commands inImmediate modethe acceptance of lower-case keywords etc. is controlled by theLowercase keywords item in the Options menu.
Syntax:
*MARGINS
Set the printer page margins.This sets the printer page margins to the specified values in millimetres.BASIC will not print closer to the edge of the paper than these values.Initially all four margins are set to 10 mm, but note that both the*PRINTER and *PRINTERFONTcommands reset the margins to zero, not to 10 mm.Syntax:
*MKDIR (*MD)
Create a new directory (folder) with the given name. The syntax is similar to the MKDIR command available at a Command Prompt:If a directory with that name already exists, the File exists error will result.Syntax:
*MDISPLAY
Display a Windows Bitmap image stored in memory, optionally specifying its width and height:The specified position (x,y) corresponds to the bottom-left corner ofthe image, and is given in BBC BASIC for Windows graphics units.The size and shape of the image may optionally be specified, in which casethe image is scaled as necessary; this may result in a loss of quality. Ifthe width and height are omitted the image is displayed without scaling.
BBC BASIC for Windows version 6.10a or later only
An additional parameter may be specified, corresponding to a hexadecimal valuethat will be interpreted as a 'transparent' or 'key' colour; any pixels with this colourin the image will not be plotted and whatever was 'behind' will show through (requiresWindows 2000 or later):
The key colour must be specified in whatever format the bitmap data uses internally,so if it's a 24 bits-per-pixel bitmap specify a six-digit hexadecimalvalue in the format rrggbb
An additional parameter may be specified, corresponding to a hexadecimal valuethat will be interpreted as a 'transparent' or 'key' colour; any pixels with this colourin the image will not be plotted and whatever was 'behind' will show through (requiresWindows 2000 or later):
Acorn 6 0 4 B1 â Bitmap Image Editor Tutorial For Beginners
(if the key colour is black specify it as 1000000).If the bitmap has a different pixel format specify it in whatever representation the bitmap uses.In the special case of a 16 bits-per-pixel bitmap ensure that you choose a key colour which haslow RGB values, for example R=1, G=1, B=1 which corresponds to the hexadecimal value0421 in a RGB555 bitmap.
The quality of the displayed image will be affected by your current display settings(right-click on the desktop, select Properties then Settings). For bestresults ensure you are using High Colour (16-bit) or True Colour (24-bit), butsee the Compatibility limitationssection for notes on the effects of the different settings.
The position and size values must be integers; if necessary usethe INT function to ensure there is no decimal point.
When the image is scaled, you may find that the quality is improved by preceding the*MDISPLAY command with the following statement:
*MDISPLAY is useful if you want to display the same image many times,since using *DISPLAY involves an overheadof reading the file each time. With *MDISPLAY you can load the file once(using *LOAD) and then display it many times. Seealso *SCREENSAVE.
Syntax:
*NOEGA
Cancels the effect of *EGA ON or *EGA OFF.After *NOEGA no mapping of modes takes place.Syntax:
*OUTPUT (*OPT)
Redirect console output to go to a communications port rather than the screen:The number following *OUTPUT corresponds to the channel number returned by the OPENUP function used to open the required comms port; this will bein the range 1 to 4 (see the Serial I/Osection for details). Since this is determined at run-time, you will normallyneed to use OSCLI to access this command.
*OUTPUT 0 restores normal (screen) console output.
The following special values provide improved support for console mode programs and for emulating the LPRINTstatement available in some BASIC dialects:
*OUTPUT 13 | as *OUTPUT 1, except that 'non overlapped' I/O is used. |
*OUTPUT 14 | as *OUTPUT 2, except that 'non overlapped' I/O is used. |
*OUTPUT 15 | output is redirected to the printer. |
Outputting text in *OUTPUT 15 mode has the side-effect of doing aVDU 3,6.
Syntax:
*PLAY
Plays the specified MIDI file, assuming a suitable sound card is fitted.Once a MIDI file is playing you cannot issue another *PLAY command until it has stopped (doing so will result in theDevice unavailable error).However, you can cancel the current MIDI file usingSOUND OFF.
You can discover whether a MIDI file is playing by using the @midi%System variable; this willbe non-zero if a MIDI file is playing.
If the filename extension is omitted, .MID is assumed.
If you have a SoundBlasterâ¢-compatible sound card, you can control theplayback volume as follows:
where volume% is in the range 0 (minimum) to 65535 (maximum).Note that the volume change will affect all subsequent MIDI audio output.
Syntax:
*PRINTER
Select the specified printer. Normally BBC BASIC for Windows usesthe current default printer, but you can select a different printer using thiscommand.The printer name is case insensitive, but otherwise must be precise. If thespecified printer does not exist the No such printer error will result.
Changing the printer initialises the page margins to zero, not to thedefault value of 10 millimetres. You should normally follow the *PRINTERcommand with a *MARGINS command to set thepage margins appropriately.
An alternative way of changing the printer is to present the user with thePrint Setup dialogue box which willallow him not only to select the printer but also the printer options (e.g. printquality), page orientation and paper size.
Syntax:
*PRINTERFONT
Select the specified printer font (typeface) and size, and optionally select anemphasis style (bold, italic and/or underlined).If the *PRINTERFONT command is mistyped, or if the requested font is not installed,Windows⢠will do its best to select a font similar to the one you requested.Unfortunately it doesn't always do this very well, and the result can be theselection of a 'symbols' font. If this happens, what is printed won't makemuch sense!
Changing the printer font initialises the page margins to zero. You may need tofollow the *PRINTERFONT command with a *MARGINScommand to reset the page margins appropriately.
Syntax:
*QUIT
This command is synonymous with *BYE and theQUIT statement.Syntax:
*REFRESH
By default the screen (BASIC's output window) is refreshed, i.e. updated, at times determined byWindowsâ¢. Typically if several things are being plotted in quick succession Windows willwait until all the changes have been made before refreshing the screen. This is normally perfectlysatisfactory, but there may be special circumstances when you need to take control of when therefresh occurs.
For example if displaying an animated graphic you may need to force the display to updateimmediately, otherwise one or more frames of the animation may never be seen. Alternativelyyou may want to delay the refresh until an entire frame has been drawn, to reduce flicker. Theoptions are as follows:
*REFRESH | forces an immediate screen refresh. |
*REFRESH OFF | disables the automatic refresh; the screen will only be updated as theresult of a *REFRESH command. |
*REFRESH ON | restores the normal behaviour. |
Syntax:
*RENAME (*REN)
Rename a disk file. The syntax is similar to the REN command availableat a Command Prompt,except that the extension defaults to .BBC if it is omitted. To specifya filename with no extension, add a final full-stop.If a file already exists with the new name, a File exists error will occur.
If the summed lengths of the old and new filenames exceeds 254 characters aString too long error will result. In thatcase you can use the Windows⢠API instead (the extensions must be included explicitly):
Syntax:
*RMDIR (*RD)
Remove (delete) the directory with the given name. The syntax is similar to the RMDIR command available at a Command Prompt:You can only remove an empty directory. If the directory contains any files you will get an 'Access denied' error.If the directory doesn't exist, you will get a File or path not found error.Syntax:
*RUN |
*/ |
BBC BASIC for Windows will wait until the command completes, but if youpress <Escape> the waiting will be aborted. If you terminate the commandstring with a semicolon (;) then BASIC will not wait for the command to complete.
See also the ShellExecuteWindows APIfunction.
Syntax:
*SAVE |
*S. |
Syntax:
*SCREENSAVE
Save BASIC's output window (or part of it) as a Windows Bitmap file.If no position or size is specified, the entire window is saved (so long as thegraphics ORIGIN hasn't been changed).Otherwise the rectangle whose bottom-left corner is at xpos,ypos and whosesize is width (horizontal) by height (vertical) is saved. The position and sizeare given in BASIC's graphics units.
You can, of course, copy BASIC's output window to the clipboard usingAlt-PrintScreen.
To display an image saved with *SCREENSAVE see*DISPLAY and *MDISPLAY.
Syntax:
*SPOOL
Copy all subsequent console output to the specified file. If the filename is omitted, any current spool file is closed and spooling is terminated. If the extension is omitted, .BBC is assumed. To specifya filename with no extension, add a final full-stop.See also *EXEC and *SPOOLON.Syntax:
*SPOOLON
Append all subsequent console output to the specified file. If the file does not exist, the File or path not found error will occur. If the extension is omitted, .BBC is assumed. To specifya filename with no extension, add a final full-stop.You can use this command to add text to the end of a previously used spool file.Syntax:
*SYS
By default ON SYS interceptsonly Windows⢠WM_COMMAND messages. This is sufficient forits principal use of allowing a program to react to menuand dialogue box selections.However there are other messages to which you might wish to react. Byissuing the following command:you can additionally intercept the WM_NOTIFY, WM_DROPFILES, WM_MENUSELECT,WM_INITMENU, WM_INITMENUPOPUP, WM_HOTKEY, WM_HELPand WM_CONTEXTMENU messages;refer to Microsoft documentation for details of these messages.
The ON SYS handler must test the value of the@msg%system variable todetermine which message was received, as follows:
Message | @msg% |
---|---|
WM_NOTIFY | 78 |
WM_HELP | 83 |
WM_CONTEXTMENU | 123 |
WM_COMMAND | 273 |
WM_INITMENU | 278 |
WM_INITMENUPOPUP | 279 |
WM_MENUSELECT | 287 |
WM_DROPFILES | 563 |
WM_HOTKEY | 786 |
The @wparam% value of the WM_NOTIFY message contains the control's ID in theLS 16-bits (LOWORD) and the notification code in the MS 16-bits (HIWORD). This makes it possible to determine thenotification code even when the parameter block pointed to by @lparam% is no longer valid.
The @wparam% value of the WM_HELP message contains the context type in theLS 16-bits (LOWORD) and the control's ID in the MS 16-bits (HIWORD). This makes it possible to determine thecontrol's ID even when the parameter block pointed to by @lparam% is no longer valid.
Syntax:
*TEMPO
Set the units of the duration parameter of the SOUNDstatement to the specified number of centiseconds (hundredths of a second).The default units are twentieths of a second (equivalent to *TEMPO 5) which is suitablefor most purposes. If you are using SOUND to play music, selecting *TEMPO 4 willcause it to play more quickly and selecting *TEMPO 6 will cause it to play more slowly.
You can select a short unit, for example one centisecond, if you want finer control over the duration of sounds. This may be important if you are using SOUND for purposes other thanmusic, for example to generate morse code. Selecting a shorter unit also reduces the latency(the time between executing the SOUND statement and the sound actually being produced).However it places greater demands on your PC and on some systems may cause the soundoutput to 'stutter'.
Note that the maximum duration of a single SOUND statement is 254 times the selected unit.
By adding 128 to the *TEMPO value you can configure SOUND channel 0 to be a 'tone' channelrather than a 'noise' channel; this makes it possible to generate 'four voice' music:
Syntax:
*TIMER
Set the periodicity of the ON TIME interrupt tothe specified number of milliseconds; the smallest value you can specify is 10 ms(resulting in approximately 100 ON TIME interrupts per second).Note that the timer period determines the flash rate of flashingcharacters in MODE 7. You are recommended not to change it when using that mode.The default periodicity (if no *TIMER command is issued) is 250 milliseconds (4 Hz).Syntax:
*TV
Acorn 6 0 4 B1 â Bitmap Image Editor Tutorial Pdf
The *TV command is trapped and ignored.Syntax:
*TYPE |
*T. |
To display a program saved in internal (tokenised) format use *LIST.
Syntax:
*UNLOCK
Acorn 6 0 4 B1 â Bitmap Image Editor Tutorial Android Studio
Set the specified file to 'read/write' status. If the extension is omitted, .BBC is assumed. To specifya filename with no extension, add a final full-stop.This command reverses the effect of *LOCK.Syntax:
*|
This is a comment line. Anything following the '|' is ignored. The effect issimilar to the REM statement, except that commentsdelimited by *| are retained in a compiled executable even if the Remove REMscrunch option is selected. Thus you should normallyavoid using *| if you intend to 'compile' your program.Syntax:
Additional OS Interfaces
In addition to the facilities already described BBC BASIC for Windowsprovides a very limited emulation of the BBC Micro's OSBYTE and OSWORDfunctions. The emulation of OSBYTE is limited to reading the character at the current text cursor position (OSBYTE function &87) and the emulation of OSWORDis limited to reading the dot pattern of a given font character (OSWORD call &0A).Because these are the only OSBYTE and OSWORD functions emulated, it is not strictlynecessary to pass the function number in A%, but it is best to do so to ensure compatibility with any future enhancements to BBC BASIC for Windows.Read current character - OSBYTE &87
The following program segment returns the ASCIIcode of the character at the current text cursor position and assigns it to a variable called 'char':Read character dot pattern - OSWORD &0A
The following program segment reads the dot pattern of a character:The ASCIIvalue is loaded into byte zero of the 9 byte table called 'pattern' and the pattern is returned in the 8 bytes 'pattern?1' to 'pattern?8. As with the BBC Micro, the address of the table 'pattern' is passed in X% and Y%. The least significant byte is passed in X% and the most significant in Y%
Note that the pattern is read from a built-in font which resembles that of theBBC Micro. It does not correspond to the actual font whichis used when text is written to the screen by BASIC. Generally speakingthe fonts used by Windows⢠do not correspond to an 8 x 8 pixel pattern.
You can, if you wish, use this built-in font in a BASIC program (instead of astandard Windows⢠font) by replacing all the standard characters withuser-defined characters using VDU 23 as follows:
Assembler access to OS routines
Your assembler programs may access the OSBGET, OSBPUT, OSRDCH, OSASCI, OSNEWL,OSWRCH, OSWORD, OSBYTE and OSCLI routines by name as shown below:All strings are CR-terminated. In the case of 'oskey' the carry flag is cleared if no key was pressed within the timeout period.In the case of 'osbget' the carry flag is cleared if at end-of-file. In BBC BASIC for Windows version 6 or later only the EDXregister contains the most significant 32-bits of the file pointer/length.
CONTENTS |
CONTINUE |