Todd,

Here are two solutions for PocketStudio.  One if you like VB and one if you
like DELPHI <g>


--
Douglas Olson - President & Co-founder
Pocket Technologies, Inc.
- [EMAIL PROTECTED]
- http://www.pocket-technologies.com

Develop PalmOS applications with your Delphi skills Today!


//**********************************************
//
// Much like the Visual Basic command MID$ (but different)
//
procedure Mid(dst, src: PChar; Index, Count: Integer);
begin
  if Index > StrLen(Src) then  // Bad index check
  begin
    Dst[0] := #0;  // Return empty string
    Exit;
  end;

  if (Count + Index - 1) > StrLen(Src) then  // Bad count check
    Count := StrLen(Src) - Index + 1;

  StrNCopy(Dst, @Src[Index - 1], Count);

  Dst[Count] := #0;
end;

//
// Much like the DELPHI Copy command (but different)
//
procedure Copy(Src, Dst: PChar; Index, Count: Integer);

begin

  StrNCopy(Dst, @Src[Index - 1], Count);

  Dst[Count] := #0;

end;




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to