Leading spaces INPUT

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

Leading spaces INPUT

Post by Ric »

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 »

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

Z

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

Re: Leading spaces INPUT

Post by Ric »

Perfect.
Thanks Z
Ric

DDRM
Posts: 200
Joined: Mon 02 Apr 2018, 18:04

Re: Leading spaces INPUT

Post by DDRM »

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