Raised This Month: $32 Target: $400
 8% 

PushArrayArray argument 2 error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pride95
Senior Member
Join Date: Aug 2015
Old 09-09-2017 , 17:15   PushArrayArray argument 2 error
Reply With Quote #1

PHP Code:
    the_servers CreateArray(ByteCountToCells(50));

        
Handle array_row CreateArray(3);

        while(
SQL_FetchRow(hndl)) {
            
ClearArray(array_row);
            
SQL_FetchString(hndl0namesizeof(name));
            
PushArrayString(array_rowname);
            
SQL_FetchString(hndl1serveripsizeof(serverip));
            
PushArrayString(array_rowserverip);
            
PushArrayCell(array_rowSQL_FetchInt(hndl2));
            
PushArrayCell(array_rowSQL_FetchInt(hndl3));
            
PushArrayArray(the_serversarray_row3);
        } 
error on line with PushArrayArray. argument type mismatch (argument 2). what im doing wrong?
pride95 is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 09-09-2017 , 17:27   Re: PushArrayArray argument 2 error
Reply With Quote #2

You are pushing an ArrayList which is a handle to data. If you want to push that you use PushArrayCell. PushArrayArray is for int arry[3]; for example.

Last edited by Dr!fter; 09-09-2017 at 17:27.
Dr!fter is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-09-2017 , 18:55   Re: PushArrayArray argument 2 error
Reply With Quote #3

Also, your creating the ArrayLists wrong

the blocksize parameter is the number of cell blocks per index (for arrays)

PHP Code:
the_servers CreateArray(); // 1 block per index should be enough for Handles
... 
PHP Code:
...
Handle array_row CreateArray(ByteCountToCells(50)); // 13 blocks should be plenty of space for strings
... 
Also, you do not need to call ClearArray on freshly created arrays.
__________________

Last edited by WildCard65; 09-09-2017 at 18:55.
WildCard65 is offline
Reply


Thread Tools
Display Modes

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 00:24.


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