Raised This Month: $ Target: $400
 0% 

Function Argument Treated as Undefined Symbol


Post New Thread Reply   
Thread Tools Display Modes
Author Message
meganerdandy
New Member
Join Date: Jun 2024
Unread 06-09-2024 , 18:54   Function Argument Treated as Undefined Symbol
Reply With Quote #1

```sourcepawn
struct ExampleStruct {
public char[] ExampleValue;
}

public void ExampleReproductionFunction(ExampleStruct obj) {
PrintToChatAll(obj.ExampleValue); // Problematic Line
}
```

I'm running into an error stating on the PrintToChatAll line that there is no symbol called "obj".

Am I doing something wrong, or is this just a bug. This doesn't happen if the function argument isn't a struct, does Pawn not support structs as function arguments?

Exact Error:
undefined symbol "obj"
meganerdandy is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Unread 06-10-2024 , 04:47   Re: Function Argument Treated as Undefined Symbol
Reply With Quote #2

You mean enum struct there and not just struct. You also need to specify the size of the string.

Edit: And get rid of public.

Last edited by Fyren; 06-10-2024 at 05:53.
Fyren is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode