Currently Being Moderated

Try 1: Page 3

VERSION 1

Created on: Dec 6, 2007 2:45 PM by Curl Education - Last Modified:  Jan 3, 2008 4:33 PM by Curl Education

!../../wiki/easy-ide-book/common/images/prev_page.gif! !../../wiki/easy-ide-book/common/images/toc.gif! !../../wiki/easy-ide-book/common/images/next_page.gif!

 

 

 

Structure of our created program

 

 

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

 

 

1. Line 1 herald declaration

 

 

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.

 

 

           

-


           

<font color="#006968">Herald Declaration Syntax</font>

            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.

</font>            

-


           

 

 

2. Line 2 character encoding specification

 

 

{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

 

 

{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!

 

 

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

 

 

{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.

 

  • <font color="green">CORRECT:</font>  {font:courier new}{text color = "red", font-size = 15pt, Hello Curl!}

  • <font color="red">INCORRECT:</font> {text color = "red", Hello Curl!, font-size = 15pt}

 

 

 

 

Table 1-1: Examples of text options

Option Name

Explanation

Example Value

color

Specifies the text color

"red", "blue", "#FF00FF"

font-size

Specifies the font size

11pt, 1cm

font-weight

Specifies bold-face

"normal" or "bold"

font-style

Specifies italic

"normal" or "italic"

text-underline?

Specifies underlining

true or false

 

 

 

           

-


           

<font color="navy">Arguments</font>

            <font color="navy">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.</font>            

-


           

 

 

 

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

 

 

{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" …}.

 

 

 

Table 1-2: Examples of text options and predefined styles

Text Style

Equivalent Text Style

Explanation

{bold ...}

{text font-weight = "bold", ...}

Bold

{italic ...}

{text font-style = "italic", ...}

Italic

{small ...}

{text font-size = 0.8em, ...}

Small font

{big ...}

{text font-size = 1.5em, ...}

Large font

{underline ...}

{text-underline? = true, ...}

Underline

 

 

 

           

-


           

<font color="navy">IDE Layout</font>

            <font color="navy">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.    

Table 1-3:  Examples of panes included in IDE
    |Type|Explanation| |Project Pane|Projects currently open in the IDE, as well as the resources for those projects, such as files, are displayed in a tree structure.| |Definition Pane|The names of classes and methods included in the current project are displayed in alphabetical order. You can navigate to the source code from this list| |Editor Pane|Used to edit source code| |Error Pane|Displays any syntax errors that may occur at compile time.| </font>            

-


           

 

 

 

 

 

!../../wiki/easy-ide-book/common/images/next_page.gif!

Average User Rating
(0 ratings)




There are no comments on this document

More Like This

  • Retrieving data ...