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

#1 2012-06-20 15:10:32

hart20
New Scratcher
Registered: 2012-06-12
Posts: 9

enter the problem

two questions

1) how do you reject an empty answer in the "ask __ then wait"; i.e. the user justs hits the enter key without filling in anything in aswer to the question

2) can you keep a script from restarting if a user is just hitting the enter key while your sprite is doing something.

Thanks for the help.

Offline

 

#2 2012-06-20 15:14:24

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: enter the problem

2.) yes, online the enter key does nothing.

1.)

repeat until <not<(answer)=[]>> //empty space inside the equal spot
ask [whatever] and wait
end
set [answer1 v] to (answer)

Last edited by TorbyFork234 (2012-06-20 15:14:49)

Offline

 

#3 2012-06-20 15:22:41

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: enter the problem

TorbyFork234 wrote:

2.) yes, online the enter key does nothing.

1.)

ask [whatever] and wait
repeat until <not<(answer)=[]>> //empty space inside the equal spot
ask [whatever] and wait
end
set [answer1 v] to (answer)

Fixed.  smile


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

#4 2012-06-21 04:53:33

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: enter the problem

SciTecCf wrote:

TorbyFork234 wrote:

2.) yes, online the enter key does nothing.

1.)

ask [whatever] and wait
repeat until <not<(answer)=[]>> //empty space inside the equal spot
ask [whatever] and wait
end
set [answer1 v] to (answer)

Fixed.  smile

The first askblock is unneccessary, it will work fine without it. Otherwise, this will fix your problem! Scratch On!

Edit: 1,001st post!

Last edited by sonicfan12p (2012-06-21 04:54:05)


Why are the secret organizations getting all the attention?  mad

Offline

 

#5 2012-06-21 05:02:42

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: enter the problem

sonicfan12p wrote:

SciTecCf wrote:

TorbyFork234 wrote:

2.) yes, online the enter key does nothing.

1.)

ask [whatever] and wait
repeat until <not<(answer)=[]>> //empty space inside the equal spot
ask [whatever] and wait
end
set [answer1 v] to (answer)

Fixed.  smile

The first askblock is unneccessary, it will work fine without it. Otherwise, this will fix your problem! Scratch On!

Edit: 1,001st post!

It's necessary because if, earlier in the project, another question was asked, and the answer wasn't blank, the question would never be asked.

What an achievement, by the way.  big_smile


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

Board footer