Raised This Month: $ Target: $400
 0% 

Constant 2-D array syntax *solved*


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 06-29-2007 , 06:53   Constant 2-D array syntax *solved*
Reply With Quote #1

This has been causing me some serious headache ...

I'm trying to create a constant 2-D array of floating point values.

So something like:
ARRAY[0][0]=0.0
ARRAY[0][1]=0.1
ARRAY[0][0]=0.0
ARRAY[1][0]=1.0

And usually I get an error, but my latest attempt at guessing the syntax just made unexpected errors in amxxpc.exe

Now this works fine for an array of strings, which we all know is really a 2-d array:

Code:
new const STR_ARRAY[2][3] = { "abc" ,"def" }



So one would naturally assume that for a "real" 2-d array:

Code:
new const Float:Array[2][2] = { { 0.0 , 0.1 } ,{ 0.0 , 1.0 } }



But this just crashes the compiler ^^

Anyone care to show me quite how easy this is / how stupid I'm being?

EDIT: Arggh ... I figured it.

The actual array I used was a lot bigger than that, and I had 30/0 and not 30.0 as one of the values.

They sooo shouldn't be so close together ... and the compiler should so be able to spot div0 ... *sigh*

And goddamit does editing posts screw up your "small" tags ...

Last edited by purple_pixie; 06-29-2007 at 08:06. Reason: I win medals for stupid
purple_pixie is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-29-2007 , 13:08   Re: Constant 2-D array syntax *solved*
Reply With Quote #2

Quote:
Originally Posted by purple_pixie View Post
And goddamit does editing posts screw up your "small" tags ...
Quote:
Originally Posted by Lee View Post
Go to UserCP, Edit Options, at the bottom, change Enhanced Interface to Standard Editor.

This is also a workaround for the broken Pawn/Small tags, and obviously why Freecode wasn't seeing the behaviour I described.
Lee 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 20:30.


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