Results 1 to 9 of 9

Thread: Weird error

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The most likely problem is that you are trying to acces elements from dynamic array with no pre set lenght which means it has the lenght of 0 elements. In Delphi this would result in "Out of bonds" error but I'm not sure what error FPC would create.

    Anywhay instead of trying to duplicate C++ method of imput hndling why don't you use one from Pascal based SDL demos.
    It is not always good to directly translate source code from one programming language to another becouse not all programming languages alow using same aproaches.

  2. #2
    Thanks for your answer. I took a quick look at how hedgewars handles its input. Unfortunately, even if I set the array to [0..65536], like they do in hedgewars, the error message remains the same.
    Last edited by much.love; 24-03-2014 at 12:13 AM.

  3. #3
    array size should depend on enum range
    and if key^.keysym.sym is an integer enum or sth then you can typecast it like this: event := integer(key^.keysym.sym);

Bookmarks

Posting Permissions

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