Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - Português

Change language to:
English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Ajuda do Scilab >> Ferramentas Windows > consolebox

consolebox

show or hide the OS window running Scilab (MS Windows)

Syntax

consolebox on
consolebox off
status = consolebox("toogle")
status = consolebox()

Arguments

status

"on" | "off" : visibility of the OS window after the call to consolebox.

Description

  • consolebox on : makes the OS window visible and adds its button in the task bar. The consolebox black window lays on the background, and then may be masked by other windows of the OS desktop.
  • consolebox off : masks the OS window and its button from the task bar.
  • consolebox toogle : toogles the OS window's visibility.
  • status = consolebox() : queries the visibility of the OS window.

The "consolebox" black window is the "hidden" terminal of the Operating system from which the current Scilab session has been run. It is somewhat the "dark side" of your session :) Each Scilab session has its own "consolebox". Its lifetime is the Scilab session lifetime: The consolebox of a session is killed when the Scilab session is quit.

Some low level Scilab functions (such as the documentation builder or other ones) send most of their errors messages in this window. They would be considered as some spam in the Scilab console. Nevertheless, these messages are very helpful for debugging. consolebox on make them visible.

The "consolebox" black window can't be closed interactively: its X-cross at the upper-right corner is disabled. Killing it kills Scilab session.

When some external OS instructions are send to the operating system through host(..) or equivalently unix(..), or any other unix_w(..), unix_g(..), unix_s(..), or unix_x(..) Scilab function, these OS instructions are processed within the Scilab consolebox.

host(..) and unix(..) show the results in the consolebox itself

unix_g, unix_w, unix_x, unix_s catch results returned by the OS and cancel any display in the consolebox:

  • r = unix_g(..) grabs and returns the results in any variable r.
  • unix_w(..) displays results in Scilab's console, and returns nothing.
  • unix_x(..) displays results in a messagebox.
  • unix_s(..) runs silently: it returns and displays no results returned from the OS.

host("cls") clears the consolebox screen
When the console has the focus, pressing the F12 key toggles the consolebox on|off

Examples

consolebox on
mprintf("See the consolebox button appearing in the task bar.\n"+..
  "Click on it to bring the consolebox on the foreground.\n");
sleep(10,"s")
consolebox('toggle')
sleep(5,"s")
// Now: press the F12 key to toggle the consolebox
consolebox on
consolebox()

// Instructions passed to host() or unix() or other unix_#() functions are
// processed in the consolebox:
host("echo Test of output") // displays "Test of output" in the consolebox
host("cls")  // clears the consolebox screen
host("set")  // lists all defined MS Windows environnement variables

// Other unix_#() commands catch results returned by the Operating System
//  instead of displaying them in the consolebox:
host("cls")
unix_w("echo Test of output") // "Test of output" is now displayed in Scilab console
r = unix_g("set");   // Environment variables are returned in r.
r                    //   Nothing is displayed in the consolebox
unix_x("set");       // Results are displayed in a messagebox. Nothing in consolebox

See also

  • console — Keyboard Shortcuts in the Console Window
  • host — execução de comandos do Unix ou DOS
  • unix_w — execução de comando shell (sh), saída redirecionada à janela do Scilab
  • unix_g — execução de um comando shell (sh), saída redirecionada a uma variável
  • unix_x — execução do comando shell (sh), saída redirecionada a uma janela
Report an issue
<< Ferramentas Windows Ferramentas Windows createGUID >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:09:57 CET 2017