The table below contains example CloudWriter code. If you want to see the source for the code, click in the Source column. If you want to see the program executed, click in the Execute column. If you want to see related HTML source, click in the Execute column and use your browser's View Source option.
Description |
Source |
Execute |
Hello, WorldThis is a simple program demonstrating a way to emit HTML. |
example1.cw | example1.cw |
Hello, World, ReduxThis program shows a different way to emit HTML using the Client object. |
example2.cw | example2.cw |
Embedding ExpressionsHTML output may contain CW expressions that will be evaluated and emitted to client. |
Example2a.cw | Example2a.cw |
Reading a FileThis program reads a file using the GetFile function and sends it to the client as HTML. |
example4.cw | example4.cw |
Replacing TextOnce you've read a file into a string you can scan the string and replace symbols with CW expressions. |
x.html | |
Simple ProgrammingA loop. |
example3.cw | example3.cw |
Calling a FunctionThis shows that CW programs can be either simple scripts or declarations together with a function call specified in the URL |
HelloWorldMain.cw | HelloWorldMain.cw?eppfunction=main() |
Getting Form VariablesThe .html form collects the data. The data is submitted to a CW program that displays it. |
Example6.cw | Example 6 HTML |
Store a CookieThis example gets your name from a form. Then it stores it as a cookie. Another program is used to retrieve the cookie, demonstrating the persistence of the cookie. |
store_a_cookie.cw | store_a_cookie.htm |
Retrieve a CookieThis example gets the cookie stored by store_a_cookie.cw. |
retrieve_a_cookie.cw | retrieve_a_cookie.cw |
Send MailThis example gets your email address and sends you an email! |
sendmail.cw | SendMail.htm |
Database AccessThis example opens an existing database and displays the contents. |
||
ODBC Database AccessThis example works the same as the previous example but uses ODBC. |
The non-instructional examples below are used for testing.
Description |
Source |
Execute |
Store Some CookiesStore two cookies values. |
store_cookies.cw | store_cookies.cw |
Retrieve Some CookiesRetrieve the values stored above and then zero out the cookie values. |
get_cookies.cw | get_cookies.cw |
Encode CookieEncode and store a complex cookie value that has arrays and structs. |
encode_cookie.cw | encode_cookie.cw |
John Elkins (john@vermontdatabase.com) 26 Oct 2002