| View previous topic :: View next topic |
| Author |
Message |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Sun Nov 13, 2005 2:36 pm Post subject: DiskNMem.dll and Piechart |
|
|
Im having some problems with DiskNMem.dll and Piechart
I know how volinfo works with pie chart but in this case im lost...
OPTION DECIMALSEP,"."
#DEFINE command,disknmem
#DEFINE function,disknmem
external @path(%0)DiskNMem.dll
TITLE Memory Pie
DIALOG CREATE,Memory Pie,-1,0,323,295
DIALOG ADD,PIECHART,PIECHART1,195,235,50,50,0,Memory status
Gosub memfree
dialog set,piechart1,%M
DIALOG SHOW
:loop
wait event
goto @event()
:memfree
%A = @Name(@DiskNMem(PhysMem,Free))
%B = @Name(@DiskNMem(PhysMem))
parse "%A;%B",@Name(@DiskNMem(PhysMem,Free))
%M = @format(@fmul(@fdiv(%A,%B),100000000),2.0)
exit
:close |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Nov 14, 2005 7:54 am Post subject: |
|
|
Your problem is in the memfree sub. Your parse statement resets your %A and %B variables.
Try this:
| Code: |
OPTION DECIMALSEP,"."
#DEFINE command,disknmem
#DEFINE function,disknmem
external @path(%0)DiskNMem.dll
TITLE Memory Pie
DIALOG CREATE,Memory Pie,-1,0,323,295
DIALOG ADD,PIECHART,PIECHART1,195,235,50,50,0,Memory status
Gosub memfree
dialog set,piechart1,%%percent
DIALOG SHOW
:loop
wait event
goto @event()
:memfree
%%free = @Name(@DiskNMem(PhysMem,Free,))
%%total = @Name(@DiskNMem(PhysMem,,))
%%percent = @div(%%free,@div(%%total,100))
exit
:close
|
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Mon Nov 14, 2005 3:32 pm Post subject: |
|
|
| Code: | OPTION DECIMALSEP,"."
#DEFINE command,disknmem
#DEFINE function,disknmem
external @path(%0)DiskNMem.dll
TITLE Memory Pie
DIALOG CREATE,Memory Pie,-1,0,323,295
DIALOG ADD,PIECHART,PIECHART1,195,235,50,50,0,Memory status
DIALOG ADD,PIECHART,PIECHART2,70,210,50,50,0,HDD C status
Gosub memfree
dialog set,piechart1,%%percent
Gosub hddfree
dialog set,piechart2,%R
DIALOG SHOW
:loop
wait event
goto @event()
:memfree
%%free = @Name(@DiskNMem(PhysMem,Free))
%%total = @Name(@DiskNMem(PhysMem,,))
%%percent = @div(%%total,@div(%%free,100))
exit
:hddfree
parse "%A;%B",@volinfo(C,FS)
%R = @format(@fmul(@fdiv(%A,%B),100),2.0)
exit
:close |
Last edited by filip on Mon Nov 14, 2005 4:31 pm; edited 4 times in total |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Nov 14, 2005 3:57 pm Post subject: |
|
|
Then try to check what values the variables in memfree hold at the end of the sub.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Mon Nov 14, 2005 4:02 pm Post subject: |
|
|
I stupid woman it's fixed thanks...  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|