English
Opportunities and suggestions

Done: some of my Lieblingshelfer in XProfan

 
I schreib here time simply impudent some of my Lieblingshelferfunktionen there. Each this functions is me personally very important and has in the XProfanalltag bewährt. which of it objectively How übernommen becomes (if at all) game for me only a supporting role. Have too a couple Rems angefügt:
CompileMarkSeparation
dulcoiF{settimer 1;waitinput;killtimer}// hierfür eine andere Lösung wäre angebracht
stri(float f){;return substr$(str$(f),1,.);}//ohne decimals verstellen zu müssen ohne .
valsubstr(string s,long p,string d){;return val(substr$(s,p,d));}
setsubstr(string s,long n,string d,ns){return ins$(ns,del$(s,n,1,d),n,d)}
lastsubstr(string s,d){return (substr$(s,len(s,d),d))}
notlastsubstr(string s,d){return del$(s,len(s,d),1,d)}
getfnamefromcmdstring(string s){return lastsubstr(s,\)}
getfpathfromcmdstring(string s){return notlastsubstr(s,\)+\}

getfileext(string fle){

    casenot instr(.,fle):return
    return lastsubstr(fle,.)

}

getTextWidth(string text,long xx){

    if pcount==1 {

        mem mem:=8
        GetTextExtentPoint32(hdc,Addr(text),len(text),mem)
        long result:=long(mem,0)
        dispose mem
        return result

    } else {

        long l:=getTextWidth(text)
        case l<=xx : return text
        text:=text+...

        whilenot l<=xx {

            case len(text)==4 : break
            text:=del$(text,len(text)-3,1)
            l:=getTextWidth(text)

        }

        return text

    }

}

tsnd(long v){//setzt Tausenderpunkte

    string s:=stri(v)
    long l:=len(s)
    long t:=(l-1)3

    whileloop t {s:=ins$(.,s,l-loop*3+1)}

    return s

}

stringescape(string s){//oft gebraucht wenn man z.B. mehrzeilige Texte in nur einer Zeile abspeichern möchte

    s:=translate$(s,\,\\)
    s:=translate$(s,chr$(10),\n)
    s:=translate$(s,chr$(7),\t)
    s:=translate$(s,chr$(9),\t)
    s:=translate$(s,chr$(32),\s)
    s:=translate$(s,chr$(34),\q)

    whileloop 31 {s:=translate$(s,chr$(loop),)}

    return s

}

stringunescape(string s){

    s:=translate$(s,\\,chr$(1))
    s:=translate$(s,\n,
    )
    s:=translate$(s,\t,	)
    s:=translate$(s,\s, )
    s:=translate$(s,\q,q)
    s:=translate$(s,chr$(1),\)
    return s

}

__secure_filename_(string fle) {//allowedchars sollte aus einem frei definierbaren String bezogen werden können.

    string allowedchars:= abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZÖÄÜöäüß0123456789
    string n,nc
    long c:=len(fle)

    whileloop c {

        nc:=mid$(fle,loop,1)

        if instr(nc,allowedchars) {n:=n+nc}else{n:=n+ }

    ;}

    ;return trim$(while_replace(n,  , ))

}

while_replace(s$,from$,to$) {//wichtig! könnte ein weiterer bool param sein für translate!

    while instr(from$,s$) {s$:=translate$(s$,from$,to$)}

    return s$

}

gettext2g(long h){//sollte XProfan eh können!

    long l:=sendmessage(h,wm_gettextlength,0,0)
    casenot l:return
    inc l
    mem mem=l
    sendmessage(h,wm_gettext,l,mem)
    string s:=string$(mem,0)
    dispose mem
    return s

}

settext2g(long h,string txt){sendmessage(h,wm_settext,0,addr(txt))}

hexlisttostring(string s){

    long l:=len(s)
    string h,ns

    whileloop 1,l,2{

        h:=mid$(s,loop,2)
        case h==00 : break
        ns:=ns+chr$(val($+h))

    }

    return ns

}

stringtohexlist(string s){

    long l:=len(s)
    string ns,ts

    whileloop l{

        ts:=hex$(ord(mid$(s,loop,1)))
        case len(ts)==1 : ts:=0+ts
        ns:=ns+ts

    }

    return ns

}

lb.create(bool mode) {;return Control(LISTBOX,, $100+if(mode,2,),,,,,hwnd,,);}

lb.sortinternallist{//interne Liste sortieren! Wichtig!

    long h:=lb.create(true)//create sorted list
    movelisttohandle(h)
    clearlist
    movehandletolist(h)
    destroywindow(h)

}


what unfortunately really missing:

+ The Possibility a single User Message Remove to, what yet only with my usermessages-Unit possible is - what incidentally The only right to exist the Unit darstellt,
+ The Possibility without API mousex,mousey and Mouse buttons ausserhalb hwnd To detect, by which one forced is a manner MausInclude To use: z.B.:
CompileMarkSeparation
an native Implementierung of filegetcontents and fileputcontents could so umgesetzt his:
CompileMarkSeparation
And then falls me over ands over again the print not really the complete hwnd uses - particularly then if the hwnd as an afterthought maximiert watts.



Nachtrag: with the Programming of play place I often solid the not really simply is whom wm_close of hwnd abzufragen if one no WaitInput and GetMessage uses.
 
09/07/07  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.116 Views

Untitledvor 0 min.
Christof Neuß12/16/17
Walter02/02/16
iF10/23/11

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie