home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / PASCAL / MISCTI10.ZIP / TI311.ASC < prev    next >
Encoding:
Text File  |  1988-04-18  |  1.0 KB  |  55 lines

  1. PRODUCT : TURBO PROLOG     NUMBER : 311
  2. VERSION : 3.2
  3.      OS : PC-DOS
  4.    DATE : October 9, 1986
  5.  
  6.   TITLE : MICROSOFT PASCAL INTERFACE
  7.  
  8. The  following describes how to call a Microsoft  Pascal  routine 
  9. from Turbo Prolog.
  10.  
  11. Interfacing Microsoft Pascal, version 3.2 with Turbo Prolog:
  12.  
  13. STEP 1:
  14.  
  15.    object (.OBJ) file.
  16.  
  17.  
  18.    global predicates
  19.      double(integer, integer) - (i,o) language pascal
  20.  
  21.    goal
  22.      double(1, X), write(X), nl.
  23.  
  24.  
  25. STEP 2:
  26.  
  27.    module mypas;
  28.  
  29.    procedure double_0(x : integer; vars y : integer);
  30.     begin
  31.       y := x + x;
  32.     end;
  33.    end.
  34.  
  35.    Note that all unbound variables must be passed as 'vars'
  36. parameters.
  37.    This tells Microsoft Pascal to use 4-byte pointers instead of
  38. 2-byte
  39.    pointers.
  40.  
  41.    Compile the Pascal program as follows:
  42.  
  43.    A> pas1 double
  44.    A> pas2
  45.  
  46. STEP 3:
  47.  
  48.    Link the Prolog and Pascal object modules as follows:
  49.  
  50.    A> link init+mypro+double+mypro.sym/DO,mixpro,,prolog
  51.  
  52.    The  /DO  option orders the segments and is required  to  link    
  53. successfully
  54.  
  55.