lisp2arx
Visual Programming for AutoLisp Mathématiques en programmation Lisp.. doc2cpp,doc2lsp, sld2lsp, bmp2dcl, free__GifCcapture for all-CAD'platforms..
Lista Forumurilor Pe Tematici
lisp2arx | Reguli | Inregistrare | Login

POZE LISP2ARX

Nu sunteti logat.
Nou pe simpatie:
Jasmmyne
Femeie
22 ani
Bucuresti
cauta Barbat
22 - 34 ani
lisp2arx / Delphi , InnoPascal / Delphi32- Swap Two strings  
Autor
Mesaj Pagini: 1
admin
Administrator

Din: Bucharest
Inregistrat: acum 13 ani
Postari: 508


Code:

Function str_lenadd(Var s:string;limcheck:integer;AdAChar:char):integer;
Var filer:pchar;
    extmax,nth:integer;
    strcd:string;
Begin    result:=0;
         filer=nil;
         extmax:=0;
         if (limcheck<1) then exit;
         if (length(s)<=limcheck) then extmax:=limcheck-length(s);
         if (extmax<1) then exit;
         setlength(strcd,extmax);
         filer:=@Strcd[1]);
         fillchar(filer^,extmax,AdAChar);
         s:=concat(s,strcd);
         Result:=Length(strcd);
         strcd:='';
End;

{--}

Code:

Function xchg_str(var a,b:string):integer;
Var nLen:array['a'..'b'] of integer;
    nth:integer;
    charset:char;
Begin 
      nLen['a']:=length(a);
      nLen['b']:=length(b);
      if (nLen['a']>nLen['b']) then result:=nLen['a']
                   else result:=nLen['b'];
      if (result<1) then exit;
      if (nLen['a']<maxi) then str_lenadd(a,result,0); 
      if (nLen['b']<maxi) then str_lenadd(b,result,0);
      for nth:=1 to result do
         Begin charset:=a[nth];
               a[nth]:=b[nth];
               b[nth]:=charset;
         End;
     setlength(a,nLen['b']);
     setlength(b,nLen['a']);
     // del;e
End;//offxchg_str



delphi32- swap two strings then exit;
 then then exit;
 integer;
 then else then exit;
 then then

68.8KB


_______________________________________


pus acum 2 ani
   
Pagini: 1  

Mergi la