diff --git a/header.txt b/header.txt new file mode 100644 index 0000000..7a6838f --- /dev/null +++ b/header.txt @@ -0,0 +1,12 @@ + _____ __ __ __ _ __ + / ___// /_____ ______/ /__/ /_ ____ ______(_)__ _____/ /____ + \__ \/ __/ __ `/ ___/ //_/ __ \/ __ `/ ___/ / _ \/ ___/ __/ _ \ + ___/ / /_/ /_/ / /__/ ,< / /_/ / /_/ (__ ) / __/ / / /_/ __/ +/____/\__/\__,_/\___/_/|_/_.___/\__,_/____/_/\___/_/ \__/\___/ + _____ __ + / ___/____ _________ ______/ /_ ___ ____ + \__ \/ __ \/ ___/ __ `/ ___/ __ \/ _ \/ __ \ + ___/ / /_/ / / / /_/ / /__/ / / / __/ / / / + /____/ .___/_/ \__,_/\___/_/ /_/\___/_/ /_/ + / + diff --git a/presentation.fs b/presentation.fs index 9b60c13..47dfe6c 100755 --- a/presentation.fs +++ b/presentation.fs @@ -235,6 +235,7 @@ Create line-buffer max-line 2 + allot : open-input ( addr u -- ) r/o open-file throw to fd-in ; : printsource ( from to addr u -- ) + { showLines } open-input cr 0 @@ -247,7 +248,8 @@ Create line-buffer max-line 2 + allot dup ptype-indent @ \ i str l l indent dup ptype-curx ! 1- \ i str l l indent swap - cursor> \ i str l - type ." |" \ ... i \ Eingerueckt Zahl ausgeben + showLines if type ." |" \ ... i \ Eingerueckt Zahl ausgeben + else 2drop endif \ Eingerueckt keine Zahl ausgeben swap line-buffer swap ptype cr else nip endif @@ -259,23 +261,24 @@ Create line-buffer max-line 2 + allot ; : printCodeHeader ( end start namelen addr -- ) \ prints source code header containing line numbers + { showLines } swap 2swap \ addr namelen end start 2dup > if swap then \ addr namelen start/end end/start dup 0 <# #s #> nip ptype-reset 1+ ptype-indent ! 2swap \ start end addr namelen - printsource cr + showLines printsource cr ; : {source} ( -- ) ; : ( -- , xt-{source} ) ['] {source} , ; : {/source} ( -- ) dup dup dup dup @ swap cell + @ 2swap cell 2 * + - @ swap cell 3 * + @ printCodeHeader 4 cells + ; + @ swap cell 3 * + @ 1 printCodeHeader 4 cells + ; : ( -- , xt-{/source} ) ['] {/source} , , , , , ; : {file} ( -- ) ; : ( -- , xt-{file} ) ['] {file} , ; : {/file} ( -- ) dup dup dup dup @ swap cell + @ 2swap cell 2 * + - @ swap cell 3 * + @ printCodeHeader 4 cells + ; + @ swap cell 3 * + @ 0 printCodeHeader 4 cells + ; : ( -- , xt-{/file} ) ['] {/file} , , , , , ; : {np} ( -- ) diff --git a/presentation.p.fs b/presentation.p.fs index e975a54..f4ad810 100644 --- a/presentation.p.fs +++ b/presentation.p.fs @@ -39,6 +39,10 @@ : farbendemo farbendemo' ; +

+ s" header.txt" 0 100 +

+ !" Dies ist eine Testpraesentation!"

!" Eines Tages hatten wir [Harald Steinlechner und Denis Knauf"