b = view(filename ‖ website_address ‖ object_nameʃ, optional_named_argumentsʅ);
The
view function displays the contents of a file or shows a website. The function expects a string expression representing a file (
filename) or a website URL (
website_address), or a CSPro object (
object_name) such as a
document,
freq,
image, or
report. If a website URL or a file with the extension
.html or
.htm is provided, it is shown in an embedded window. For other files, an external application is launched to display the file using the system's default viewer for that file type.
Optional
named arguments can be used to control how the embedded web browser displays on Windows:
- title := string expression giving the title of the window.
- width := numeric expression specifying the width of the window in display units.
- height := numeric expression specifying the height of the window in display units.
- showCloseButton := conditional expression that, if false, hides the window's Close button.
If either the height or width is specified, then both values have to be provided. Hiding the Close button also removes the margin around the web browser, so the browser will fill the entire embedded window.
The function returns a logical value of 1 (true) if the file exists and the external application or embedded web browser could be launched successfully and 0 (false) otherwise.
view("https://www.census.gov/data/software/cspro.html");
view("../Nineties Images/carn03.jpg");
view("hh-report.html", title := "Household Completion Report",
width := 400, height := 600,
showCloseButton := false);