Results 1 to 9 of 9

Thread: uses clause

  1. #1

    uses clause

    www.midletpascal.com seems to have exceeded their bandwidth .

    So am I right in thinking that in MP, the only "uses" units are Java classes? I can't seem to find a way to use a simple particle.pas unit that I want to use.

    Any ideas?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  2. #2

    uses clause

    I haven't tried MP at all yet, but what about the good old {$I File} method. Seems that while most low end compilers don't support Uses directly they all support include files.

    PS: Savage or Will could you please put your two cents in on: http://www.pascalgamedevelopment.com...pic.php?t=3040 I'm quite worried that my goals and current target don't fit the contest goals, it also seems that others are moving along the same route I am.

  3. #3
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    uses clause

    As far as I know you cannot include an existing unit but have to create a new unit and paste all the stuff you want into it. If I remember correctly there was a wishlist item to import existing files.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  4. #4

    uses clause

    Quote Originally Posted by cairnswm
    but have to create a new unit and paste all the stuff you want into it. If I remember correctly there was a wishlist item to import existing files.
    Ah ok, just found the "new source file" option. Better than nothing I suppose.

    Quote Originally Posted by jdarling
    but what about the good old {$I File} method.
    I don't think MP supports include files. It can't even do compiler directives yet.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  5. #5

    uses clause

    I think that "uses unit.pas" is not pascal optimized and are working as C include file.

  6. #6

    uses clause

    Btw, I can add uses particle; to my main source file and it compiles. But if I try and reference a procedure/function that exists in the particle.mpsrc file the compiler/IDE complains .
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  7. #7

    uses clause

    The MP site is still offline.

    Has anyone managed to get uses clause and their respective function/procedures working?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  8. #8
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    uses clause

    I create a new project called TEST.

    Went to Project - New Source File
    - Names the file TestUnitOne
    Modified the file as follows:

    Code:
    unit TestUnitOne;
    
    interface
    	&#123; add public declarations here &#125;
    	Procedure WriteHeading;
    
    implementation
    	&#123; add unit functions & procedures here &#125;
    	Procedure WriteHeading;
    	  Begin
    	    DrawText&#40;'HEADING',10,10&#41;;
    	  end;
    
    initialization
    	&#123; add initialization code here &#125;
    end.
    Went back tot he main file and modified it as follows (Uses clause and drawtext line):

    Code:
    program Test;
    
    Uses
      TestUnitOne;
      
    begin
    	WriteHeading;
    	repaint;	
    	delay&#40;2000&#41;;
    end.
    Seems to work fine.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  9. #9

    uses clause

    Don't worry it was me being a dufus. Silly typing error on my part. Thanks, I got it working.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

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
  •