Results 1 to 9 of 9

Thread: PascalScript pointers?

  1. #1
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default PascalScript pointers?

    I just want to make sure before going into a fruitless search. Are pointers supported by simba?
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Er1k View Post
    I just want to make sure before going into a fruitless search. Are pointers supported by simba?
    As far as I know, if you use Lape, you can have pointers, but PascalScript does not support them.
    There used to be something meaningful here.

  3. #3
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Only to procedures, and only in a limited fashion.
    I made a new script, check it out!.

  4. #4
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so I believe linked lists for now is out of the question for simba usage, right?
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  5. #5
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    srl will go full lape in the near future. Just use lape for now.

    edit:
    I can't seem to get a linked list working in lape as you can't create a next or previous pointer of the type node within a record. But maybe I'm doing it wrong.
    Last edited by masterBB; 03-26-2012 at 03:13 PM.
    Working on: Tithe Farmer

  6. #6
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Try it of type pointer then typecast the doodle out of it.
    I made a new script, check it out!.

  7. #7
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    type
      PItem = ^TItem;
      TItem = record
        value: Integer;
        next: PItem;
      end;
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  8. #8
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    You are a genius.

    edit:
    Markus typecast I used:
    Simba Code:
    program new;

    type
      Node = record
        value: String;
        next: pointer;
      end;


    var
      n1,n2:Node;

    begin
      n1.value := 'tada';
      n2.value := 'hoi';
      n1.next := @n2;

      writeln(Node(n1.next^).value);
    end.
    Last edited by masterBB; 03-26-2012 at 05:36 PM.
    Working on: Tithe Farmer

  9. #9
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    You are a genius.

    edit:
    Markus typecast I used:
    Simba Code:
    program new;

    type
      Node = record
        value: String;
        next: pointer;
      end;


    var
      n1,n2:Node;

    begin
      n1.value := 'tada';
      n2.value := 'hoi';
      n1.next := @n2;

      writeln(Node(n1.next^).value);
    end.
    Thanks everyone. Code works like a charm!
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

Thread Information

Users Browsing this Thread

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

Posting Permissions

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