Results 1 to 3 of 3

Thread: Duplicate Identifier Error with a String Array

  1. #1
    Join Date
    Jul 2007
    Location
    America
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Duplicate Identifier Error with a String Array

    Hi, I'm rather new to SCAR (currently learning how to script, know some basics), and I'm trying to make an array of strings for an autotalker with random chat. I've set the array like this...

    Code:
    const NumberofTexts =  5;
    var TextString: array[0..(NumberofTexts-1)] of String;
    
    TextString[0] :=   'fill'; // Fill out what you want the autotalker to say here (If BegType is not used)
    TextString[1] :=   'this';  // ''
    TextString[2] :=   'out';  // ''
    TextString[3] :=   'with';  // ''
    TextString[4] :=   'text';  // ''
    And I get an error for Duplicate identifier 'TextString'

    Somebody mind helping me out with this? I have a feeling it was something to do with maybe me not setting up the array for string, but I'm not sure. If additional code is needed i'll be happy to supply.
    I dunno, those asians are pretty difficult to out-auto, legend has it they don't need sleep or food...~tim0suprem0
    Activity is on the decline - school's got me
    Check out my tutorial[s] on Color Finding!||Procedures and Functions!

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by kikwit View Post
    Hi, I'm rather new to SCAR (currently learning how to script, know some basics), and I'm trying to make an array of strings for an autotalker with random chat. I've set the array like this...

    Code:
    const NumberofTexts =  5;
    var TextString: array[0..(NumberofTexts-1)] of String;
    
    TextString[0] :=   'fill'; // Fill out what you want the autotalker to say here (If BegType is not used)
    TextString[1] :=   'this';  // ''
    TextString[2] :=   'out';  // ''
    TextString[3] :=   'with';  // ''
    TextString[4] :=   'text';  // ''
    And I get an error for Duplicate identifier 'TextString'

    Somebody mind helping me out with this? I have a feeling it was something to do with maybe me not setting up the array for string, but I'm not sure. If additional code is needed i'll be happy to supply.
    Text string is probably a global variable in SRL, a procedure/function in SRL or scar, so it's saying you can't call it TextString because something is already called that. Just try naming it differently and that should fix it.. =)

  3. #3
    Join Date
    Jul 2007
    Location
    America
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, I found out what I was doing wrong. My array wasn't in any procedure - I looked around in the wiki and found an answer.

    Now it's just a matter of fixing the dozens of tiny errors in my script...
    So far I've found at least 5, and the script is only about 50 lines!

    FINALLY, lol

    Successfully compiled
    I dunno, those asians are pretty difficult to out-auto, legend has it they don't need sleep or food...~tim0suprem0
    Activity is on the decline - school's got me
    Check out my tutorial[s] on Color Finding!||Procedures and Functions!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Duplicate identifier Error
    By soul hacker in forum OSR Help
    Replies: 15
    Last Post: 06-03-2007, 11:42 PM
  2. Duplicate Identifier Error
    By A G E N T in forum OSR Help
    Replies: 7
    Last Post: 02-13-2007, 01:46 AM
  3. Duplicate Identifier Error
    By I Karma I in forum OSR Help
    Replies: 6
    Last Post: 12-05-2006, 11:55 AM

Posting Permissions

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