Results 1 to 7 of 7

Thread: Runtime error - Access violation

  1. #1
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default Runtime error - Access violation

    Hi, I keep on getting this error:
    Code:
    [Runtime Error] : Exception: Access violation at address 00405260 in module 'scar.exe'. Write of address 02CBBFF4 in line 40 in script D:\Program Files\SCAR 3.15b\Scripts\My Scripts\AutoTalkers\Working On\Random.scar
    from this part of my script that I'm working on:
    SCAR Code:
    function WhichColour : string;
    begin
     case Random(5) of
       0: Result:= Colour1;
       1: Result:= Colour2;
       2: Result:= Colour3;
       3: Result:= Colour4;
       4: Result:= Colour5;
     end;
     if (WhichColour = Colour1) then C1:= C1 + 1;
     if (WhichColour = Colour2) then C2:= C2 + 1;
     if (WhichColour = Colour3) then C3:= C3 + 1;
     if (WhichColour = Colour4) then C4:= C4 + 1;
     if (WhichColour = Colour5) then C5:= C5 + 1;
    end;

    I have included SRL and SetupSRL in my main loop, and I do have any bitmaps in the script, so can anyone help me?

    Thanks,
    Richard
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  2. #2
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    declare dtms and stuff... add a return to your string... idk... stup violating access! geez.
    ~ Metagen

  3. #3
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I'll PM it to you EC.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  5. #5
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your problem is that you inadvertently made the function recursive. Thus causing memory problems

    Replaces WhichColour with Result in your if statements
    ~ Metagen

  6. #6
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I'll give it a try, Metagen.

    Thanks,
    Richard

    Metagen...Thank you!!!

    Thank you EC for showing me that other error which would have occurred after sorting out the one I posted.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  7. #7
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nooo problemo add me on msn
    ~ Metagen

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 10-27-2007, 12:29 PM
  2. Replies: 2
    Last Post: 10-11-2007, 05:08 PM
  3. Replies: 3
    Last Post: 06-01-2007, 08:42 PM
  4. Replies: 2
    Last Post: 04-07-2007, 03:43 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
  •