home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP_ADV.ZIP / LIST0402.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-07-31  |  1.5 KB  |  36 lines

  1. Program CLinkDemo1;
  2. { This sample program is a simple example of how to create a   }
  3. { routine in Turbo C that can be linked into a Turbo Pascal    }
  4. { program.                                                     }
  5. {$A-,F-}
  6.  
  7. Uses Crt;
  8.  
  9. Var
  10.   OldString,               { Original String before conversion }
  11.   NewString : String;      { Copy of string.  This will be the }
  12.                            { string passed to the C routine.   }
  13.  
  14. {$L List4-1}               { Link in the C OBJ file.           }
  15.  
  16. {$F+}                      { Enforce the Far Call requirement  }
  17. Procedure UpString( Var S : String ); External;
  18. { Heading of the external procedure contained in the Turbo C   }
  19. { .OBJ file.                                                   }
  20. {$F-}
  21.  
  22. Begin                      { Main program                      }
  23.   ClrScr;                  { Clear the output string           }
  24.   GotoXY( 1,5 );           { Reposition the Cursor             }
  25.   Write( 'Enter a lowercase string: ' );
  26.   Readln( OldString );     { Prompt user and get the input     }
  27.   NewString := OldString;  { Save copy of string for output    }
  28.   UpString( NewString );   { Convert string to UpperCase       }
  29.   Writeln( 'Lowercase = ', OldString );
  30.   Writeln( 'Uppercase = ', NewString );
  31.                            { Show the results to the user      }
  32.   Write( 'Press any key to quit' );
  33.   While( Not Keypressed ) Do
  34.     { NOP };               { Pause for a keypress              }
  35. End.
  36.