Raised This Month: $ Target: $400
 0% 

Array must be indexed O_O


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 08-12-2013 , 11:04   Re: Array must be indexed O_O
Reply With Quote #1

Quote:
Originally Posted by YamiKaitou View Post
A String is not the same as an Integer. Either convert the array to a 1D Integer array or convert the value from a String to an Integer
Using str_to_num ?
Podarok is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-12-2013 , 11:06   Re: Array must be indexed O_O
Reply With Quote #2

Quote:
Originally Posted by Podarok View Post
Using str_to_num ?
If it must be an array of strings, then yes. Seeing as they are all numbers, why can't you switch it to a 1D array?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 08-13-2013 , 04:11   Re: Array must be indexed O_O
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
If it must be an array of strings, then yes. Seeing as they are all numbers, why can't you switch it to a 1D array?
I had a long brake in scripting. Could u tell me how would that look like in code?
Podarok is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-13-2013 , 07:06   Re: Array must be indexed O_O
Reply With Quote #4

Quote:
Originally Posted by Podarok View Post
I had a long brake in scripting. Could u tell me how would that look like in code?
Code:
    static const g_Cost[] = {
    10000,
    13000,
    16000,
    5000,
    16000,
    12000,
    16000,
    15000,
    16000
}
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 08-13-2013 at 07:47.
YamiKaitou 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:58.


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