+or-


Closed Thread
Results 1 to 13 of 13

Thread: +or-

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Location
    Exeter, England
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Well, I thought it worked fine. Now having added actual code to my prgramme I can't get it to compile. It gives an error "bad expression or missing then" for the line with ABS in it:

    For word_no=0 to res_max
    if (abs(adval-id_res[word_no]))<=((id_res[word_no]*res_tol)/100) then
    answer=ok
    goto endsub
    endif
    next word_no

    Am I doing something stupid?


    Edit: It's alright. I just forgot how to do arrays!!!! Seems OK now.
    Last edited by moby; - 5th April 2005 at 11:51.
    Keep your motor running

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Moby,


    Moby>>if (abs(adval-id_res[word_no]))<=((id_res[word_no]*res_tol)/100) then

    I believe you have 1 too many parentheses <sp> on your if statement...
    lets divid it up a little ok??

    yours:
    if (abs(adval-id_res[word_no]))<=((id_res[word_no]*res_tol)/100) then

    Divided up:

    if (abs (adval-id_res[word_no]) ) <=((id_res[word_no]*res_tol)/100) then


    if you notice, your ending parenthises <sp> end before your less than or equal sign....
    It probably should look like this:
    if(XXXXX<=YYYY) then zzzz

    if ( abs(adval-id_res[word_no]) <=((id_res[word_no]*res_tol)/100) ) then

    Another format is
    if xxxxx<=yyyyy then zzzz

    if abs(adval-id_res[word_no]) <=((id_res[word_no]*res_tol)/100) then

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    Join Date
    Jan 2004
    Location
    Exeter, England
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Yes, I think that was another problem. It does seem to be working now.
    Thanks.
    Keep your motor running

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