Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/21/26 19:15
Camera always moves upwards?
by clonman. 02/21/26 09:29
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 6,962 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Variables #356594
02/02/11 21:31
02/02/11 21:31
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I really really....


...REALLY...

...hate the variable concept of Lite-C. Instead of making it just like in C, it's done.... lite.

And with that in mind I have a char data type. But only unsigned. Come on, it's a very useful data type for simple error value returns, which often are negative. Okay easy solved - use some bigger signed type.


But...
I needed a 4 byte data type. UNsigned please. No decimals. A simple common unsigned long.

But Lite-C simply DOES NOT OFFER an unsigned 4 byte data type without decimals.


This is sooooooo much annoying.
I hate hate HATE this so much. I really want the freedom of choice and pick signed and unsigned on intention as every normal C programmer does... or at least should do.... probably does not.

Re: Variables [Re: FBL] #356597
02/02/11 21:45
02/02/11 21:45
Joined: Mar 2010
Posts: 75
YellowAfterlife Offline
Junior Member
YellowAfterlife  Offline
Junior Member

Joined: Mar 2010
Posts: 75
At first, if you are making a application (without many visual components), you could try using C (or precisely, C++) for it.
As in LiteC, you can always do something silly enough, as create a small function to store unsigned long int in string#4 and convert it to standart var type when you need it.
Maybe, more variable types could be inplemented in engine, but who knows, how hard are these to add in.


Unfortunately, I've not worked with 3dGS for a while now, but it was fun
Re: Variables [Re: YellowAfterlife] #356604
02/02/11 22:22
02/02/11 22:22
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Code:
#include <acknex.h>
#include "printf.h"
void main(){
	unsigned int a = 0xFFFFFFFF;
	printf("%u",a);
}



not good enough?


3333333333
Re: Variables [Re: Quad] #356611
02/02/11 22:44
02/02/11 22:44
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Quadraxas, go ahead, define UINT32_MAX and compare it to an UINT16_MAX, you will be surprised. @firo: I feel your pain mate


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Variables [Re: Quad] #356614
02/02/11 22:52
02/02/11 22:52
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Originally Posted By: Quadraxas


not good enough?


Sorry for being rude now, but.... how about a nice cup of RTFM? grin

We are not allowed to decide whether a variable is unsigned or signed - the compiler does. The "unsigned" keyword is only discarded to make imported native C code still compile without abort.
When speaking in hex terms everything is fine - but I do not always want to view hex.

Last edited by Firoball; 02/02/11 22:54.
Re: Variables [Re: FBL] #356621
02/02/11 23:07
02/02/11 23:07
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
right, i suddenly remember i thought dumping a7 and switching to another engine because of that. i didn't switch.


3333333333
Re: Variables [Re: Quad] #356643
02/03/11 02:18
02/03/11 02:18
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Lite-C seems to abandon quite a bit of the ANSI-C specification for no valid reason frown They really should sort it out.

Re: Variables [Re: DJBMASTER] #356690
02/03/11 13:41
02/03/11 13:41
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
WHAT?!? unsigned doesn't do anything? Is it the same for unsigned short??

Damn, I've based parts on my last project on that.. Oh well.. Now I hate vars too! This information is so well hidden in the manual (under updating from c-script to lite-c) you'd never find it on your own!

Re: Variables [Re: SchokoKeks] #356691
02/03/11 13:59
02/03/11 13:59
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
< > opeators always assume that the variable is signed. The main source of the problem.


3333333333
Re: Variables [Re: SchokoKeks] #356754
02/03/11 18:40
02/03/11 18:40
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Originally Posted By: SchokoKeks
WHAT?!? unsigned doesn't do anything? Is it the same for unsigned short??

Damn, I've based parts on my last project on that.. Oh well.. Now I hate vars too! This information is so well hidden in the manual (under updating from c-script to lite-c) you'd never find it on your own!


I think short is always unsigned. Sounds logical, doesn't it?

No? Oh... I feel with you...

Originally Posted By: manual

Typ Grösse Bereich Minimum Genauigkeit*
var 4 bytes -1048577.999 to 1048576.999** 0.001 ~9
long, int 4 bytes -2147483648 to 2147483647 1 ~10
short 2 bytes 0 to 65536 1 ~4
char 1 byte 0 to 256 1 ~2
float 4 bytes -3.4·1038 bis 3.4·1038 1.2·10-38 ~6
double 8 bytes -1.8·10308 bis 1.8·10308 2.2·10-308 ~14


Page 1 of 2 1 2

Gamestudio download | 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