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

# · Unknown · 24 lines · 21 code · 3 blank · 0 comment · 0 complexity · 7ba6b8f4a92c503269421e4f8feb2beb MD5 · raw file

  1. int 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. if (search(indices(.example), "EXTERN") == -1)
  13. write("EXTERN isn't defined (good)\n");
  14. else
  15. write("EXTERN is defined (bad)\n");
  16. if (search(indices(.example), "FOO") == -1)
  17. write("FOO isn't defined (good)\n");
  18. else
  19. write("FOO is defined (bad)\n");
  20. return 0;
  21. }