How to make a word as decimal in if then else statement


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    8

    Default How to make a word as decimal in if then else statement

    Hello there!

    I'm pretty new here and pretty new with PICBasic, but I can tell you, I love it to work with it. Maybe my english is not so good but I'm doing my best!

    Some problems I see in my programming but i can't fix them...

    I need to know how to use a WORD in a DECimal If then Else statement. I've seen that "if DEC name = ...." wil absolutely not work. "If @name = ..." doens't work eather.

    Can anyboody tell me how i can solve this problem so i can go futher?

    Thanks a lot.

    Cheers.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Your question is not so clear ...

    so : could you post the line ( or snippet ) you try to write and which doesn't work or compile ???

    I think you try to test CHARACTERS in a string ... but can you confirm ?

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Jan 2011
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Thanks for replying...

    Well. Thiis will work but reply's on LCD as a ASCII code:

    Code:
    Print at 2, 1, Temp ; Read temp from a dS1820
    and this will works to convert the ASCII code to a normal celcius:

    Code:
    Print at 2, 1, DEC Temp ; Read temp from a dS1820
    Now i want to do an if then else statement on the Temp var. If I only take this code:

    Code:
    IF Temp = ... THEN
    the Temp var will only reads the ASCII code, but I want the source to read the celcius in the if statement, and not the ASCII code...

    I hope this makes it clearer.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Are you sure you posted on the right forum ???

    I'm not ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Jan 2011
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    I am not sure... As I said... my english is not really good :P But if somebody can move it for me.. please

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jeroeni View Post
    I am not sure... As I said... my english is not really good :P But if somebody can move it for me.. please
    Are you using Pic Basic (PRO) ?
    Dave
    Always wear safety glasses while programming.

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