Issue with long var types


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    7

    Default Issue with long var types

    Hi all,
    I am starting a new project using pic18F47J53 and thought I would try long vars rather than using div32. Compiler version is PBPX 3.0.8.4, on Win7 64 bit laptop, I have selected "use compiler long words" in options and my test code compiles successfully and the result shows long variable types have been used.
    However my variable sent to debug only increments to 64k (65536) and then rolls over. Even initializing a long var with a number above 64k and sending to debug will not work.
    I have tried various pic settings including setting the extended instruction set of pic on/off etc. all no good.
    Any suggestions would be appreciated.
    Cheers.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Issue with long var types

    Hi,
    I seem to remember an issue with LONGs when using # vs DEC where one would work while the other didn't. Make sure you try both.

    /Henrik.

  3. #3
    Join Date
    May 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Issue with long var types

    Hi Henrik,
    great call, using DEC works fine. Who would have thought?
    Thanks mate.
    Steve

Similar Threads

  1. VAR array compile issue
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th March 2012, 13:47
  2. Constant data types
    By The Master in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2008, 13:43
  3. LONG var, conditional invert sign
    By dcorraliza in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th May 2008, 19:47
  4. Code Issue - select case or 'if' issue - not sure why
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2007, 08:52
  5. calculate var Byte's and var Word's
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 31st October 2005, 09:29

Members who have read this thread : 0

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