|
Digits Probs :X
#412695
12/01/12 16:10
12/01/12 16:10
|
Joined: Nov 2011
Posts: 139 India
Yashas
OP
Member
|
OP
Member
Joined: Nov 2011
Posts: 139
India
|
typedef struct UserProfile
{
STRING * Name;
STRING * Password;
STRING * EMail;
Date DOB;
Date DOC;
int BPI;
int XP;
int RegionSpeed;
int RegionMemory;
int RegionAttentition;
int RegionFlexibility;
int RegionLogic;
int Rank;
int BestRegion;
int TexPoints;
int MostCommonRegion;
int BestRegion;
int SelectedRegion;
}UserProfile;
PANEL * V10StatsDialog =
{
event = MoveWindow;
button(580,6,XButtonClicked,XButtonNormal,XButtonNormal,FormXButtonClicked,NULL,NULL);
digits(5,5,"My Stats",DialogTitle,1,0);
digits(10,40,"BrainPerformanceIndex:%d",DialogSubText,1,ActiveProfile.BPI);
digits(10,100,"Speed:%d",DialogSubText,1,ActiveProfile.RegionSpeed);
digits(10,140,"Memory:%d",DialogSubText,1,ActiveProfile.RegionMemory);
digits(10,180,"Flexibility:%d",DialogSubText,1,ActiveProfile.RegionFlexibility);
digits(10,220,"Problem Solving:%d",DialogSubText,1,ActiveProfile.RegionLogic);
digits(10,260,"Attentition:%d",DialogSubText,1,ActiveProfile.RegionAttentition);
digits(10,360,"Rank:%d",DialogSubText,1,ActiveProfile.Rank);
digits(10,400,"XP:%d",DialogSubText,1,ActiveProfile.XP);
digits(10,460,"Rank 1:",DialogSubText,1,0);
digits(10,500,"Rank 2:",DialogSubText,1,0);
digits(10,540,"Rank 3:",DialogSubText,1,0);
digits(110,460,"%s",DialogSubText,1,0);
digits(110,500,"%s",DialogSubText,1,0);
digits(110,540,"%s",DialogSubText,1,0);
alpha = 0;
bmap = DialogBackground;
layer = 5;
flags = TRANSLUCENT;
}
If ActiveProfile.BPI is 20 I get the digits in the PANEL showing 0! Wats wrong here??? Thanks
|
|
|
Re: Digits Probs :X
[Re: Yashas]
#412700
12/01/12 17:40
12/01/12 17:40
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
the digits element doesn't support integers. There's a workaround but I'm not sure if this really isn't causing trouble to the rest of the code:
digits(10,40,"BrainPerformanceIndex:%f",DialogSubText,1024,ActiveProfile.BPI);
EDIT: since you're using an integer use %.0f in the format string to cut off the .00000
Last edited by Kartoffel; 12/01/12 17:43.
POTATO-MAN saves the day! - Random
|
|
|
Re: Digits Probs :X
[Re: Uhrwerk]
#412702
12/01/12 17:45
12/01/12 17:45
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
I know but this doesn't work for digits... (I think it only supports %s and %f)
Last edited by Kartoffel; 12/01/12 17:46.
POTATO-MAN saves the day! - Random
|
|
|
Re: Digits Probs :X
[Re: Ch40zzC0d3r]
#412709
12/01/12 19:24
12/01/12 19:24
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Who the hell writes shitty "answers" like yours?
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Digits Probs :X
[Re: Wjbender]
#412713
12/01/12 20:04
12/01/12 20:04
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
tested it, gs supports neither %d nor %i. combining the var parameter with a cast operator results in a compiling error ('[..] too many parameters [..]')
(edit: we're still talking about the digits-element, right?)
Last edited by Kartoffel; 12/01/12 20:07.
POTATO-MAN saves the day! - Random
|
|
|
Re: Digits Probs :X
[Re: Kartoffel]
#412726
12/02/12 04:28
12/02/12 04:28
|
Joined: Nov 2011
Posts: 139 India
Yashas
OP
Member
|
OP
Member
Joined: Nov 2011
Posts: 139
India
|
digits(10,40,"BrainPerformanceIndex:%0.f",DialogSubText,1,ActiveProfile.BPI);
shows a zero always even though the BPI value is something else. When I remove Active...BPI parameter and install any integer ,it works!!
digits(10,40,"BrainPerformanceIndex:%0.f",DialogSubText,1,34);
Why is not ActiveProfile.BPI not working??
|
|
|
|