Basic Input

Blitz3D Forums/Blitz3D Beginners Area/Basic Input

Kirkkaf13(Posted 2010) [#1]
Hi everyone,

I am a little confused to what the difference is between.

age% = Input ("What is your age?")


and

age% = Input$ ("What is your age?")


The bit I am confused about is the Input$ or Input, does this return any different value.

OneHitWonder


GfK(Posted 2010) [#2]
Makes no difference, as Input always returns a String value.

Regarding your example, though, you're taking a string (the result of Input()) and feeding it into an Integer. You can do that in Blitz3D but in general you should get into the habit of manually casting the result to an integer, i.e.

age% = Int(Input("What is your age?"))


Best way to get out of bad habits is to not get into them in the first place. ;)


Kirkkaf13(Posted 2010) [#3]
@GFK

Thanks for your response I have had some experience in different programming languages however I wasn't sure whether Input("") returned an integer number and Input$("") returned a string. Similar to input and raw_input in python 2.

Again thanks for your response!

OneHitWonder