/* Set layout to block format in an AmigaGuide compatible fashion with leading user's layout for 640 pixel wide screens*/ BAREED_HOST = GetClip('BAREED') IF BAREED_HOST = '' THEN DO CALL SetClip('BAREED') /* Remove from ClipNode */ EXIT 5 END ADDRESS VALUE BAREED_HOST CALL SetClip('BAREED') /* Remove from ClipNode */ OPTIONS RESULTS /* ------------------- MAIN ---------------- */ /* Layout is set here to 640 pixel per line (VGA) */ 'Set Error Off' /* Turn off BareED's trap handling */ 'Set Echo Off' /* Turn off BareED's I/O reports */ leftmost = 640 leftmost = leftmost - 4 /* Left window border has got 4 pixels */ leftmost = leftmost - 18 /* Right window border has got 18 pixels */ leftmost = leftmost - 2 /* BareED reserves 1 pixel in front and one pixel behind a text line */ Get Charwidth ' ' /* Get width of a space in number of pixels */ space = RESULT /* We now have got the amount of space characters a line can contain */ leftmost = leftmost - space /* Due to uncoform AmigaGuide layout */ numchars = leftmost % space /* Get amount of space characters that fit into a line */ Set Margin Right numchars /* Set rightmost position */ Get Current Char /* Try to get an ASCII character */ currchar = RESULT textline = '' /* An empty line! */ /* Fill up empty line with white spaces and other layout characteristics */ DO WHILE currchar < 33 textline = textline || currchar Move Cursor Right Get Current Char currchar = RESULT END terminate = 0 len = LENGTH( textline) /* Length in number of characters */ /* Make the layout but care about a user's own made (for example a tab in front of a line) */ DO WHILE terminate = 0 Layout Guide /* Layout current line */ Move Cursor Down /* Move cursor to next line */ Move Cursor Linestart /* Move cursor to line start */ Get Current Line /* Get contents of the existing line */ terminate = RC /* Check for error */ IF terminate ~= 0 THEN /* If error (linefeed or archive's end) then */ BREAK /* break */ /* Else drop user's line intro */ DO i = 1 TO len c = SUBSTR( textline, i, 1) Put Char c END END EXIT /* Demo line - point cursor to the first character of the " This is a ...." and watch what BareED does ..... ^ This is a very loooooong line used as a simple example for BareED's layout mechanism and the button interface (knob-bank) of BareED which can be used to use this script as an example. demo line end */