AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Double Array - Manual Defining (https://forums.alliedmods.net/showthread.php?t=49823)

mysticssjgoku4 01-13-2007 17:11

Double Array - Manual Defining
 
I'm trying to create a double array and define the values manually.

Code:
new CONFIG_CVARS[6][32] = {     "configs" => "config.ini",     "users" => "users.ini" }

Does not work. I believe that is the way I could do it in PHP, but what is the correct format to do this in PAWN?

Salepate 01-13-2007 18:16

Re: Double Array - Manual Defining
 
If it does not work, then pawn does not support string arrays.

dutchmeat 01-13-2007 18:17

Re: Double Array - Manual Defining
 
use [ small ] tags...

try this: (not tested)

Code:
#define MAXSTRING 3 CONFIG_CVARS[MAXSTRING]{"config.ini","users.ini"} new config = CONFIG_CVARS[0] new users = CONFIG_CVARS[1]

Emp` 01-13-2007 18:23

Re: Double Array - Manual Defining
 
Code:

#define MAX_STRINGS 2
 new const CONFIG_CVARS[MAX_STRINGS][32] =
 {
        "config.ini", "users.ini"
 }


mysticssjgoku4 01-13-2007 18:50

Re: Double Array - Manual Defining
 
May be I need a triple array for this.

I want to place "users" in row 1, cell 0, I want to place "users.ini" in row 1 cell 1.

You all eliminated what I tried to do in the code :-\.

[ --<-@ ] Black Rose 01-13-2007 19:12

Re: Double Array - Manual Defining
 
Code:
new array[][][] = {     { "config", "configs.ini" },     { "users", "users.ini" } }

mysticssjgoku4 01-13-2007 19:19

Re: Double Array - Manual Defining
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 426849)
Code:
new array[][][] = {     { "config", "configs.ini" },     { "users", "users.ini" } }

Ah, thank you very much :).

Brad 01-13-2007 23:38

Re: Double Array - Manual Defining
 
For the record, they're referred to a 2D-arrays (2 dimensional).

lamamba 02-26-2007 20:35

Re: Double Array - Manual Defining
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 426849)
Code:

    new array[][][] = { { "config", "configs.ini" },
{ "users", "users.ini" } }


hi
how loop through this kind of arrays without exact sizes (how check end of every dimension or how find out size of this) ? thx

Greenberet 02-27-2007 03:40

Re: Double Array - Manual Defining
 
@lamamba
use the sizeof parameter

@goku
http://forums.alliedmods.net/showthread.php?t=26634


All times are GMT -4. The time now is 22:20.

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