Gamestudio Links
Zorro Links
Newest Posts
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, degenerate_762, ozgur), 1,311 guests, and 0 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
"near" and "far" are some kind of undocumented reserved words #451475
05/07/15 05:29
05/07/15 05:29
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Code:
function main() {
  var near = 1.0;
  var far = 1.0;
}

Code:
nearfarbug compiling............
Error in 'line 4: 
syntax error
<   var near = 1.0; >.



Spent time looking for a syntax error that isn't.

Re: "near" and "far" are some kind of undocumented reserved words [Re: GPEngine] #451476
05/07/15 07:21
05/07/15 07:21
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
I don't use zorro, but anyway.. your using var inside the function, which may cause an error if those are engine predefined.

try like this:

Code:
function main(){
   near = 1.0;
   far = 1.0;
}


Last edited by DLively; 05/07/15 07:22.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: "near" and "far" are some kind of undocumented reserved words [Re: DLively] #451482
05/07/15 15:03
05/07/15 15:03
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California

Re: "near" and "far" are some kind of undocumented reserved words [Re: GPEngine] #451486
05/07/15 18:06
05/07/15 18:06
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
It's just different syntax combinations laugh

My solution holds true to another situation, however from your question I was mislead to believe that near and far were engine predefined (Not user defined).

Quote:

"near" and "far" are some kind of undocumented reserved words


I just attempted to find them in the manual and can't find them - which suggests to me that you are defining those vars which nulls my first post.

That is indeed a strange error since that should work if you're defining them.

What if you made those variables global instead of local? still get an error like that?


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: "near" and "far" are some kind of undocumented reserved words [Re: DLively] #451488
05/08/15 01:43
05/08/15 01:43
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
As much as I'm enticed by locked safes I'll think I'll leave this one alone.

Re: "near" and "far" are some kind of undocumented reserved words [Re: GPEngine] #451495
05/08/15 10:45
05/08/15 10:45
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
near and far are reserved words in Windows C, going back to DOS days. They do indeed not make much sense in modern Windows systems, so we'll remove them from the compiler in the next update.

Re: "near" and "far" are some kind of undocumented reserved words [Re: jcl] #451513
05/08/15 15:50
05/08/15 15:50
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Of course I searched for [c reserved words] and looked at GNU C documentation. Of course Windows has its own reserved words. I didn't think to look there.


Moderated by  Petra 

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