Raised This Month: $ Target: $400
 0% 

More Help With Functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
capndurk
Senior Member
Join Date: Feb 2006
Old 04-07-2006 , 21:58   More Help With Functions
Reply With Quote #1

wait a minute, that's not fair...

I get this error:

error 067: variable cannot be both a reference and an array (variable "arg1")

and I use this code:

Code:
&arg1[]

but why can't I use that if the parse_loguser() native can?
capndurk is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-08-2006 , 09:20  
Reply With Quote #2

You can't use "switch" for the name of your function because it's Pawn's "reserved word".

Quote:
Originally Posted by Pawn "The Language" guide
Arguments that occupy a single cell can be passed by value or by reference.
The default is "pass by value".
To create a function argument that is passed by reference, prefix the argument name with the character &.

Example:
Code:
swap(&a, &b) {     new temp = b     b = a     a = temp }
VEN is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-08-2006 , 14:40  
Reply With Quote #3

removed
capndurk 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 16:44.


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