06-20-2011, 01:23 PM,
(This post was last modified: 06-23-2011, 04:27 PM by ashimo.)
|
|||||
|
|||||
Page 7: Summary
TRY 5 Summary
Reading and writing data from/to a file Step 1. Specifying the location of a file Code: let location_variable_name:Url = {url “path to file location”} Step 2. Opening file as a Stream
Code: let stream_variable_name:TextInputStream = {read-open location_variable_name} Step 3. Using methods to read or write data
Step 4. Closing the file Code: {if-non-null stream_variable_name then Repeat Expressions until expression (processing repeats until conditional expression is true) Code: {until conditional_expression do for expression (specifying a range) Code: {for repeat variable:int = initial_value to final_value step step_size value do As well as to, there are also the below, downto, and above keywords. The step_size can be omitted when the desired step_size is 1. for expression (repeats only the values among the elements of a collection, such as an array) Code: {for element_variable:element_type key key_variable[:key type] in (collection) name do Note that element_variable:Element_type or key key_variable: key_type can be omitted. Exception Processing Code: {try The catch and finally clauses can be omitted. Also, each try can be declared more than once. |
|||||
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
Page 8: Extra Practice | ashimo | 0 | 3,482 |
06-20-2011, 01:34 PM Last Post: ashimo |
|
Page 6: Structure of a Program that Reads our Score Data | ashimo | 0 | 2,970 |
06-20-2011, 01:21 PM Last Post: ashimo |
|
Page 5: Application: Reading Our Score Data | ashimo | 0 | 2,775 |
06-20-2011, 01:20 PM Last Post: ashimo |
|
Page 4: Structure of a Program that Writes Data to a File | ashimo | 0 | 3,148 |
06-20-2011, 01:18 PM Last Post: ashimo |
|
Page 3: Basics 2: Writing a Control Value into a File | ashimo | 0 | 3,022 |
06-20-2011, 01:16 PM Last Post: ashimo |
|
Page 2: Structure of a Program that Reads Data from a File | ashimo | 0 | 3,039 |
06-20-2011, 01:13 PM Last Post: ashimo |
|
Page 1: Reading Our Score Data | ashimo | 0 | 3,171 |
06-20-2011, 01:12 PM Last Post: ashimo |
Users browsing this thread:
1 Guest(s)
1 Guest(s)