home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / PARADIS1 / UPCASE.PAS < prev    next >
Pascal/Delphi Source File  |  1992-03-08  |  1KB  |  49 lines

  1. (9493)  Thu 5 Mar 92  2:24
  2. By: Robert Jenkins
  3. To: All
  4. Re: Strings to UpCase
  5. St:
  6. ---------------------------------------------------------------------------
  7. @EID:1185 0052ade1
  8. @MSGID: 1:389/5@FidoNet 208253aa
  9. I realize that there was a discussion about converting strings to upper case a
  10. few weeks back, but I recently found out DOS has a function for this.  Here is
  11. a function that will convert strings to upper case via DOS
  12.  
  13. Uses Dos;
  14. Function Str2UpCase(S : String) : String;
  15. Var Regs : Registers;
  16. Begin
  17.      With Regs Do
  18.      Begin
  19.           FillChar(Regs,SizeOf(Regs),0);
  20.           AX := $6521;  {if this is a $6522 it will do NUL term strings}
  21.           CX := Length(s) + 1; {and then the length wont be needed}
  22.           DS := Seg(s);
  23.           DX := Ofs(s);
  24.           Intr($21,Regs);
  25.      End;
  26.      Str2UpCase := S;
  27. End;
  28.  
  29. Var s : String;
  30. Begin
  31.      s := 'test';
  32.      Writeln(s);
  33.      Writeln(Str2UpCase(s));
  34. End.
  35.  
  36.  
  37.  
  38. I tried to write an inline asm version, but I got runtime error 230.  I don't
  39. have that error listed in my books that I could find.
  40.  
  41.  
  42. Robert
  43.  
  44.  
  45. --- TosScan(q) 1.00
  46.  * Origin: ROBBS......................................? (1:389/5)
  47.  
  48. @PATH: 389/5 2 170/400 512/0 1007 
  49.