What type is `this` in a sketch?

Hi,

When I run this code in a sketch:

println(this);

I see this in the console:

sketch_221111b@31393958

What datatype or class does this belong to?

I’m trying to write a function that accepts this as an argument, but I got stuck trying to figure out what type the parameter should be.

Thank you

Hello!
“This” is not a datatype. Read more here:

:nerd_face:

Yes.

See also Can anyone help explain the following use of "this" and "PApplet"?

3 Likes

I’m trying to write a function that accepts this as an argument, but I got stuck trying to figure out what type the parameter should be.

After following the link shared above (marked as solution), I learned that that type of such an argument should be PApplet. Thanks for your help.

1 Like

PApplet is the super datatype.

But the actual datatype is the name of the 1st tab w/o the extension “.pde”.

1 Like

And inside a class it’s the class

1 Like