root/NEWT0/trunk/contrib/inwt/inwt.nwt

Revision 81, 0.6 kB (checked in by pguyot, 22 months ago)

New switch for configure to configure contrib packages.
New contrib package: inwt (interactive NEWT/0).

Line 
1#!@NEWT@
2
3Require("NativeCalls");
4begin
5local libreadline := OpenNativeLibrary("libreadline");
6local readlineFn := libreadline:GetFunction({
7                        name: "readline",
8                        args: ['string],
9                        result: 'string});
10
11repeat
12begin
13    local theString := call readlineFn with ("inwt> ");
14    if (theString = nil) then
15    begin
16        Print("\n");
17        break;
18    end;
19    try
20    begin
21        theFunction := Compile(theString);
22        theResult := call theFunction with ();
23        P(theResult);
24    end
25    onexception |evt| do
26    begin
27        Print("Some error occurred:\n");
28        P(CurrentException());
29    end;
30end until nil;
31
32end
Note: See TracBrowser for help on using the browser.