home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / flink11.zip / SmallDemo.fpl < prev    next >
Text File  |  1995-07-25  |  761b  |  44 lines

  1. void Pause(void)
  2. {
  3.    getchar("Press any key to continue.");
  4.    printf("\n");
  5. }
  6.  
  7. void SayDate(void)
  8. {
  9.    int time=nowtime();
  10.  
  11.    printf("\nThe current time is %s.\n",time2str(time));
  12. }
  13.  
  14. void SayFile(string Filename)
  15. {
  16.    string buf;
  17.  
  18.    buf=loadstring(Filename);
  19.    if(strlen(buf)>100)
  20.        buf=substr(buf,0,100);
  21.    printf("\nThe first 100 bytes of this FPL script looks like this:\n");
  22.    printf("'%s'\n",buf);
  23. }
  24.  
  25. string GetPhone(string User)
  26. {
  27.    string phone;
  28.  
  29.    loaduser(User);
  30.    phone = getuservar("phone");
  31.    return phone;
  32. }
  33.  
  34. /* Execution start point */
  35. SayDate();
  36. Pause();
  37. SayFile("SmallDemo.fpl");
  38. Pause();
  39. printf("\nMy phone is: %s\n",GetPhone("Björn Stenberg"));
  40. Pause();
  41. printf("\nTadaa. Done!\n");
  42.  
  43.  
  44.