11.07.2015 Views

BCL Programmers Manual V2.00 (PDF) - Barix

BCL Programmers Manual V2.00 (PDF) - Barix

BCL Programmers Manual V2.00 (PDF) - Barix

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.7.2 Writing files (Barionet only)In addition to the read FLASH-file access the Barionet offers a write support with thefollowing limitations. The file has to exist in a .cob file in FLASH memory of the Barionet andstart with a special header “CRLF” (ASCII: 60, 42, 62, 13,10). The size of the file is fixedand can not be changed. Only text data can be stored in the file since the NULL character (\0)is recognized as an end-of-file mark.The file header and the EOF mark are transparent for READ operations as well as for the builtin webserver. This way the HTML/DHTML pages can be modified on the fly or e.g. systemlogs be written.OPEN "F_W:" AS H – opens file in write modeOPEN "F_A:" AS H – opens file in append modeIn write mode the file size is truncated to zero (EOF marker is moved to the start of the file)and the file position pointer is set to the beginning of the file. In append mode the originalcontent of the file is preserved and the file position pointer is set to the end of the file.Each WRITE call moves the EOF mark appropriately, but maximum number of bytes of theoriginal file size can be written (the file can not be enlarged within the .cob file).The FILEPOS, SEEK and FILESIZE functions can be used to seek within the file and to obtainthe current file size.7.8 Keyboard and display interface (audio devices only)On hardware featuring a keyboard and/or a text display, these can be accessed through thefile interface as well. For that purpose a special handle -2 is defined. This handle is alwaysopen and can not be closed. The following IO functions are supported on handle -2.7.8.1 DisplayFILESIZE ( -2 )Returns the size of the display as a 16-bit word: 256* height + width. Height defines thenumber of lines of the display whereas width the number of characters per line.If the hardware does not feature a display FILESIZE returns 0.WRITE -2, S$, EWrites E bytes from S$ to handle the display. If E is 0 then the whole string up to the nullterminatoris written.S$ can contain both text and control characters. Text is written from the current cursorposition up to the end of the line. Characters with codes 32 to 127 are supported, US ASCIIencoding is used.Standard ANSI escape sequences are used to control the display. Each control sequencestarts with the “escape” character (ASCII code 27, hexadecimal 0x1B) followed by the '['character (left square bracket, ASCII code 91, hexadecimal 0x5B). The following sequencesare supported.ESC [ 2 JESC [ Pn ADisplay Clearclears the display and moves cursor to the upper leftcorner of the display (position 0,0)Cursor UpMoves cursor up by the given specified of lines. If thecursor is already at the top line ignores this sequence.<strong>Barix</strong> AG | 39/106

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!