Oxygen Basic
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Latest OxygenBasic.zip at GitHub
(Click on the Wizard)
Home
Help
Search
Login
Register
Oxygen Basic
»
Programming
»
Problems & Solutions
»
Question about Input() in console.inc
« previous
next »
Print
Pages: [
1
]
Author
Topic: Question about Input() in console.inc (Read 1877 times)
0 Members and 1 Guest are viewing this topic.
Arnold
Guest
Question about Input() in console.inc
«
on:
February 28, 2015, 03:08:23 AM »
Hi Charles,
in console.inc the input() function does not consider the cr codes. Is this intended? If yes, I will respect this in my little project.
Roland
Code: OxygenBasic
include
"$/
inc
/console.inc"
printl "Your name? "
a = Input()
print
"Length
of
your name: "
len
(a)
b =
left
(a,
instr
(a,
chr
(10))-1)
c =
left
(a,
instr
(a,
chr
(13))-1)
printl "Maybe length is: "
len
(b)
printl "But length could also be: "
len
(c)
printl cr cr
print
"Enter ..."
waitkey
Logged
Charles Pegge
Guest
Re: Question about Input() in console.inc
«
Reply #1 on:
February 28, 2015, 04:39:30 AM »
Hi Roland,
You can clean up the raw input like this:
a = ltrim rtrim Input
Logged
Arnold
Guest
Re: Question about Input() in console.inc
«
Reply #2 on:
February 28, 2015, 04:49:07 AM »
This works fine. Thank you.
Logged
Print
Pages: [
1
]
« previous
next »
Oxygen Basic
»
Programming
»
Problems & Solutions
»
Question about Input() in console.inc