Thread Rating:
  • 464 Vote(s) - 2.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Page 3: Examining the Program Structure of Text Display
06-16-2011, 01:38 PM, (This post was last modified: 06-23-2011, 03:56 PM by ashimo.)
#1
Page 3: Examining the Program Structure of Text Display
Structure of our created program

So, let’s examine the structure of the program that we just created.



1. Line 1 herald declaration

Code:
curl 6.0 applet

The text on line 1 is known as the “herald declaration.” This describes the version of Curl RTE that will execute this source code, as well as the type of the file.



Herald Declaration Syntax

The curl expression has the following syntax: {curl api-version-list component-type} where
  • api-version-list: a list of API versions that can be used to interpret the page. Use commas to separate version numbers. If a user loads a page into the Curl RTE, it checks to make sure that this installation of the RTE can support at least one of the API versions listed in api-version-list. If the installation is compatible, the RTE loads the file. Otherwise, it throws an error.
  • component-type: the type of Curl content. Specify applet for applets; specify package for packages; or specify script for scripts.



2. Line 2 character encoding specification

Code:
{curl-file-attributes character-encoding = utf8}
The character encoding for this file has been specified. In this case, the specification is for utf8.

3. Applet declaration

Code:
{applet manifest = manifest.mcurl,
    {compiler-directives careful? = true}
}

On line 3, the locations of the files referenced by this applet, such as the manifest, are specified.

4. Hello Curl!

Code:
Hello Curl!

The actual program begins from this point. The parts outside the range defined by the outmost “{“ and “}” are referred to as the “top level.” Any text for which a style is not specified, like "Hello Curl!", is displayed on the browser as is.

5. Text style

Code:
{text
    font-style = italic,
    font-size = 30pt,
    color = red,
    Text with color or font setting
}

With Curl, a style is created by enclosing the text inside “{“ and “}”. The name of the style is specified immediately after “{“ and then, the arguments to which the style is applied are described, separated by “,”.

Style options are specified first in the list of arguments, then followed by the text displayed on the screen.
  • CORRECT: {text color = "red", font-size = 15pt, Hello Curl!}
  • INCORRECT: {text color = "red", Hello Curl!, font-size = 15pt}



Arguments

Within a program, the values that are exchanged in a funtion call or similar operation are called arguments. Processing is performed using the exchanged value, and then the result is returned.



Curl, like other languages, supports the nesting of styles. The browser displays text according to this nesting. Note that multiple spaces between text or carriage returns will be displayed as a single space. If we insert a blank line between blocks of text, then those blocks are displayed as separate paragraphs.

Thus, a Curl applet contains a herald declaration, text, and styles.

6. Predefined text styles

Code:
{bold {italic text using defined format}}

For text styles that we use frequently, such as bold and italic, we can use pre-defined styles. Style has the same meaning as {text font-weight = "bold" …}.



IDE Layout

The IDE supports two types of window layouts. One is used for editing, while the other is used for debugging. Each layout consists of panes that are designed specifically for either editing or debugging. The default layout is the editing layout. If an error is detected at run time, however, the layout automatically switches to the debugging layout. Icons on the toolbar can also be used to switch the layout. Each layout can be customized. Once you have changed a layout to suit your needs, you can then save it. To subsequently restore the default layout, go to the IDE “View” menu and then select “Restore Layout” --> “From Default.”





The IDE lets you display several different panes. For example, the following panes are available.




Attached Files
.png   1-1.PNG (Size: 8.89 KB / Downloads: 1,281)
.png   1-2.PNG (Size: 9.39 KB / Downloads: 1,235)
.png   1-3.PNG (Size: 11.98 KB / Downloads: 1,240)


Possibly Related Threads...
Thread Author Replies Views Last Post
  Page 2: Displaying Text and Text Styles ashimo 1 4,590 01-13-2014, 04:01 PM
Last Post: faris
  Page 6: Summary and Extra Practice ashimo 0 3,833 06-20-2011, 05:11 PM
Last Post: ashimo
  Page 5: Examining the Program Structure of Images and Links ashimo 0 3,880 06-16-2011, 01:50 PM
Last Post: ashimo
  Page 4: Images and Links ashimo 0 3,501 06-16-2011, 01:41 PM
Last Post: ashimo
  Page 1: Creating a Project ashimo 0 3,540 06-16-2011, 01:14 PM
Last Post: ashimo
Forum Jump:


Users browsing this thread:
2 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('44')