This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-03-25 05:50:00

mezero
New Scratcher
Registered: 2013-03-25
Posts: 1

If word

How can I make a variable that dectects weither an answer is a number or a word (word preferably).

Offline

 

#2 2013-03-26 13:03:05

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: If word

Well, here's a method that works online, though not offline (unless you put this in a separate broadcast):

set [Type v] to [Word]
if <(Number or Word) < (0)>//Won't run if (Number or Word) is a word.
 set [Type v] to [Number]
else
 if <(Number or Word) > (-1)>//Won't run if word; safeguard.
  set [Type v] to [Number]
 end
end

I hope that this helps!

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer