Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   aindexof() (https://forums.graalonline.com/forums/showthread.php?t=45085)

osrs 05-26-2003 11:21 PM

aindexof()
 
==================================
- aindexof(value,array)
calculates the positon of the first occurance
of value in the given array
==================================

I didnt get it,could someone explain me better?
Thanks.

Jeff 05-26-2003 11:24 PM

For array={8,0,2,11}:

aindexof(11,array)=3 and aindexof(8,array)=0

Python523 05-26-2003 11:25 PM

Re: aindexof()
 
Quote:

Originally posted by osrs
==================================
- aindexof(value,array)
calculates the positon of the first occurance
of value in the given array
==================================

I didnt get it,could someone explain me better?
Thanks.

...is it that hard to understand? geez x_X
a = {5,4,3,2,1,0};
b = aindexof(4,a);

b will equal 1

osrs 05-26-2003 11:30 PM

Re: Re: aindexof()
 
Quote:

Originally posted by Python523

...is it that hard to understand? geez x_X
a = {5,4,3,2,1,0};
b = aindexof(4,a);

b will equal 1

We are different persons,you think it is easy to understand,i dont,maybe because my english is not very good,but now i get it.
Thanks Jagen & Jeff.

Knuckles 05-28-2003 10:16 PM

Re: aindexof()
 
Quote:

Originally posted by osrs
==================================
- aindexof(value,array)
calculates the positon of the first occurance
of value in the given array
==================================

I didnt get it,could someone explain me better?
Thanks.

It's very similar to #I.
#I(string,array).

It's used like they said above ^_^.

Jeff 05-28-2003 11:35 PM

Re: Re: aindexof()
 
Quote:

Originally posted by Knuckles

It's very similar to #I.
#I(string,array).

It's used like they said above ^_^.


No, it's like lindexof.

#I(sarray,index) is analogous to array access in the form:
array[index]

Python523 05-28-2003 11:48 PM

Re: Re: aindexof()
 
Quote:

Originally posted by Knuckles

It's very similar to #I.
#I(string,array).

It's used like they said above ^_^.

The way you wrote it made it sound like the string was 2 dimentional, which it obviously isnt, #I(string,element) or #I(string,index) would be more correct


All times are GMT +2. The time now is 10:44 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.