PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/pike/constants/runme.pike

#
Unknown | 24 lines | 21 code | 3 blank | 0 comment | 0 complexity | 7ba6b8f4a92c503269421e4f8feb2beb MD5 | raw file
 1int main()
 2{
 3  write("ICONST  = %d (should be 42)\n", .example.ICONST);
 4  write("FCONST  = %f (should be 2.1828)\n", .example.FCONST);
 5  write("CCONST  = %c (should be 'x')\n", .example.CCONST);
 6  write("CCONST2 = %c (this should be on a new line)\n", .example.CCONST2);
 7  write("SCONST  = %s (should be 'Hello World')\n", .example.SCONST);
 8  write("SCONST2 = %s (should be '\"Hello World\"')\n", .example.SCONST2);
 9  write("EXPR    = %f (should be 48.5484)\n", .example.EXPR);
10  write("iconst  = %d (should be 37)\n", .example.iconst);
11  write("fconst  = %f (should be 3.14)\n", .example.fconst);
12
13  if (search(indices(.example), "EXTERN") == -1)
14    write("EXTERN isn't defined (good)\n");
15  else
16    write("EXTERN is defined (bad)\n");
17
18  if (search(indices(.example), "FOO") == -1)
19    write("FOO isn't defined (good)\n");
20  else
21    write("FOO is defined (bad)\n");
22
23  return 0;
24}