Guide

                                                             by Alan Brack

The idea of this guide is to give a quick reference to  gui level programmers.
It is not extensive and more will be added as and when I get chance.
My aim is to keep it simple. Remember it's not just about seasoned programmers.
An alphabetical list is included below for easy navigation, there's also a table of contents.
Examples should 'cut and paste' to the Red console, 
If you use an editor be sure to add the Red header:    Red [needs: 'view]

Red in Alphabetical order:

Just see the contents list below and click on what you need to know - click on a <<back to top>> link to return here:

Contents

  1. Let's Start
  2. First Script
  3. ;;Here we use:    'below'    'text'   'font-size'   'font-color'   'at'   and   'bold'
  4. ;;Here we use:    'offset'
  5. ;;Here we use:    'title'     'across'     'check'    and   'radio'
  6. ;;Here we use:    'backdrop'      'field'    and     'area'
  7. ;;Here we use:    'image'
  8. ;;Here we use:    'loop' 
  9. ;;Here we use:    'forever'    'unview'    'quit'    'if'    and     'print'   
  10. 10 ;;Here we use:    'foreach'    to read a block.
  11. 11  ;;Here we use:    'no-wait'    a refinement of view.     and    'wait'
  12. 12 ;;Here we use:    'save'    'load'    'write'   'read'
  13. 13 ;;Here we use:    'load'     to convert a string to integer.
  14. 14 ;;Here we use:    'mold'            returns string representation of a value.
  15. 15 ;;Here we use:    'now/time'    'append'   and    'form'
  16. 16 ;;Here we use:    'now/time'     to show the  hour, minutes and seconds. 
  17. 17 ;;Here we use:    'request-file'  'request-dir'  'request-font'  pop-up system dialog boxes.
  18. 18 ;;Here we use:    'if error?'    and   'try'      we force an error by dividing by zero.
  19. 19 ;;Here we use:    'text-list'      'copy'      'data'
  20. 20 ;;Here we use:    'if'    'not'    and    'exists?'
  21. 21 ;;Here we use:    'do'     'uppercase'    and    'lowercase'
  22. 22 ;;Here we use:    '+'      '-'      '/'      '*'     'add'     'subtract'    'divide'    'multiply'
  23. 23 ;;Here we use:    'square-root'    'sqrt'
  24. 24 ;;Here we use:    'integer?'       Returns true if an integer.
  25. 25 ;;Here we use:    'string?'    Returns true if a string.
  26. 26 ;;Here we use:    'system/view/screens'     to find the screen size.
  27. 27 ;;Here we use:    'either' 
  28. 28 ;;Here we use:    'as-pair'        Combine X and Y values into a pair.
  29. 29 ;;Here we use:    'until'
  30. 30 ;;Here we use:    'while'
  31. 31 ;;Here we use:    'base'  'draw'  'pen'  'circle'  'box'  'triangle'  'polygon'  'fill-pen'  'line-width'
  32. 32 ;;Here we use:    'tab-panel'
  33. 33 ;;Here we use:    'overlap?'  and  'within?'  .... Collision detection.
  34. 34 ;;Here we use:    'trim'     'trim/head'      'trim/tail'     'trim/all'    'trim/with'  
  35. 35 ;;Here we use:    'make-dir'      
  36. 36 ;;Here we use:    'what-dir'                ;;<--get the active folder.  
  37. 37 ;;Here we use:    'dir'         ;;<--lists the current dir. Or list the full  path.
  38. 38 ;;Here we use:    'case'    'case/all'      ;;<--evaluates a block.
  39. 39 ;;Here we use:    'sort'    'sort/reverse'
  40. 40 ;;Here we use:    'alter'     'find'   
  41. 41 ;;Here we use:   'change'    ;;<--changes a value in a string or block.
  42. 42 ;;Here we use:   'extract'    'extract/index'
  43. 43 ;;Here we use:   'split'      ;;<--break a string into pieces using delimiters.
  44. 44 ;;Here we use:   'remove'    'remove/part'
  45. 45 ;;Here we use:   'split-path'     ;;<--splits a path, returning path and target.
  46. 46 ;;Here we use:   'to-local-file'    'to-local-file/full'      'to-red-file'
  47. 47 ;;Here we use:    'text-list'    'pick'
  48. 48 ;;Here we use:    'drop-down'
  49. 49 ;;Here we use:    'drop-list'
  50. 50 ;;Here we use:    'slider'     'progress'     'on-change'
  51. 51 ;;Here we use:    'what'   'about'
  52. 52 ;;Here we use:    'unique'              removes all duplicates.
  53. 53 ;;Here we use:    'to binary!'      'to string!'
  54. 54 ;;Here we use:    'ask'
  55. 55 ;;Here we use:    'blue'      plus a list of all alternative colours.
  56. 56 ;;Here we use:   'random'     'random/seed'   'random/only'
  57. 57 ;;Here we use:   'max'     'min'
  58. 58 ;;Here we 'interpret' and 'compile' from the Dos prompt.
  59. 59 Will be adding more soon .... 
more will be added as and when I get time.

Let's Start

Red [ ]  - This is the first line of a Red script and must exist for your script to work.
Here it is with other stuff added. Notice that you can change the default app 
icon by declaring it here (ensure you have your new .ico file in the folder). 
The 'needs: 'view' is also important if you want to compile your script.

Red [ title: "My Script" 
        author: "Your Name" 
        icon: %myicon.ico 
        needs: 'View
    ]

First Script

To create a Window or Form or whatever you want to call it, you use 'view [ ....blah blah blah.... ]'
The script here will create a window with a button on it, click the button to quit.
Also note:  The  semi-colon ;  is used to add comments to your scripts.

;;Here we use:  'size'  and  'button'
Red [needs: 'view]
View [  size 300x100                    ;;<-- size your window
         ;;;; this is a comment
button "Hello World" [quit]    ;;<-- display a button and do something when its clicked
          ]

;;Here we use:    'below'    'text'   'font-size'   'font-color'   'at'   and   'bold'

Red [needs: 'view]
View [ below                                          ;;<--This will make items appear below the preceding items, see also 'across'
text "Hello World"                                                    ;;<-- display the message on your form.
text bold font-size 14 "Hello World"                        ;;<-- change font size and display message.
text font-size 16 font-color red "hello world"          ;;<-- change font size, declare a colour and display message.
at 30x20 text "This text is positioned"                     ;;<-- place text where you want it.
at 100x20 button "Quit" [quit]                                 ;;<-- place button where you want it.
          ]

;;Here we use:    'offset'

Red [needs: 'view]
View [ t: text "Hello World"
          button "Move text" [t/offset: 20x30]       ;;<-- change offset of text.
        ]


;;Here we use:    'title'     'across'     'check'    and   'radio'

Red [needs: 'view]
View [ title "My Program"                          ;;<-- show this in the title bar.
across                                ;;<-- this will make items appear across from the preceding one.
check "My check" font-color green   ;;<--display a check box with green text.
radio "My radio"  font-size 12          ;;<- display a radio button with text size 12.
]


;;Here we use:    'backdrop'      'field'    and     'area'

Red [needs: 'view]
View [ backdrop cyan                                                             ;;<-- background colour.
t: text cyan                                                                           ;;<-- make t hold text.   
name: field                                                                           ;;<--  create a field.     
button "<   Type something and click" [t/text: name/text]   ;;<-- make text show whats in field.
a: area                                                                          ;;<-- create an area.  'a' will equal area.
  button "<   Type something and click" [t/text: a/text]        ;;<-- make text show whats in area.
          ]
;;see examples on my 'Red Programming' page.

;;Here we use:    'image'

Red [needs: 'view]
View [ image %myImage.jpg         ;;<-- display image (make sure image file is in your folder).
          image %myImage.jpg 400x400                ;;<-- display image to your chosen size.
          at 300x200 image %myImage.jpg 50x50  ;;<-- place image where you want it and re-size it. 
         ]
View [ image %myImage.jpg [Quit]  ]                   ;;<-- click on image to quit.

;;Here we use:    'loop' 

Red [needs: 'view]
loop 4 [                     ;;<-- will loop 4 times
View [ text "Hello World !" ]
           ]        


;;Here we use:    'forever'    'unview'    'quit'    'if'    and     'print'   

Red [needs: 'view]
a:  0                                                                                ;; <-- declare a  variable/pointer
forever [                                                                          ;;<-- start a forever loop.
a:  a + 1                                                                  ;;<--    a = a + 1
View [ text "constant loop"  button "Not a quit" [unview]]    ;;<-- unview window (not quit).
              if a > 6  [quit]                                                 ;; <-- if   'a'  more than 6 then quit.
print a                                                          ;;<-- this will print 'a' to the console window.
]

;;Here we use:    'foreach'    to read a block.

Red [needs: 'view]
foreach info ["Us"  "Them"  "Me"  "You"] [
View [ text info ]                                           ;;<-- display result in a view
]

 ;;Here we use:    'no-wait'    a refinement of view.     and    'wait'

Red [needs: 'view]
loop 5 [
view/no-wait [ text "loop"]     ;;<-- display your window without waiting.
wait 1                                     ;;<-- pause a sec.
unview                                    ;;<-- close last opened view.
]

;;Here we use:    'save'    'load'    'write'   'read'

Red [needs: 'view]
view [
below
t: text
button "Save" [ save %myfile.txt "Some text"  t/text: "Saved"]   ;;<--Save to folder when button clicked.
  button "Load" [t/text:  load %myfile.txt]              ;;<-- load from folder when button clicked.
button "Write" [write %myfile2.txt "More text"  t/text: "Written"]      ;;<-- Write when clicked.
button "Read" [t/text: read %myfile2.txt]                                          ;;<--Read when clicked.
         ]
;;Check out the two files in your folder ....

;;Here we use:    'load'     to convert a string to integer.

mystring: "22"                        ;; <-- a string.
probe mystring                      ;;<--show in console window.
mystring: load mystring         ;;<--Now mystring is an integer.
probe mystring                      ;;<--show in console window.

;;Here we use:    'mold'            returns string representation of a value.

Red [needs: 'view]
n: 44                   ;;<-- make n equal the number 44.
s: mold n             ;;<-- use 'mold' to get a string representation of the value.
view  [ text s ]      ;;<-- now we can display it.


;;Here we use:    'now/time'    'append'   and    'form'

;;append: Appends a value to the tail of a series and returns the series head.
;;form: Converts a value to a string.
;;Here we use  'Append' and 'form' to make the string 'Time' and  the value 'now/time' live together in a new string variable.

tim: append form  "Time: " now/time     ;;<-- set tim variable with time
probe tim                                               ;;<--  show the result in the console window.

;;Here we use:    'now/time'     to show the  hour, minutes and seconds. 

;;with the use of  'append and form'.

Red [ "Time" needs: view]
t: now/time
hr: append form  "Hours: " t/hour                  ;;<-- get the hour
mn: append form  "Minutes: " t/minute          ;;<-- get the minutes
sc: append form  "Seconds: " t/second           ;;<-- get the seconds
tim: append form  "The Time: " now/time      ;;-- get the complete time
view [ title: "The Time"                                   ;;<--open a view and give it a title
      below 
      text font-size 16 hr                                 ;; <--display the hour
      text font-size 16 mn                               ;;<--display the minute
      text font-size 16 sc                                 ;;<--display the second
      text font-size 16 font-color red tim        ;;<-- display the time
]                                                                   ;;<-- end of view


;;Here we use:    'request-file'  'request-dir'  'request-font'  pop-up system dialog boxes.

request-file/file %myfile.txt             ;;<-- pop-up 'Open' dialog box asking for myfile.txt.
request-file/file/save %myfile.txt     ;;<-- pop-up a 'Save' dialog box  for myfile.txt
request-dir                                      ;;<-- pop-up a 'folder' dialog box.
request-font                                    ;;<-- pop-up a 'font' dialog box.

;;Here we use:    'if error?'    and   'try'      we force an error by dividing by zero.

if error? try [0 / 0] [view [text "Divide by zero error !"]]

;;to make things clear:  
;;the first set of square brackets hold the error expression,
;;and the second set of square brackets deal with it.  i.e.  if error? try [ blahh blahh] [do something here if it's an error]

;;Here we use:    'text-list'      'copy'      'data'

Red [needs: view]
view [
    text-list data ["Me" "You" "Us" "Them"]
]

;;Or copy a list 

Red [needs: view]
myData: copy ["Me" "You" "Us" "Them"]
view [
    text-list data myData
]


;;Here we use:    'if'    'not'    and    'exists?'

if not exists? %noFile.dat [print "File not in folder"]  

;;this prints a message to console  'if'  file is  'not'  in folder.

;;Here we use:    'do'     'uppercase'    and    'lowercase'

Red [needs: 'view]
view [ t: text
            do [t/text: uppercase "hello"]                        ;;<--  change 'hello' to uppercase.
         ]
view [ t: text "HELLO"
            button "change" [t/text: lowercase t/text]     ;;<--  change 't' to lowercase.
         ]


;;Here we use:    '+'      '-'      '/'      '*'     'add'     'subtract'    'divide'    'multiply'

a:  4 + 4    print a                        ;;<-- add  and print to console.
a: add 4 4    print a                      ;;<--gives same result
a:  5 - 2    print a                         ;;<-- subtract  and print to console.
a: subtract 5 2   print a                ;;<-- gives same result
a:  10 / 6   print a                        ;;<-- divide  and print to console.
a: divide 10 6   print a                 ;;<-- gives same result
a:  4 * 2   print a                          ;;<-- multiply  and print to console.
a: multiply 4 2  print a                 ;;<-- gives same result

;;Here we use:    'square-root'    'sqrt'

s: square-root 100     ;; <--  will return the square root.

s: sqrt  100                ;; <--  will do the same.

;;Here we use:    'integer?'       Returns true if an integer.

integer? 6        ;; <--  will return true.
integer? 4.5     ;; <--  will return false.

n: 25
either integer? n [print "Yes, its an Integer"] [print "No, its not an Integer"]  ;; <-- will print 'Yes'

n: 23.5
either integer? n [print "Yes, its an Integer"] [print "No, its not an Integer"]  ;; <-- will print 'No'


;;Here we use:    'string?'    Returns true if a string.

string? "Hello"        ;; <--  will return true.
string? 44              ;; <--  will return false.

s: "Hello" 
either string? s [print "Yes, its a string"] [print "No, its not a string"]  ;; <-- will print 'Yes'    

s: 44
either string? s [print "Yes, its a string"] [print "No, its not a string"]  ;; <-- will print 'No'


;;Here we use:    'system/view/screens'     to find the screen size.

Red [needs: 'view]
        scrn: system/view/screens                             ;; <-- get the screen size.
        s: append form "screen size = " scrn/1/size   ;;<-- make it view friendly.
        view [ text s  ]                                                 ;;<-- display it.

;;Here we use:    'either' 

a: 10
either a = 9  [print "a equals 9"]  [print "a does not equal 9"]

;;So if the condition is true  eval first(true) block  else   eval second(false) block. 
;;In this case 'a' does not equal 9 - so the second block is evaluated.


;;Here we use:    'as-pair'        Combine X and Y values into a pair.

x: 20
y: 10
p: as-pair x y                 ;;<-- make them a pair
print P     

;;Here we use:    'until'

Red [needs: 'view]
n: 0
until [
 n1: mold n
   view/no-wait [text n1 ]
   wait 1
   n: n + 1
   n > 5
]
print "Done"

;;Here we use:    'while'

c: 1
while [c  < 10] [ print  c: c + 1]     ;;<-- condition block and body block
print "done"


;;Here we use:    'base'  'draw'  'pen'  'circle'  'box'  'triangle'  'polygon'  'fill-pen'  'line-width'

;;Remember 'draw' is a massive dialect (triangle, box, circle, arc, curve, etc, etc, etc ....)
Red [needs: 'view]
;; circle
 view [base 200x200 draw [pen yellow circle 100x100 40]]
;; square
 view [base 200x200 draw [pen red box 60x60 140x140]] 
;; triangle
 view [base 200x200 draw [pen blue triangle 60x110 140x110 100x50]]
;; polygon 
 view [base 200x200 draw [pen cyan polygon 100x60 120x120  60x140]]
;; box with fill-pen 
 view [base 200x200 draw [fill-pen red box 60x60 140x140]] 
;; circle with fill-pen
 view [base 200x200 draw [fill-pen yellow circle 100x100 40]] 
;; triangle with fill-pen 
 view [base 200x200 draw [fill-pen blue triangle 60x110 140x110 100x50]]
;; line with line-width set to 10
 view [base 200x200 draw [line-width 10 pen blue line 40x100 150x120]]


;;Here we use:    'tab-panel'

   Red [needs: 'view]
   view [ 
    Title "Tab-Panel Example"
    tab-panel 200x100 [
        "Tab 1 " [at 30x30 text font-size 16 font-color red "Panel 1 ...."]
        "Tab 2 " [at 30x30 text font-size 16 font-color blue "Panel 2 ...."]
        "Tab 3 " [at 30x30 text font-size 16 font-color green "Panel 3 ...."]
                      ]
     ]


;;Here we use:    'overlap?'  and  'within?'  .... Collision detection.


if overlap? a b [print "collided"]     ;;;; <- where a and b are the colliding faces.
-----------------------------------------------------------------
if within? point offset size [print "collided"] 
Note:  point is xy position- offset is offset of area - size is size of area


;;Here we use:    'trim'     'trim/head'      'trim/tail'     'trim/all'    'trim/with'  

;;;;  Removes spaces and/or chars from a string ;;;;

str: "    Hello World !.    "       ;;<-- str has 4 leading and 4 trailing spaces & 1 space in the middle.

trim str                                   ;;<-- remove leading and trailing spaces.
trim/head str                          ;;<-- remove leading spaces only.
trim/tail str                             ;;<-- remove trailing spaces only.
trim/all str                              ;;<-- remove all spaces.
trim/with str   "!."                    ;;<-- remove specified chars from a string.


;;Here we use:    'make-dir'      

make-dir %newDir/                               ;;<--create a new folder.

make-dir/deep %newDir/newSubDir/    ;;<--create a new folder with a sub folder.


;;Here we use:    'what-dir'                ;;<--get the active folder.  

dr: what-dir    
print dr  


;;Here we use:    'dir'         ;;<--lists the current dir. Or list the full  path.

dir                                         ;;<--simple - will list the current dir.
dir %/c/folder/                      ;;<--list the full path (where '%/c/folder/')  is your path.


;;Here we use:    'case'    'case/all'      ;;<--evaluates a block.

;;;; evaluates the first true condition only ;;;;
num: 200
case [
    num > 200 [print "num is more than 200"]
    num < 200 [print "num is less than 200"]
    num > 100 [print "num is more than 100"]
    num = 200 [print "num is 200"]
    true            [print "Yes its true"]
     ]
---------------------------------------------------
;;;; evaluates all true conditions ;;;;
num: 200
case/all [
    num > 200 [print "num is more than 200"]
    num < 200 [print "num is less than 200"]
    num > 100 [print "num is more than 100"]
    num = 200 [print "num is 200"]
    true            [print "Yes its true"]
     ]


;;Here we use:    'sort'    'sort/reverse'

num: [5 3 9 7 6 4 8]
sort num                    ;;<--sort ascending.

sort/reverse num      ;;<--sort descending.

strng: ["S" "E" "D" "N" "F" "X" "W"]
sort strng                 ;;<--sort string ascending.

sort/reverse strng    ;;<--sort string descending.


;;Here we use:    'alter'     'find'   

a: "Hello"                ;;<--make 'a' = 'Hello'.    
    
alter a " World !"     ;;<-- appends  a   to  'Hello World !' (World ! is not there, so it is added)

alter a "!"        ;;<-- deletes  '!'  from  a  (when a value exists it is removed)

alter a "!"        ;;,-- puts  '!'  back  (when a value does not exist it is appended)

--------------------------------------------

a: ["you" "me" "us"]
alter a "them"    ;;<--add  'them' 
alter a "us"        ;;<--remove  'us'
alter a "us"        ;;<--add 'us' back at the end.

find a "us"          ;;<--returns the series from the position value is found.
                                 See other 'find' refinements !


;;Here we use:   'change'    ;;<--changes a value in a string or block.

a: "you me us them"  
change a "yes"          ;;<--replace  the first 3 chars with 'yes'
print a                      ;;<--now print result to console.
----------------------------------------
n: [11 12 13 14]
change n 22              ;;<--replace  11 with 22.
print n                       ;;<--print result to console.
----------------------------------------
n: [12 13 14 15]
change n [88 99]
print n


;;Here we use:   'extract'    'extract/index'

extract [1 2 3 4 5] 2    ;;<--extracts every 2nd number from the block.
extract "Hello World" 3    ;;<--extracts every 3rd char from string.

extract/index "abcdefghijklm" 2 4    ;;<--start from offset 4 and extract every 2nd char.

g: extract/index "abcdefghijklm" 2 3
print g


;;Here we use:   'split'      ;;<--break a string into pieces using delimiters.

strng: "you and    me"
split strng " "


;;Here we use:   'remove'    'remove/part'

d: [2 4 6 8 10]
remove d                  ;;<--remove the first item from series.

s: "abcdefgh"
remove s                 ;;<--remove the first item from string.

remove/part d 2      ;;<--remove the first two items.
remove/part s 3       ;;<--remove the first three items.


;;Here we use:   'split-path'     ;;<--splits a path, returning path and target.

s: remove split-path  %desktop\ufo1.png     ;;<--using remove gives us the target.
print s

;;Here we use:   'to-local-file'    'to-local-file/full'      'to-red-file'

to-local-file   %/c/users/myfile.dat                    ;;<-- red file to local file format.
== "c:\users\myfile.dat"                          

to-local-file/full  %myfile.dat                             ;;<-- red file to full path.
== "c:\users\desktop\redthings\myfile.dat"

to-red-file "c:\users\myfile.dat"                         ;;<-- local file format to Red file.
== %/c/users/myfile.dat


;;Here we use:    'text-list'    'pick'

Red [needs: 'view]
view [title "Text-List"
    t: text "Click on a month ->"
    text-list 100x100 data[                         ;;<--start text-list
        "January" "February" "March" "April"
        "May" "June" "July" "August" "September"
        "October" "November" "December"]   ;;<--end text-list
    [t/text: pick face/data face/selected]     ;;<--what did we select
      ]                                                          ;;<--end view

-------------------------------------

;Pick from block
p: [a b c d e f g]
g: pick p 3
print g  

;Pick from string
s: "abcdefghijklm"
g: pick s 8                          
print g


;;Here we use:    'drop-down'

Red [needs: 'view]
view [
drop-down "We" data ["You" "Me" "Us" "Them"]
     ]


;;Here we use:    'drop-list'

Red [needs: 'view]
view [title "Drop-List"
    t: text "Chose and click ->"
    drop-list data ["You" "Me" "Us" "Them"] 
    [t/text: pick face/data face/selected]
      ]  ;;<--end view


;;Here we use:    'slider'     'progress'     'on-change'

;; display a 'slider' and a 'progress' and use 'on-change' to update progress data.
Red [ needs: 'view]
      view [title "slider, progress bar"
        below   
        slider 100x20 data 10%  on-change [p/data: face/data]
        p: progress 100x20 10%        
    ]


;;Here we use:    'what'   'about'

Typing 'what' at the Red console prompt will give you ....
.... brief information about all Red functions.

Typing 'about'  at the Red console prompt will give you ....
.... the Red version currently in use ....


;;Here we use:    'unique'              removes all duplicates.

unique "abcdabcdefg"               ;;<-- result will be   >> "abcdefg"

unique [1 2 3 4 1 2 3 4 5 6 7 8 ]      ;;<-- result will be  >> [1 2 3 4 5 6 7 8]



;;Here we use:    'to binary!'      'to string!'

b: "Hello"
b: to binary! b             ;;<-- change to binary.
print b

b: to string! b             ;;<-- change back to string.
print b

;;also check out my 'Red Programming' page (example 18)

;;Here we use:    'ask'

ask "Enter your name: "             ;;<--copy this to the console.

n: ask "Enter your name: "         ;;<--now n will hold the string.

;;Here we use:    'blue'      plus a list of all alternative colours.

Red [title: "MyColours" needs: 'view]
view [text font-color blue "Hello"        ;;<--set text colour.
         text orange "Hello"                    ;;<--set text background.
      ]

;;list of colours: 
;;aqua, beige, black, blue, brick, brown, coal, crimson, cyan, forest, gold, gray, green
;;ivory, khaki, leaf, linen, magenta, maroon, mint, navy, olive, orange, papaya, pewter
;;pink, purple, red.     

 ;<<Back to top>>;                                                                                                           

;;Here we use:   'random'     'random/seed'   'random/only'

random/seed now/time          ;;<-- seed the random generator.
loop 9 [
r: random 10                         ;;<-- get a random number.   
print r
        ]

Random/only ["one" "two" "three" "four"]    ;;<--picks a random value from a series.

;;Here we use:   'max'     'min'

max 420 610
min 420 610

max "abcd"  "dcba"
min "dcba"  "abcd"

max [1 2 3] [3 2 1]


;;Here we 'interpret' and 'compile' from the Dos prompt.

;;note: 'red.exe' should be the red version you have in your folder.
> red.exe  myscript.red              ;;<-- will interpret script, where 'myscript.red' is your script.
> red.exe  -c  myscript.red                   ;;<-- will compile script to Dos.
> red.exe  -c  -t windows myscript.red         ;;<-- will compile script to Windows.

;;See my     'AutoRed'     app to make this much easier.


Will be adding more soon .... 

Comments