English
Source / code snippets

to determine Programmverzeichnis

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Programmverzeichnis to determine
Freundlicherweise of Dieter Zornow for ROC
to Disposal set. THANK YOU!
Def FindFirstFile(2) !KERNEL32,FindFirstFileA
Def FindClose(1) !KERNEL32,FindClose
Declare PFAD$

PROC FINDFILE

    Declare handle&,info#,file#,name$
    parameters file$
    Filemode 0
    Dim info#,255
    Dim File#,add(len(file$),1)
    String File#,0=file$
    let handle&=FindFirstFile(file#,info#)
    Let name$=@String $(Info#,44)
    FindClose(handle&)
    Dispose File#
    Dispose info#
    Filemode 2
    Return name$

ENDPROC

PROC ZERLEGEN

    Declare z%,name$,way$,l1%,l2%,return$
    parameters uebergabe$
    let way$=uebergabe$
    let l1%=@len(uebergabe$)
    Let z%=1

    Whilenot @equ(z%,0)

        let z%=@instr(,uebergabe$)
        let name$=Mid$(uebergabe$,@add(z%,1),@sub(len(uebergabe$),z%))
        let uebergabe$=name$

    wend

    let l2%=@len(name$)
    let uebergabe$=
    let way$=@left$(way$,@sub(l1%,l2%)) with last

    if @gt(@len(way$),3) if not in the Hauptverzeichnis

        inc l2%
        let way$=@left$(way$,@sub(l1%,l2%)) cut the latest  ex optional apiece to usage

    endif

    let return$=way$+|+name$ unübliches Separator use
    return return$

ENDPROC

PROC PFAD

    Declare Progpfad$,Progname$,temp$
    decompose @par$(0)

    If @equ$(@upper$(@Mid$(@$(0),@Add(@instr(|,@$(0)),1),@sub(@len(@$(0)),@instr(|,@$(0))))),PROFAN.EXE)

        let temp$=@par$(1) *.prf
        decompose temp$

    elseif @equ$(@upper$(@Mid$(@$(0),@Add(@instr(|,@$(0)),1),@sub(@len(@$(0)),@instr(|,@$(0))))),PRFRUN32.EXE)

        let temp$=@par$(1) *.prc
        decompose temp$

    else

        let temp$=@par$(0) *.exe
        decompose temp$

    endif

    let progpfad$=@Upper $(@left$(@$(0),@sub(@instr(|,@$(0)),1)))
    let Progname$=@upper$(@Mid$(@$(0),@Add(@instr(|,@$(0)),1),@sub(@len(@$(0)),@instr(|,@$(0)))))
    Findfile @upper$(temp$)

    If @equ$(@Trim $(@$(0)),)

        let Progpfad$=
        Let Progname$=
        declare tz$,mess$
        let tz$=Dateifehler
        let mess$=the Programmverzeichnis could not found go, Please
        started tappt im dunkeln the Program in the own directory new.
        @messagebox(mess$,tz$,16)

    endif

    Return progpfad$

ENDPROC

example
PFAD way detect
PFAD$=@$(0) here now the korrekte way to that Program
messagebox(way$,Programmverzeichnis:,4160)
 
07/16/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.552 Views

Untitledvor 0 min.
Thomas Zielinski03/11/20
rquindt03/21/18
iF01/13/13
Alexander Zur Hoerst01/11/12
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (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