Results 1 to 6 of 6

Thread: Getting a runtime error: "Access violation".... more within...

  1. #1
    Join Date
    Aug 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Getting a runtime error: "Access violation".... more within...

    I'm trying to check if a character, in the string: word, is present at a particular position
    here's a snippit

    Code:
    word := 'reset the whole string, yes all of it';
    word := (getmouseovertext());
    
    if word[11] = 's' then
      if word[12] = 's' then
         Result := 1;
    However, right before the if statements (I guess), I'm getting this error
    "Exception in Script: Runtime error: "Access violation" at line 161, column 19
    The following bitmaps were not freed: [Minimap Mask]".

    I'm very confused any and all help is much appreciated.

  2. #2
    Join Date
    Oct 2013
    Location
    East Coast USA
    Posts
    770
    Mentioned
    61 Post(s)
    Quoted
    364 Post(s)

    Default

    getmousovertext() probably returned an empty string ''

    Then you told the program to look at character 11, past the end of the string.

    That generates the access violation, you wandered into memory that you weren't supposed to be touching.

    There's a built in function to get your string position...

    Simba Code:
    program new;
    begin
    writeln(pos('find','can it find me?')  );
    end.

    Progress Report:
    Compiled successfully in 218 ms.
    8
    Successfully executed.

  3. #3
    Join Date
    Aug 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    There's a built in function to get your string position...
    Dang if only it said segment fault or something lol.
    Whats the include for that function, if you mind me asking?

  4. #4
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by thickfreakness View Post
    Dang if only it said segment fault or something lol.
    Whats the include for that function, if you mind me asking?
    no include, exported function Pos()

    Simba Code:
    Result := Pos('ss', getmouseovertext());
    if Result = 0 then
      writeln('ss not found from getmouseovertext()');

  5. #5
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Not sure how you actually got that to even access violate since it will never compile in the first place..


    "Word" is a reserved keyword/type. It's like naming your integer: "Integer" or naming your string: "String".

    You can't.
    I am Ggzz..
    Hackintosher

  6. #6
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Not sure how you actually got that to even access violate since it will never compile in the first place..


    "Word" is a reserved keyword/type. It's like naming your integer: "Integer" or naming your string: "String".

    You can't.
    well for some reason it actually works in pascalscript...apparently pascalscript doesn't check for type names...
    you could even declare 'break'/'continue' as a variable...
    Last edited by riwu; 08-30-2014 at 07:23 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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