|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Aug 2003
Posts: 6
|
please anyone knows how to declare and use array's in Maki ?
mi work is stoped, i am scripting, and i don't know how to declare and use arrays, i tried ANSI c/c++ form but don't work.a lot of thanks. |
|
|
|
|
|
#2 |
|
The Shark
(Forum King) |
I don't think you can.
You can however use strings, like: PHP Code:
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2003
Posts: 6
|
yes this for use a text control in skin.. but supose you want to do a list(array) of int o list(array) of strings.
in ansi c yo can do : int numbers[20]; and after in middle of the code numbers[3] = 3; maki don't have support for array's ? or witch is the correct sintax for do this ? |
|
|
|
|
|
#4 |
|
Forum Pirate
Beta Team Join Date: Oct 2001
Posts: 2,032
|
maki is all virtual... string in float and all the other stuff are auto-variable length values... you just declair
Global Int myInt; Global String myString; and that sort of stuff.. i dont think maki suports arrays as it stands.. but i think its one of the things soon to be done |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2003
Posts: 6
|
I did a curious type of array,
with xml and maki, i store data in text:<text id="acurious.array.0" default="this is item 0" ... /> and call his id's like : id="acurious.array.0" ... id="acurious.array.25" after you can access default property using getxmlparam or setxmlparam like: Global text atextvar; Global int index; Global string_to_save; atextvar = getscriptgroup().getitem("acurious.array."+integertostring(index)); atextvar.setxmlparam("default",string_to_save); big problem , curious solve
|
|
|
|
|
|
#6 |
|
Major Dude
(Reviewer) Join Date: Aug 2002
Location: South Florida
Posts: 1,387
|
The closest thing to an array in MAKI is the list class:
http://www.winamp.com/nsdn/winamp3x/...lass_List.html What's nice about it is that it can hold any type of variable or object. |
|
|
|
|
|
#7 | |
|
The Shark
(Forum King) |
Quote:
I had heard of lists but didn't have any info on them.I don't understand why you need an array though, Maki isn't a dynamic web-language, it's just the scripting language of a media player. |
|
|
|
|
|
|
#8 |
|
Major Dude
(Reviewer) Join Date: Aug 2002
Location: South Florida
Posts: 1,387
|
Ah, I just remembered something else that might be useful in this case, the System.getToken(string str, string separator, int tokennum) method:
http://www.winamp.com/nsdn/winamp3x/...System.html#69 With it, you can have a string with some type of value delimeters in in, then use that method to get at a certain one. There's no enumeration though unless you know, or figure out, how many values the string holds and for loop through it. By using more than one type of delimeter, you can simulate multi-dimensional arrays. Of course, this only works with string values. HH, it's nice that they kind of give us that functionality in case we ever need it!
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|