Red ["tired editor - mikeparr@live.com"] ;editor for Red, written in Red - 10 july 2016 ;just a bit of fun, not for serious use. Windows only - CR/LF maniplation! open: function[] [ ;-------- read a file, LF to CRLF needed for Area print["opening " file-name/text] the-text/text: replace/all read to file! file-name/text "^/" "^M^/" ] save-current: function[] [ ;------- write modified copy of area to file print "Saving" text-copy: copy the-text/text replace/all text-copy "^M" "" ;delete all CRs write to file! file-name/text text-copy ] interpret: function[ ][ ;------- interpret the code id the area, saving it save-current print ["Interpreting " file-name/text] do to file! file-name/text ;exec the text in file ] any-name: append get-current-dir "/ANYNAME.red" ;an initial file name for user view[ ;--------- GUI, events ----------- size 600x700 button "Interpret" [interpret] button "Compile" [print ["compile (not implemented yet)" ]] button "Run" [print ["run (not implemented yet)" ]] return ;move down and to left the-text: area 580x600 {Red [ ]^M^/print "Hello World"^M^/ } ; nb CRLF return button "Open: Overtype ANYNAME first: " [open ] file-name: field 200 any-name button "Save Current file" [ print "saving" save-current] ]