Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 2D Blocks
  4. Printing Messages in Alert or Console

Printing Messages in Alert or Console

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 859 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

    Description

    Very often, we need to print out some text messages. For example, we can show the user some information in a dialog box (the alert window), or log some information in the console to debug our program. Note that this is different from printing inside the stage window.

     

    Showing an Alert Message

    To show an alert message, you can use this block from the Control category:

    Note that in the alert mode, the code blocks below this block will not run until you click “OK” on the alert window. Therefore, alert messages are great if you want to force the user to acknowledge something before continuing, or if you want to show the user some information that he or she has to read first.

     

    Parameters

    • Message: You can write any text message in the input space, including emoji symbols.
    • Alert: You need to select “alert” in the dropdown
    • Color: The color will be ignored for alert messages, since all alert messages have to be in black.

     

    Printing a Message to the Console

    The console is a small window at the bottom of the playground, next to the backpack. You can open or close it like this.

    To print a message in this console, you need to select “console” in the “print” block, and you can also specify the color of this message. When you print a new message, a red counter will show up to alert you.

     

    Scrolling Down the Console

    When you click the green flag button, all the messages in the console will be cleared out. When there are many messages, you can scroll down the console to view them. You can also check the “autoscroll” checkbox, so the console will scroll down to the latest message automatically.

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode