file f; non standard capitalization

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

Post Reply
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

file f; non standard capitalization

Post by rrTea »

In ZExpression, everything is defined using
model m; //Model m; error
string s; //String s; error
int i; //Int i; error

but
file f;
doesn't work unless it's capitalized like File f; (also it doesn't turn bold / blue like the rest).
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

Re: file f; non standard capitalization

Post by Kjell »

Hi rrTea,

That's because int / float / string and even model ( a pointer to a Model instance ) are built-in data types, while Bitmap / File / Sound are component types.

K
User avatar
VilleK
Site Admin
Posts: 2320
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: file f; non standard capitalization

Post by VilleK »

It is a bit inconsistent, I agree, but indeed it is like Kjell explains. I wanted to make the built in primitive datatypes similar to C-standard ("int" etc) but the component types with initial caps to give them a sense of being a "class type".
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: file f; non standard capitalization

Post by rrTea »

I can see the logic - a bit surprising the first time one bumps into it (at least to me - I'd find it easier to remember if it were all the same, especially since the int & co are used all the time) but not a problem really, I'll keep it in mind. Sorry for the false alarm!
Post Reply