Changeset 23de644 in mainline for uspace/dist/src/sysel/demos/varargs.sy
- Timestamp:
- 2010-04-04T22:31:01Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 074444f, ecb6ac32
- Parents:
- 3aae4e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/sysel/demos/varargs.sy
r3aae4e8 r23de644 33 33 -- with the attribute 'packed'. 34 34 -- 35 -- Note that we need to pass 'n' just because the array type 36 -- does not implement the Length property yet. 37 -- 38 fun Print(n : int; args : string[], packed) is 35 fun Print(args : string[], packed) is 39 36 var i : int; 37 var error : int; 40 38 39 error = 0; 41 40 i = 0; 42 while i < n do 43 Builtin.WriteLine(args[i]); 41 while error == 0 do 42 -- This is definitely the wrong way to determine 43 -- array bounds, but until a better one is 44 -- implemented... 45 do 46 Builtin.WriteLine(args[i]); 47 except e : Error.OutOfBounds do 48 error = 1; 49 end 50 44 51 i = i + 1; 45 52 end … … 47 54 48 55 fun Main() is 49 Print( 5,"One", "Two", "Three", "Four", "Five");56 Print("One", "Two", "Three", "Four", "Five"); 50 57 end 51 58 end
Note:
See TracChangeset
for help on using the changeset viewer.