home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH09LIST C:\UT2004"
- // Identifies the package
- // CH09_06LIST.uc
-
-
- class CH09_06LIST extends Commandlet;
-
- function int main(string args){
-
- //#1 Declare a series of strings
- local string szRedWoodSongLineA,
- szRedWoodSongLineB,
- szRedWoodSongLineC,
- szRedWoodSongLineD,
- szRedWoodSongLineE;
- //#2 string for source information
- local string szAuthor;
- local string szPoemTitle;
- local string szBookTitle;
- //string for concatenation
- local string szSourceInformation;
- local string szLine;
- local int iCtr;
- local int iStrLen;
-
- // #3
- //Initialize local identifiers
- szRedWoodSongLineA = "A California song," ;
- szRedWoodSongLineB = "A prophecy and indirection," $
- " a thought impalpable to breathe as air,";
- szRedWoodSongLineC = "A chorus of dyads, fading," $
- " departing, or hamadryads departing,";
- szRedWoodSongLineD = "A murmuring, fateful, giant voice, " $
- " out of the earth and sky,";
- szRedWoodSongLineE = "Voice of a mighty dying tree in " $
- "the redwood forest dense.";
- szAuthor = "Walt Whitman";
- szPoemTitle = "Song of the Redwood-Tree";
- szBookTitle = "Leaves of Grass";
-
- //#4 Concatenate the information for one string
- szSourceInformation $= Chr(13) @ szAuthor;
- szSourceInformation $= Chr(13) @ szPoemTitle;
- szSourceInformation $= Chr(13) @ szBookTitle;
-
-
-
-
- //#5 Make a string using a concatenation operator
- //Use the Chr() function and an ASCII code
- iStrLen = Len(szPoemTitle);
- for(iCtr = 0; iCtr < iStrLen; iCtr++){
- szLine $= Chr(186);
- }
-
- //#6 Use the character string to create a title bar
- // print the stanzas and the source information
- // close with three successive strings
- log("CH09_06LIST");
- log(szLine @ szPoemTitle @ szLine);
- log(Chr(13) @
- szRedWoodSongLineA @ Chr(13) @
- szRedWoodSongLineB @ Chr(13) @
- szRedWoodSongLineC @ Chr(13) @
- szRedWoodSongLineD @ Chr(13) @
- szRedWoodSongLineE
- );
- log(szSourceInformation);
- log(szLine @ szLine @ szLine);
-
- return 0;
- }
-
-
-
-
-
-
-