forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


DiskNMem.dll and Piechart

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sun Nov 13, 2005 2:36 pm    Post subject: DiskNMem.dll and Piechart Reply with quote

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
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Nov 14, 2005 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Mon Nov 14, 2005 3:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Nov 14, 2005 3:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Mon Nov 14, 2005 4:02 pm    Post subject: Reply with quote

I stupid woman it's fixed thanks... Embarassed Embarassed Embarassed
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group