# Print in console

**URL:** <https://discourse.processing.org/t/print-in-console/24650>\
**Category:** Beginners\
**Created:** [October 16, 2020, 4:13pm UTC](https://discourse.processing.org/t/print-in-console/24650 "2020-10-16T16:13:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alcys6](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alcys6](https://discourse.processing.org/u/Alcys6)\
**Post date:** [October 16, 2020, 4:13pm UTC](https://discourse.processing.org/t/print-in-console/24650/1 "2020-10-16T16:13:14Z")

</div>

Hello,  
It has been quite a while that I used processing hence I have old habits that do not seems to work now.  
Previoulsy I was used to « print » the content of the variables in the console at the bottom of the screen with the command print(barX);  
Now it does not work as nothing apperas in the console.  
Can you help me please?  
Below is the code I am using.

"

- @name Hue
- @description Hue is the color reflected from or transmitted through an
- object and is typically referred to as the name of the color (red, blue,
- yellow, etc.) Move the cursor vertically over each bar to alter its hue.  
\*/  
const barWidth = 20;  
let lastBar = -1;

function setup() {  
createCanvas(720, 400);  
colorMode(HSB, height, height, height);  
noStroke();  
background(0);  
}

function draw() {  
let whichBar = mouseX / barWidth;  
if (whichBar !== lastBar) {  
let barX = whichBar \* barWidth;  
fill(mouseY, height, height);  
rect(barX, 0, barWidth, height);  
print(barX);  
lastBar = whichBar;  
}  
}  
"

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 16, 2020, 4:25pm UTC](https://discourse.processing.org/t/print-in-console/24650/2 "2020-10-16T16:25:00Z")

</div>

Hi @Alcys6  
Please consider to edit your post above clicking on the pencil and adding ``` one line above and one line below your code.  
The processings IDE does not print to the console, but the on-lined [P5.js Web Editor](https://editor.p5js.org/) will.

---

<div class="post-metadata">

**Author:** ![Alcys6](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alcys6](https://discourse.processing.org/u/Alcys6)\
**Post date:** [October 16, 2020, 4:30pm UTC](https://discourse.processing.org/t/print-in-console/24650/3 "2020-10-16T16:30:10Z")

</div>

Hi @noel,  
Thank you for this! I have added the “” as requested.  
But I am not sure to understand what you advice about “on-lined P5.js Web Editor”?  
I am not a native english speaker so i might have missed something.  
Thanks

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 16, 2020, 4:54pm UTC](https://discourse.processing.org/t/print-in-console/24650/4 "2020-10-16T16:54:18Z")

</div>

> [@Alcys6](#):
>
> added the “” as requested.

It’s not " but three grave symbols ```  
Or select all the code and then hit the \</\> button in the edit box.  
As for the Editor, just access the site, past your code and run.  
You will see the print() function working.
