Raised This Month: $ Target: $400
 0% 

[Solved] Function argument gets overwritten...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mptijsma
Member
Join Date: Mar 2006
Old 04-29-2006 , 06:01   [Solved] Function argument gets overwritten...
Reply With Quote #1

I'm having a problem with a function argument getting overwritten by another value.

The problem:
ImportantBlaat[] becomes the content of Text[];

When I call the function, ImportantBlaat[] is equal to Text[].

Maybe when Text[] is changed with read_file(), ImportantBlaat[] will be changed again so it becomes equal to Text[] again?

Actually, this is what's happening.

The test plugin:
Code:
new Text[1024],Size,File[]="blaat.txt"; public plugin_init() {     format(Text,sizeof(Text),"%s","This is REALLY important!");     function(Text); } public function(ImportantBlaat[]) {         // Debug: ImportantBlaat[] = "This is REALLY important!"        read_file(File,0,Text,sizeof(Text),Size);     // Debug: ImportantBlaat[] = "blaat"     server_print(ImportantBlaat); }

Contents of blaat.txt:
Code:
blaat
Output:
Code:
blaat
Desired output:
Code:
This is REALLY important!
mptijsma is offline
 



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 05:03.


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