YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

array problem
kancsali
#1 Posted : Monday, March 20, 2017 7:23:06 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/20/2017(UTC)
Posts: 1

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hy forumers!
I have a problem.
I want to make this:

var[#][#] ( it contains an id ) and i get an error when i want to get the variable value:

Quote:
<Error (the index '1' does not exist)> & Line 467


Line 467:
Quote:
print(var[1][1].tostring());


others:
Quote:

local var= {};
..
var[tmp[rt_i]["id1"]] <- {};
var[tmp[rt_i]["id1"]][tmp[rt_i]["id2"]] <- GetIdentity();


tmp[rt_i]["id1"] return with 1 value not empty
tmp[rt_i]["id2"] return with 1 value not empty
GetIdentity() return with other value not empty
Please help me :(
(SORRY FOR BAD ENGLISH)
VoidSpirit
#2 Posted : Tuesday, March 21, 2017 4:09:41 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/27/2016(UTC)
Posts: 7

Thanks: 0 times
Was thanked: 2 time(s) in 2 post(s)
What is 'tmp'?
I think value of var[<index>] must be an array or table/instance/class (type with slots/indexed values), then var[<index][<index2>] will be valid. I.e. var[<index1>][<index2>] is a container of containers (var - container indexing by index1, var[<index1>] is a container - value storing in
var, var[<index1>][<index2>] is a value storing in var[<index1>].
In other words, Squirrel has no multi-indexed data types.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.114 seconds.