tagged release 0.6.4
[parrot.git] / languages / WMLScript / runtime / wmlsconsole.pir
blobebf27e639a7cc30327253c7f17521c24a94070ca
1 # Copyright (C) 2006-2008, The Perl Foundation.
2 # $Id$
4 =head1 NAME
6 runtime/wmlsconsole.pir - WMLScript Console library
8 =head1 DESCRIPTION
10 See "WMLScript Reference UP.SDK R4.B3 - October 1999".
12 =head1 FUNCTIONS
14 =cut
16 .loadlib 'wmls_ops'
17 .HLL 'WMLScript', 'wmls_group'
20 .sub 'getConsole'
21     new $P0, 'Hash'
23     .const .Sub _console_print = '_console_print'
24     $P0[0]  = _console_print
25     .const .Sub _console_println = '_console_println'
26     $P0[1]  = _console_println
28     .return ($P0)
29 .end
32 =head2 C<print(string)>
34 =head3 DESCRIPTION
37 =head3 PARAMETERS
39 string = String
41 =head3 RETURN VALUE
43 Number or invalid.
45 =cut
47 .sub '_console_print' :anon
48     .param pmc str
49     .local pmc res
50     $I0 = isa str, 'WmlsInvalid'
51     if $I0 goto L1
52     $S0 = str
53     print $S0
54     $I0 = length $S0
55     new res, 'WmlsInteger'
56     set res, $I0
57     goto L2
58   L1:
59     new res, 'WmlsInvalid'
60   L2:
61     .return (res)
62 .end
65 =head2 C<println(string)>
67 =head3 DESCRIPTION
70 =head3 PARAMETERS
72 string = String
74 =head3 RETURN VALUE
76 Number or invalid.
78 =cut
80 .sub '_console_println' :anon
81     .param pmc str
82     .local pmc res
83     $I0 = isa str, 'WmlsInvalid'
84     if $I0 goto L1
85     $S0 = str
86     print $S0
87     print "\n"
88     $I0 = length $S0
89     new res, 'WmlsInteger'
90     set res, $I0
91     goto L2
92   L1:
93     new res, 'WmlsInvalid'
94   L2:
95     .return (res)
96 .end
99 =head1 AUTHORS
101 Francois Perrad.
103 =cut
106 # Local Variables:
107 #   mode: pir
108 #   fill-column: 100
109 # End:
110 # vim: expandtab shiftwidth=4 ft=pir: