Include Files for some Routines


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637

    Default Include Files for some Routines

    Hi all,

    If the feature that I'm wishing for is already available in PBP, then my apologies .

    In one of the projects that I'm currently working on there is a long initialization procedure (~200 lines of code) for a TFT display that I must include in my PBP main program. Then, I was thinking that it would be very nice if I could do something similar to

    Code:
    INCLUDE "modedefs.bas"
    For example, something like

    Code:
    INCLUDE "MyTFT_Init.bas"
    Then, I would call the routine in this "MyTFT_Init.bas" file to initialize my TFT display and that way I don't need to have this long procedure taking up space in my main PBP program. I know some C language, but I don't know any assembly.

    Is this feature that I'm wishing for already available in PBP? Can I create a routine in another BAS file and call it from my main PBP program?

    Thank you all for your ideas and comments. Sincerely,

    Robert
    Last edited by rsocor01; - 22nd April 2010 at 01:29. Reason: spelling

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rsocor01 View Post
    it would be very nice if I could do something similar to

    Code:
    INCLUDE "modedefs.bas"
    For example, something like

    Code:
    INCLUDE "MyTFT_Init.bas"
    Then, I would call the routine in this "MyTFT_Init.bas" file to initialize my TFT display and that way I don't need to have this long procedure taking up space in my main PBP program. I know some C language, but I don't know any assembly.

    Is this feature that I'm wishing for already available in PBP? Can I create a routine in another BAS file and call it from my main PBP program?

    Thank you all for your ideas and comments. Sincerely,

    Robert
    You bet Robert, it is already available in PicBasic.

    You can add any code you want as an include. Normally they are named .inc, .bas, or .pbp. Just like in pbp, you can use PicBasicPro, or assembly in the include files.

    Here is a detailed thread about include files: http://www.picbasic.co.uk/forum/showthread.php?t=2400

    Walter

  3. #3
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default

    scalerobotics,

    Thank you for your reply. I will take a look at the thread you mentioned in your post.

    Robert

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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