Results 1 to 7 of 7

Thread: How do I "look up" in an array?

  1. #1
    Join Date
    Oct 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How do I "look up" in an array?

    Firstly, this following question is essential to my tutorial island script. I'm trying to include location detection in my tutorial island script as a failsafe.

    For example, let's say that we had an array of string with five strings:

    [0] 'Hello, world!'
    [1] 'SRL owns!'
    [2] 'Easy money.'
    [3] 'AMD pwns Intel.'
    [4] 'Linux pwns Windows.'

    Let's say that within that array, I'm trying to "search" for text. For example, let's say I'm trying to find 'SRL owns!' somewhere in that array of string. How do I do that? I want to be able to find it and find it's position in the array. Example: [0], [1], [2], [3] or [4].

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    repeat
    i:=i+1;
    if stringarray[i]:='SRL owns!' then answer:=i;

  3. #3
    Join Date
    Oct 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ahh, Boreas to the rescue! For me, it was so much thought for such a simple answer. Thanks Boreas!

    One more question, how do I get ALL of the text (or at least the first line of text) in the instructions in the chat box during tutorial island? I need to get that text, compare it to text stored in an array and know position based on text.

  4. #4
    Join Date
    Nov 2006
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    try looking in SRL\SRL\core\text.scar... there will prob be something for it there... and thats a brilliant idea of how to know here you are on tut isle

  5. #5
    Join Date
    Oct 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks. I'll take a look there.

  6. #6
    Join Date
    Oct 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks. I'll take a look there.

  7. #7
    Join Date
    Mar 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Post Thelotter is the leading lottery service online.

    EDIT Fawk: *Sigh* SPAM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 05-17-2008, 12:48 PM
  2. action="www.site.com" method="post"
    By Jason2gs in forum General
    Replies: 4
    Last Post: 05-17-2007, 11:50 PM
  3. Replies: 3
    Last Post: 04-19-2007, 03:44 AM
  4. Replies: 5
    Last Post: 10-26-2006, 11:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •