Variable problem


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Thank you very much for the answer.

    Now I understand!

    You are the best!

    regards Pesti

  2. #2


    Did you find this post helpful? Yes | No

    Default

    hi

    Ok I try but I have a Problem!

    I have this :
    ML_Seconds Var Word [24]
    ML_Verz Var Word [24]

    Here is wrong too!

    Timer_Int:
    for M= 0 to 23
    ML_Seconds.lowbyte[M] = ML_Seconds.lowbyte[M] + 1
    Next M


    and now I must to compare this two Words

    for N = 0 to 23
    If ML_Seconds.lowbyte[N] => ML_Verz.lowbyte[N] Then ...
    Next N
    But I compare now just the lowest two Bytes,I need the word Data

    How I can do that ?!

    Thanks
    regards Pesti

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    ML_Seconds.lowbyte[M] = ML_Seconds.lowbyte[M] + 1
    Not sure what the problem is, but are you sure you don't really want to have:
    Code:
    ML_Seconds.lowbyte[M] =  ML_Seconds.lowbyte[ M + 1  ]
    And this:
    for N = 0 to 23
    If ML_Seconds.lowbyte[N] => ML_Verz.lowbyte[N] Then ...
    Next N
    But I compare now just the lowest two Bytes,I need the word Data
    Easy enough:
    Code:
    temp1 var byte
    temp2 var byte
    ....................
    temp1 = ML_Seconds.lowbyte[N]
    temp2 = ML_Verz.lowbyte[N]
    if temp1 => temp2 Then.....
    Next N

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Hi Skimask

    thanks

    Ok but what is when the value for ML_Seconds.lowbyte[N] is grater then 255 I must to compare the highbyte too!?

    How is that are the two bytes in a word connected,i mean that when i increase the value in my ML_Seconds[N] and the value is going out of 255 then increase the highbyte automatically or not?

    regards Pesti

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Jeeze...then don't limit your inital compare to just the lowbyte...use the whole thing...

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Jeeeze....Can not Help me ;-)

  7. #7
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default I can try to help

    But I am seriously confused... I understand you have a problem comparing variables

    and I gather you want to compare 2 words from a word array


    for N = 0 to 23
    If ML_Seconds(N) => ML_Verz(N) Then ...
    Next N


    this should give you the N word from your array

    /me
    Last edited by Jumper; - 30th May 2008 at 16:55.

Similar Threads

  1. EEPROM Variables (EE_Vars.pbp)
    By Darrel Taylor in forum Code Examples
    Replies: 79
    Last Post: - 26th October 2012, 00:06
  2. problem with variable on PIC10f202
    By Samoele in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th October 2009, 17:29
  3. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. Math Formula / Variable Problem! Help!
    By bwarp in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th February 2006, 07:59

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