Log in

View Full Version : Function inside a function



Deadly Serious
01-03-2012, 10:37 AM
I've got a function inside a function and I keep receiving an error called "Unknown identifier."
I have no idea why. I've clearly identified the functions.
Does anybody know how to fix this?
I will post the code if needed.

2nd Problem:
I also receive this problem when using flights' FindObjEx_F function
"[Error] (229:12): Unknown identifier 'SMART_DrawBox' at line 228
Compiling failed."
Line 228: SMART_DrawBox(IntToBox(X-Bounds, Y-Bounds, X+Bounds, Y+Bounds));

Kyle Undefined
01-03-2012, 10:38 AM
Please post the code, it will help :)

Yanhua
01-03-2012, 10:40 AM
Your function that is included in the function needs to be before that function.

Example:



Function2 :Boolean;
Begin
stuff;
end;

Function1 : Boolean;
Begin
Function2;
end;


2nd problem" have you included paintsmart.scar at the start?

Kyle Undefined
01-03-2012, 10:51 AM
Your function that is included in the function needs to be before that function.

I'm sorry, but all I can think of is "Yo dawg, I heard you like functions. So we put a function in your function so you can function while you function."

Deadly Serious
01-03-2012, 10:53 AM
Your function that is included in the function needs to be before that function.

Example:



Function2 :Boolean;
Begin
stuff;
end;

Function1 : Boolean;
Begin
Function2;
end;


2nd problem" have you included paintsmart.scar at the start?


Wow, I'm silly. I didn't put the functions in order and when I use the paintsmart.scar I get this error: [Error] C:\Simba2\Includes\SRL/SRL/misc/paintsmart.scar(21:3): Unknown identifier 'SmartSetDebug' at line 20
Compiling failed.
20: SmartSetDebug(True);

This is in the Paintsmart tab. Was using normal paint before.




I'm sorry, but all I can think of is "Yo dawg, I heard you like functions. So we put a function in your function so you can function while you function."

Lol'd, classic meme. It's was used on sythe quite a bit :P

Yanhua
01-03-2012, 10:53 AM
I'm sorry, but all I can think of is "Yo dawg, I heard you like functions. So we put a function in your function so you can function while you function."

That sentence definitely was a bit confusing. :spot:

I believe the example quite clearly showed my point though.

Bad Processor
01-03-2012, 10:53 AM
I'm sorry, but all I can think of is "Yo dawg, I heard you like functions. So we put a function in your function so you can function while you function."

http://i285.photobucket.com/albums/ll71/canoraid/yo-dawg-derive-while-you-derive-700.jpg
Hehe.
Can you post the code? Sounds to me like you've left a semicolon out somewhere. Check your ends to see that they are all end; and not end. except the last one.

Also, looking at OP's name then the meme makes me wheeze so much.

Deadly Serious
01-03-2012, 11:10 AM
When I use the paintsmart.scar I get this error:
[Error] C:\Simba2\Includes\SRL/SRL/misc/paintsmart.scar(21:3): Unknown identifier 'SmartSetDebug' at line 20
Compiling failed.
Line 20: SmartSetDebug(True);

This is in the Paintsmart tab.

Bump for the knowledge.

Kyle Undefined
01-03-2012, 11:12 AM
How are you using it?

Deadly Serious
01-03-2012, 11:13 AM
How are you using it?

SMART_DrawBox(IntToBox(X-Bounds, Y-Bounds, X+Bounds, Y+Bounds));

Kyle Undefined
01-03-2012, 11:14 AM
Hmm, are you including the files correctly?

Deadly Serious
01-03-2012, 11:19 AM
Hmm, are you including the files correctly?

Yes, I believe so. I'm using Flights Findobjex_F.