Simpatie.ro - matrimoniale
lisp2arx
Visual Programming for AutoLisp Mathématiques en programmation Lisp.. doc2cpp,doc2lsp, sld2lsp, bmp2dcl, free__GifCcapture for all-CAD'platforms..
Nou pe simpatie:
angela31
Femeie
23 ani
Buzau
cauta Barbat
24 - 60 ani
lisp2arxReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
lisp2arx / Delphi , InnoPascal /

Delphi32- StrPas and Search Char/s inside

Pagini: 1  
#1
admin
Administrator
Din: Bucharest
Postari: 523
Since  strPas is too slow,

Code:

Function str_pas1(const sourcesir:pchar):string;
Begin  result:='';
       if (sourcesir=nil) or (sourcesir^=#00) then exit;
       result:=sourcesir;
End;
Function str_pas2(arrayeditstate:pchar;limcheck:integer):string;
Begin
    result:='';
    if (arrayeditstate=nil) or (arrayeditstate^=#0) then exit;
    if (limcheck<1) then limcheck:=strlen(arrayeditstate);
    SetString(result,arrayeditstate,limcheck);
End;

You can add more effects inside StrPas (uppercase, search two chars inside)

Code:

Function strpas255for(var dest:shortstring;srchui:pchar;SNTSearch:word):integer;
Var dxf,nth:integer;
    cll,chh:word;
    zerop:boolean;
label bCanExit;
Begin
     result:=RTCAN;
     zerop:=false;
     nth:=1;
     if (srchui=NIL) then goto bCanExit;
     result:=RTREJ;
     setlength(dest,255);
     if (SNTSearch=0)then
       Begin for nth:=1 to 255 do
               Begin  dxf:=ord(srchui^);
                      if (dxf=0) then  goto bCanExit;
                      dest[nth]:=upcase(char(dxf));
                      if (result<0) and (dxf>1) then result:=RTNORM;
                      inc(srchui);
                   End;
               goto bCanExit;    
        End;
       result:=0;
       cll:=SNTSearch and 255;
       chh:=(SNTSearch shr 8) and 255;
       if (cll>0)and(chh>0) then
       Begin for nth:=1 to 255 do
               Begin  dxf:=ord(srchui^);
                      if (dxf=0) then goto bCanExit else
                      if (cll=dxf) then result:=result and cll  else
                      if (chh=dxf) then result:=(dxf shl 8)+(result and 255);
                      dest[nth]:=upcase(char(dxf));
                      inc(srchui);
                   End;
              goto bCanExit;    
        End;

       if (chh>0) then
       Begin for nth:=1 to 255 do
               Begin  dxf:=ord(srchui^);
                      if (dxf=0) then goto bCanExit else
                      if (chh=dxf)and(result<0) then result:=nth;
                      dest[nth]:=upcase(char(dxf));
                      inc(srchui);
                   End;
              goto bCanExit;
        End;

       if (cll>0) then
       Begin for nth:=1 to 255 do
               Begin  dxf:=ord(srchui^);
                      if (dxf=0) then goto bCanExit else
                      if (cll=dxf)and(result<0) then result:=nth;
                      dest[nth]:=upcase(char(dxf));
                      inc(srchui);
                   End;
             goto bCanExit;
       End;
bCanExit:
    setlength(dest,nth-1);
End;//off-strpasfor("")



Delphi32- StrPas and Search Char/s inside - Since strPas is too slow, You can add more - Delphi , InnoPascal
Delphi32- StrPas and Search Char/s inside – poza de admin, in Delphi , InnoPascal · 70KB


_______________________________________
http://www.puiubrat.3x.ro/lisp2arx/lisp ... O2UTM2.pdf

 
   
Pagini: 1  
Mergi la