Leading spaces INPUT

Discussions related to graphics (2D and 3D), animation and games programming
Post Reply
Ric
Posts: 21
Joined: Tue 17 Apr 2018, 21:03

Leading spaces INPUT

Post by Ric » Fri 26 Apr 2019, 21:16

Evening all,
I have a simple question,

Is it possible to create a string using INPUT where the leading spaces are accepted as characters?
Currently my code is similar to this

INPUT"Text ";a$
PRINT a$
IF text inputted is " test"
the result is
"test"
The result i want in a$ is " test"

Can anyone help

Regards Ric

Zaphod
Posts: 78
Joined: Sat 23 Jun 2018, 15:51

Re: Leading spaces INPUT

Post by Zaphod » Fri 26 Apr 2019, 23:57

It looks like the FNinput in the NOWAIT library will do that for you.

Z

Ric
Posts: 21
Joined: Tue 17 Apr 2018, 21:03

Re: Leading spaces INPUT

Post by Ric » Sat 27 Apr 2019, 11:02

Perfect.
Thanks Z
Ric

DDRM
Administrator
Posts: 148
Joined: Mon 02 Apr 2018, 18:04

Re: Leading spaces INPUT

Post by DDRM » Mon 29 Apr 2019, 14:38

An alternative would be to use INPUT LINE? From the manual: "The item input is taken as is, including commas, quotes and leading spaces. "

Best wishes,

D

Post Reply