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 >
Wrap
Pascal/Delphi Source File
|
1992-03-08
|
1KB
|
49 lines
(9493) Thu 5 Mar 92 2:24
By: Robert Jenkins
To: All
Re: Strings to UpCase
St:
---------------------------------------------------------------------------
@EID:1185 0052ade1
@MSGID: 1:389/5@FidoNet 208253aa
I realize that there was a discussion about converting strings to upper case a
few weeks back, but I recently found out DOS has a function for this. Here is
a function that will convert strings to upper case via DOS
Uses Dos;
Function Str2UpCase(S : String) : String;
Var Regs : Registers;
Begin
With Regs Do
Begin
FillChar(Regs,SizeOf(Regs),0);
AX := $6521; {if this is a $6522 it will do NUL term strings}
CX := Length(s) + 1; {and then the length wont be needed}
DS := Seg(s);
DX := Ofs(s);
Intr($21,Regs);
End;
Str2UpCase := S;
End;
Var s : String;
Begin
s := 'test';
Writeln(s);
Writeln(Str2UpCase(s));
End.
I tried to write an inline asm version, but I got runtime error 230. I don't
have that error listed in my books that I could find.
Robert
--- TosScan(q) 1.00
* Origin: ROBBS......................................? (1:389/5)
@PATH: 389/5 2 170/400 512/0 1007