Hi, I'm trying a simple REBOL script that inputs a name and then prints it in uppercase (to practice using functions).
When it's run, the name is entered in lower case, the function is called but then when I try "print low-name up-name" (which should print the lower case version and upper case version), the original has been turned into upper.
I'm assuming it's the way I pass the variable to the function, but could do with a clue about where to fix it.
Thanks in advance
R E B O L [
Title: "Brian Test Program"
Version: 1.0.0
Date: 14-Apr-2014
Author: "Brian Turner"
Purpose: (Test stuff out in Rebol)
]
{
This is a function that doesn't return a value (like a SUB)
- uses the "does" command
}
print-hello: does [print "Hello"]
{
This is a function that returns a value
- uses "func" command
}
upper-name: func [arg1] [return uppercase arg1]
;main program
prin "What is your name: "
low-name: input
print-hello
print low-name
up-name: upper-name low-name
prin [low-name "-> "]
print up-name