Raised This Month: $ Target: $400
 0% 

CellArray of CellArrays


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-30-2009 , 16:47   CellArray of CellArrays
Reply With Quote #1

I'm having trouble creating this, most likely because I don't understand the syntax.

PHP Code:
ArrayPushCell(StoreData,ArrayCreate(1,1))

ArrayPushCell(ArrayGetCell(StoreData,0),1337
That would be trying to put 1337 into the embedded cellarray, but it says "Invalid cellvector handle provided"
__________________
Bad_Bud is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-30-2009 , 16:55   Re: CellArray of CellArrays
Reply With Quote #2

PHP Code:
new Array:iArray ArrayCreate(1,1);
ArrayPushCell(iArray1337); 
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-30-2009 , 17:54   Re: CellArray of CellArrays
Reply With Quote #3

Quote:
Originally Posted by Alka View Post
PHP Code:
new Array:iArray ArrayCreate(1,1);
ArrayPushCell(iArray1337); 
No, I want to do this:

PHP Code:
new Array:iArray ArrayCreate(1,1);
new Array:
uArray ArrayCreate(1,1);
ArrayPushCell(iArrayuArray); 
I want to store an array handle in a cell of the other array, so I can have a dynamic one inside of a dynamic one.
__________________
Bad_Bud is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-30-2009 , 18:11   Re: CellArray of CellArrays
Reply With Quote #4

Edit: Forget what I had here if you read it.

I think I got it... it was just an out of bounds pointer. ;(

Took forever to find.
__________________

Last edited by Bad_Bud; 08-30-2009 at 18:23.
Bad_Bud is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-30-2009 , 18:18   Re: CellArray of CellArrays
Reply With Quote #5

StoreData has Array: tag ?! Also ArrayGetCell returns an integer...But as i can see it's a useless work, what are you trying to do anyway?
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 08-30-2009 at 18:21.
Alka is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-30-2009 , 18:23   Re: CellArray of CellArrays
Reply With Quote #6

Quote:
Originally Posted by Alka View Post
StoreData has Array: tag ?! Also ArrayGetCell returns an integer...But as i can see it's a useless work, what are you trying to do anyway?
It does appear to work... I'm sure I'm not the first one to do this.

I'm basically faking having objects.

It returns whatever you put in, since Pawn doesn't have datatypes. I could put a float in, and as long as I put it back in a float variable, it's fine. It might say tag mismatch, but it works.
__________________
Bad_Bud is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-30-2009 , 18:30   Re: CellArray of CellArrays
Reply With Quote #7

Yea, also you can do _: for undefined data type.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-30-2009 , 18:33   Re: CellArray of CellArrays
Reply With Quote #8

Oh? Does that make it ignore all tag mismatches?
__________________
Bad_Bud is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-30-2009 , 19:15   Re: CellArray of CellArrays
Reply With Quote #9

Code:
new Array:aAllArrays = ArrayCreate( 1, 1 ); new Array:aData = ArrayCreate( 1, 1 ); ArrayPushCell( aData, 1337 ); ArrayPushCell( aAllArrays, aData ); // ... new iValue = ArrayGetCell( Array:ArrayGetCell( aAllArrays, 0 ), 0 ); // iValue should be 1337
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 15:05.


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