home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / SCRPTEXM.PAK / INTNATL.SPP < prev    next >
Encoding:
Text File  |  1997-05-06  |  961 b   |  33 lines

  1. //--------------------------------------------------------------------------
  2. // Object Scripting
  3. // Copyright (c) 1996, 1997 by Borland International, All Rights Reserved
  4. //
  5. // INTNATL.SPP: International. Demonstrates the use of FormatString() for
  6. //   localization of strings in scripts.
  7. //--------------------------------------------------------------------------
  8. print typeid(module());
  9.  
  10. //
  11. // IDE imports.
  12. //
  13. import IDE;
  14.  
  15. //
  16. // Display message to user. When strings are translated, the position and
  17. // order of some words may change. If there are variables in a string,
  18. // this can be a problem. FormatString() makes it easier to translate such
  19. // strings.
  20. //
  21. NumScandals = CalcNumScandals();
  22. Player = "Bob";
  23. Text = FormatString("Player %1 has lived through %2 scandals.", Player,
  24.                     NumScandals);
  25. IDE.Message(Text, INFORMATION);
  26.  
  27. //
  28. // Calculate the number of scandals.
  29. //
  30. CalcNumScandals()
  31. {
  32.   return 12;
  33. }