Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, TedMar, Ayumi), 1,392 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How do I make My program display a remainder #233319
10/28/08 05:08
10/28/08 05:08
Joined: Apr 2004
Posts: 77
USA
Cactus Offline OP
Junior Member
Cactus  Offline OP
Junior Member

Joined: Apr 2004
Posts: 77
USA
My program wont display a remainder on the screen only a whole number. I have read through the lite c workshop and I hav'nt seen anything about it(possibly missed it).
Any help would be great thnx.


HI
Re: How do I make My program display a remainder [Re: Cactus] #233321
10/28/08 06:14
10/28/08 06:14
Joined: Aug 2008
Posts: 61
Neurosys Offline
Junior Member
Neurosys  Offline
Junior Member

Joined: Aug 2008
Posts: 61
use format string parameters like "%0.0f" to represent your #... if that doesnt help paste the code and i'll have a looksee


See more code and crap @ www.neuroticnetworks.com
Re: How do I make My program display a remainder [Re: Neurosys] #233322
10/28/08 06:17
10/28/08 06:17
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
I think that is what the modulus operator is for, but im not sure.

Re: How do I make My program display a remainder [Re: lostclimate] #233325
10/28/08 07:21
10/28/08 07:21
Joined: Apr 2004
Posts: 77
USA
Cactus Offline OP
Junior Member
Cactus  Offline OP
Junior Member

Joined: Apr 2004
Posts: 77
USA
k now I don'nt know where to put the modulus opperator. here my code

#include <acknex.h>
#include <default.c>

STRING* time_hour_str = "time_hour";
STRING* time_used_hour_str = "time_used_hour";
STRING* time_left_hour_str = "time_left_hour";

var time_hour = 5;
var time_used_hour = 3;
var time_left_hour = 0;
var time_hour2 = 0;
var time_used_hour2 =0;



var time_min = 50;
var time_used_min = 21;
var time_left_min = 0;


PANEL* pDisplay_time_hour =
{
digits (10, 10, 5, *, 1, time_hour);
flags = VISIBLE;
}

PANEL* pDisplay_time_used_hour =
{
digits (10, 20, 5, *, 1, time_used_hour;
flags = VISIBLE;
}

PANEL* pDisplay_time_left_hour =
{
digits (10, 30, 5, *, 1, time_left_hour;
flags = VISIBLE;
}






TEXT* time_txt =
{
pos_x = 300;
pos_y = 250;
string (time_hour_str);
flags = VISIBLE;
}

TEXT* time_used_txt =
{
pos_x = 300;
pos_y = 275;
string (time_used_hour_str);
flags = VISIBLE;
}


TEXT* time_left_txt =
{
pos_x = 300;
pos_y = 300;
string (time_left_hour_str);
flags = VISIBLE;
}


function calc_time()

{



time_hour = time_hour * 60 + time_min ;
time_used_hour = time_used_hour * 60 + time_used_min;


time_left_hour = time_hour - time_used_hour;


time_left_hour = time_left_hour / 60;


}

/////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////

function main()
{
video_mode = 7; // create a program window of 800x600 pixels
screen_color.blue = 150; // and make its background dark blue
calc_time();

}


HI

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1