| |
|
|
DeHarrow | Hello on any! To my trouble: have different Files, The I with BlockRead/write copy would like - still not: @BlockRead(File$, Ber#, 0, FileSize(File$)), separate for may part with 1024 byte(point).
sense should his: have a wallpaper.pcu of, The whom status the Kopierens Show should. would be stupid, if then Ruckzuck 100% showing instead of for may part 10%, 15% copies etc.
If I The Filegröße through 1024 pieces, then I get Nachkommastellen, The unregarded go - The File unvollständig copies. round up on whole number without Kommastelle brought too nothing.
white someone How I it best employ/converting could. with small Files works it Yes with the worth 1024, but with large Files ex MB even not. hope you know I my.
Greeting Jürgen |
|
|
| Angefangen hat alles mit Profan 5.0 ...noch auf Diskette | 09/02/09 ▲ |
|
|
|
|
| shark, first of all could BlockWrite so many byte write, as function BlockRead as gelesene Bytes returns. The Puffergrösse depends of Zielmedium ex of/on the The File loaded/written becomes - 1024byte appear me with normalen Festplatten and present OSsses as explicit To lowly. i'd vlt. with of/ one Puffergrösse of 256KB herantesten - power Yes none sense The CPU More To bait as necessary because disk+cache+OS the "eh" over again managen. |
|
|
| |
|
|
|
DeHarrow | Hello IF - thanks first for your response. The problem: I must a worth without comma rausbekommen.
have z.B. a File of 1079214 Bytes or 1.02 MB. If I this worth complete into memory read and write, then is the Fortschrittsbalken even same with 100%. OK Statusbalken adjust would no Topic or so... ...would like hold only smaller ones steps in the Statusbalken Show let (for may part 10%, 20%, 30% copies etc.) Dividiere I then through something z.B. FileSize(File$) / 1024 (or even larger) circa another Bytezahl To get, then have I Nachkommastellen and it works then even not Block Write.
I should sozusagen for different Dateigrößen in the area Bytes, KB, MB etc. a verlässlichen worth having.
Greeting Jürgen |
|
|
| Angefangen hat alles mit Profan 5.0 ...noch auf Diskette | 09/02/09 ▲ |
|
|
|
|
Nico Madysa | take we at times, You habest a File of 2049 kilobytes, only as example. You could still ganzzahlig through 1024 share and this copy. The Prozentanzeige get You then to 100 * GeleseneBytes% / FileSize(File$). After the Loop, The the power, ermittelst You with Modulo simply The verbleibenden Bytes and copy these too. The Prozente must thereafter not any more just go, it yield itself Yes 100%. CompileMarkSeparation |
|
|
| |
|
|
|
| Perhaps. means it something like: [...]
(once more korrigiert) CompileMarkSeparationCLS
MYFCOPY("csa.debug","map33.bmp")
WAITINPUT
proc MYFCOPY
PARAMETERS _FROM$,_TO$
IFNOT FILEEXISTS(_FROM$)
RETURN 0
ENDIF
IF FILEEXISTS(_TO$)
ERASE _TO$
IF FILEEXISTS(_TO$)
RETURN 0
ENDIF
ENDIF
var SZ!=FILESIZE(_FROM$)
IF SZ!<20
COPY _FROM$,_TO$
RETURN 1
ENDIF
var FHFROM%=ASSIGN(_FROM$)
var FHTO%=ASSIGN(_TO$)
IFNOT FHFROM% AND FHTO%
case FHFROM% : ASSIGN FHFROM%,""
case FHTO% : ASSIGN FHTO%,""
RETURN 0
ENDIF
OPENRW FHFROM%
OPENRW FHTO%
var LSZ&=INT(RANGE(SZ!*0.05,20,2048))
var RD&=0
var ACC&=0
DECLARE MYBUFF#
DIM MYBUFF#,LSZ&
WHILENOT EOF(FHFROM%)
RD&=BLOCKREAD(FHFROM%,MYBUFF#,0,LSZ&)
IFNOT RD&
BREAK
ENDIF
INC ACC&,RD&
BLOCKWRITE FHTO%,MYBUFF#,0,RD&
RECTANGLE 0,0 - (ACC&/SZ!*100),10
ENDWHILE
DISPOSE MYBUFF#
ASSIGN FHFROM%,""
ASSIGN FHTO%,""
RETURN FILEEXISTS(_TO$)
ss=s4 href='./../../Function-References/XProfan/endproc/'>endproc
(deference code only hingeschmiert, absolutely on Error checken) |
|
|
| |
|
|
|
DeHarrow | Hello!
thanks for Answer! sees on the first look pointed from - will be it time try - best Thanks!
Greeting Jürgen |
|
|
| Angefangen hat alles mit Profan 5.0 ...noch auf Diskette | 09/02/09 ▲ |
|
|
|
|
| |
|
| |
|
|
|
Andreas Miethe
| to the Topic heard Perhaps too the system-dialog, the a progress at copy or irgendwelchen Berechnungen indicating. Hierbei becomes one Fortschrittsbalken and a Restdauer( The Windwos automatically accounts) displayed. CompileMarkSeparation $H Windows.ph
Var ole& = ImportDll("ole32.dll","")
Var oleaut& = ImportDll("oleaut32.dll","")
Declare bString1$
Proc Ansi2Uni
Parameters s$
Var Unicode$ = Space$((Len(S$)*2)+1)
~MultiByteToWideChar(0,0,Addr(S$),-1,Addr(Unicode$),Len(Unicode$))
SysFreeString(bString1$)
SysFreeString(bString1$)
bString1$ = SysAllocString(addr(Unicode$))
Return bString1$
EndProc
DEF &CLSCTX_INPROC_SERVER 1
DEF &PROGDLG_NORMAL 0
DEF &PROGDLG_AUTOTIME 2
DEF &PROGDLG_MODAL 1
DEF &PDTIMER_RESET 1
DEF &IDA_COPY_ANIMATION 160
Interface IProgressDialog
DEF &QueryInterface 0
DEF &AddRef 4
DEF &Release 8
DEF &StartProgressDialog 12
DEF &StopProgressDialog 16
DEF &SetTitle 20
DEF &SetAnimation 24
DEF &HasUserCancelled 28
DEF &SetProgress 32
DEF &SetProgress64 36
DEF &SetLine 40
DEF &SetCancelMsg 44
DEF &Timer 48
Var ProgressLimit& = 5000
Declare CLSID_ProgressDialog#,IID_IProgressDialog#
Dim CLSID_ProgressDialog#,16
Dim IID_IProgressDialog#,16
LONG CLSID_ProgressDialog#,0 = $f8383852
WORD CLSID_ProgressDialog#,4 = $fcd3, $11d1
BYTE CLSID_ProgressDialog#,8 = $a6, $b9, 0, $60, $97, $df, $5b, $d4
LONG IID_IProgressDialog#,0 = $ebbc7c04
WORD IID_IProgressDialog#,4 = $315e, $11d2
BYTE IID_IProgressDialog#,8 = $b6, $2f, 0, $60, $97, $df, $5b, $d4
Var X& = 0
Var dwCompleted& = 0
Var ppv& = 0
cls
CoInitialize(0)
Var hr& = CoCreateInstance(CLSID_ProgressDialog#, 0, &CLSCTX_INPROC_SERVER, IID_IProgressDialog#,Addr(ppv&))
If hr& = ~S_OK
Var Command& = LONG(ppv&,0)
Call(Long(Command&,&SetTitle),ppv&,Ansi2Uni("System Fotschritt-Dialogbox"))
Var hShell& = UseDll("shell32.dll")
If hShell&
Call(Long(Command&,&SetAnimation),ppv&,hShell&,&IDA_COPY_ANIMATION)
EndIf
Call(Long(Command&,&Timer),ppv&,&PDTIMER_RESET,0)
Call(Long(Command&,&SetCancelMsg),ppv&,Ansi2Uni("Cancel"), 0)
Call(Long(Command&,&SetLine),ppv&,1, Ansi2Uni("System Fortschritt-Dialog Test mit XProfan"), 1,0)
Call(Long(Command&,&StartProgressDialog),ppv&,%hwnd, 0, &PROGDLG_NORMAL | &PROGDLG_AUTOTIME | &PROGDLG_MODAL, 0)
Repeat
If Call(Long(Command&,&HasUserCancelled),ppv&)
Call(Long(Command&,&StopProgressDialog),ppv&)
MessageBox("Fortschritt abgebrochen","Meldung",0)
Break
Else
Call(Long(Command&,&SetProgress),ppv&, dwCompleted&, ProgressLimit&)
If dwCompleted& >= ProgressLimit&
Call(Long(Command&,&StopProgressDialog),ppv&)
MessageBox("Fortschritt komplett","Meldung",0)
Break
Else
Call(Long(Command&,&SetLine),ppv&,2, Ansi2Uni("Wir sind jetzt hier : "+Str$(dwCompleted&)+" von "+str$(ProgressLimit&)), 1, 0)
an dieser Stelle könnte man eine Kopierfunktion
oder irgenwelche Berechnungen einbauen, statt nur einen Zähler laufen zu lassen.
Inc dwCompleted&
EndIf
EndIf
Sleep 10 je kleiner die Pause, umso schneller der Fortschritt
Until X& =1
Call(Long(Command&,&Release),ppv&)
Dispose CLSID_ProgressDialog#,IID_IProgressDialog#
SysFreeString(bString1$)
EndIf
CoUninitialize()
FreeDll Ole&
Freedll oleaut&
waitinput
end
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 09/05/09 ▲ |
|
|
|
|
| |
|
| |
|
|