~ubuntu-branches/ubuntu/wily/gargoyle-free/wily-proposed

« back to all changes in this revision

Viewing changes to tads/tads3/test/data/coretest.t

  • Committer: Bazaar Package Importer
  • Author(s): Sylvain Beucler
  • Date: 2009-09-11 20:09:43 UTC
  • Revision ID: james.westby@ubuntu.com-20090911200943-idgzoyupq6650zpn
Tags: upstream-2009-08-25
ImportĀ upstreamĀ versionĀ 2009-08-25

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Test of t3core.  Compile with '-nodef', since we don't want to pick up
 
3
 *   the normal library startup code.  
 
4
 */
 
5
 
 
6
#include <t3.h>
 
7
#include <tadsgen.h>
 
8
#include <systype.h>
 
9
#include <core.h>
 
10
 
 
11
/* 
 
12
 *   this is the low-level main entrypoint - the VM calls this directly at
 
13
 *   program start-up 
 
14
 */
 
15
_main(args)
 
16
{
 
17
    /* set our default display function */
 
18
    t3SetSay(say);
 
19
 
 
20
    /* invoke our normal 'main' */
 
21
    main(args);
 
22
}
 
23
 
 
24
main(args)
 
25
{
 
26
    "Hello, world!\n";
 
27
 
 
28
    "\nThis is a little test of the t3core program.  We'll just\n
 
29
    read text from the keyboard and echo it to the display.\n
 
30
    When you're done, enter a blank line to quit...\n\n";
 
31
    for (;;)
 
32
    {
 
33
        local str;
 
34
        
 
35
        "Enter some text> ";
 
36
        str = readText();
 
37
        if (str == '')
 
38
            break;
 
39
 
 
40
        "You entered \"<<str>>\"!\n\n";
 
41
    }
 
42
 
 
43
    "Thanks for joining us!\n";
 
44
}
 
45
 
 
46
say(txt)
 
47
{
 
48
    /* ignore nil values */
 
49
    if (txt == nil)
 
50
        return;
 
51
    
 
52
    /* write text to the t3core sample output routine (from core.h) */
 
53
    displayText(txt);
 
54
}