SRL Archive - Help

Function inside a function


Deadly Serious

2012-01-03 05:37:32

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

2012-01-03 05:38:42

Please post the code, it will help :)

Yanhua

2012-01-03 05:40:21

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

2012-01-03 05:51:46

From: Yanhua
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

2012-01-03 05:53:18

From: Yanhua
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.



From: Kyle Undefined
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

2012-01-03 05:53:24

From: Kyle Undefined
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

2012-01-03 05:53:31

From: Kyle Undefined
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."


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

2012-01-03 06:10:30

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

2012-01-03 06:12:18

How are you using it?

Deadly Serious

2012-01-03 06:13:21

From: Kyle Undefined
How are you using it?


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

Kyle Undefined

2012-01-03 06:14:10

Hmm, are you including the files correctly?

Deadly Serious

2012-01-03 06:19:33

From: Kyle Undefined
Hmm, are you including the files correctly?


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