Wiki

Changes between Version 2 and Version 3 of Program

Show
Ignore:
Timestamp:
01/15/11 12:35:08 (13 years ago)
Author:
hopscc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Program

    v2 v3  
    113113#!cobra 
    114114""" 
    115 Example DocString for this module 
     115Example DocString for a module. 
     116 
     117This program doesnt do anything useful or realistic beyond being an example of 
     118a cobra program and showing some of the language constructs. 
    116119""" 
     120 
     121#Assembly attributes 
    117122assembly has SharedAttribute 
    118123 
     
    152157    extend String 
    153158        def fmt(args as vari Object) as String 
    154             """ 
    155             Returns the string with any given args applied to it via String.Format 
    156             """ 
    157             test 
    158                 s = '{0}is{1}' 
    159                 assert s.fmt('0', '1') =='0is1' 
    160                 assert s.fmt(2, 1) == '2is1' 
    161                 assert s.fmt('One', 'NotTwo') == 'OneisNotTwo' 
    162                 assert s.fmt(nil, nil) == 'is' 
    163             body 
    164                 return String.format(this, args) to ! 
     159            """ 
     160            Returns the string with any given args applied to it via String.Format 
     161            """ 
     162            test 
     163                s = '{0}is{1}' 
     164                assert s.fmt('0', '1') =='0is1' 
     165                assert s.fmt(2, 1) == '2is1' 
     166                assert s.fmt('One', 'NotTwo') == 'OneisNotTwo' 
     167                assert s.fmt(nil, nil) == 'is' 
     168            body 
     169                return String.format(this, args) to ! 
    165170}}}             
    166171