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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Function Parameter: undeclared identifier? #371993
05/27/11 02:40
05/27/11 02:40
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Hi folks,
As i´m translating a large C-script code into Lite-C, i came into a weird error regarding function parameters.
The following code gives a '"G" undeclared identifier' error:
Code:
function PORTRAIT_DIALOG(var* G,var* B)
{
 if(G==0)
 {
  LUCY_CONTROL(22);
  PLAYER_CONTROLface(22);
  UNKNOWCONTROLface(B);
  return;
  }
...


It´s weird bacuse i have other functions with even more parameters... what´s wrong? Changing 'G' to lowercase or other name doesn´t do a thing, should i declare those variables somewhere else?
By the way: the function by itself (i placed it inside one of the Lite-C examples) works fine and give no errors... why?
No variables of any kind uses 'G' (and renaming it simply doesn´t work).
Any help is appreciated... thanks in advance.

Re: Function Parameter: undeclared identifier? [Re: Ericmor] #371994
05/27/11 05:24
05/27/11 05:24
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
OK, this was an engine error, if i ever saw one.
The top function had one less bracket, and the engine didn´t complain at all about a FUNCTION inside a function...
When i placed the bracket, the error changed... meaning that "G" was now recognized as a var.
What gives? I can now have FUNCTIONS inside other functions!?? The error should have been the word ´FUNCTION´ inside the function itself... is that allowed in Lite-C?

Re: Function Parameter: undeclared identifier? [Re: Ericmor] #372001
05/27/11 06:21
05/27/11 06:21
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
no it's not, function is only a define for fixed. It's lik same thing as having an int inside a function.


3333333333

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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