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

#1 2009-04-13 12:38:38

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

traces?

When i was playing around with scratch earlier, due to haven gotten used to flash, i found that the lack of a trace feature turned out quite annoying.
for the benefit of those who do not know what im talking about, a trace is a output 'popup' you can add to your code. for example (and this is using flash code)

Code:

var i:Number = 0
onEnterFrame = function () {
  if(i>=5){
    trace(i)
  }
  i++
}

Basicly what is happening in this code, every frame a variable of i is being incremented and if it has a value of 5 or above, a trace, or a popup menu, is telling me what the value of i is. traces can also use string values

Code:

var i:Number = 0
onEnterFrame = function () {
  if(i>=5){
    trace("i is above or equal to 5")
  }
  i++
}

now all that's being traced is a text output that says i is above or equal to 5 ("" is string value).

i am awear that this would probally sound very confusing to alot of people, but I hope most of you can understand roughly where im going with this.

A trace has no real use to code, however it is a very commonly used function to detect any errors that occur in code, or when/what happens when a number of diffrent elements are being used.

i think it could be quite usefull to add this to scratch, and mabye the output box could be a small popup in the corner of the screen.

thanx 4 listening

Offline

 

#2 2009-04-13 14:39:17

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: traces?

I missed this too, but I have no idea how it could be implemented in Scratch. For now, I use the say[] block, it usually does it's thing xD


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#3 2009-04-14 04:10:24

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: traces?

JSO wrote:

For now, I use the say[] block, it usually does it's thing xD

i forgot about that ;P

Offline

 

Board footer