Thread: flow control algo

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    12

    flow control algo

    hello,
    i do need to implement a counter to control the financial flow of funds.
    i need some help to find a good algo.i have double code in my algo which i want to get rid of.

    this is my algo

    if(! errorflag && messagetype != void)
    update the counter
    switch(messagetype)
    case void:
    storno.
    if(counter == counter)
    update the counter, set errorflag
    case transaction:
    transaction
    if(counter == counter)
    update the counter, set errorflag

  2. #2
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    Erm what is this meant to do:
    Code:
    if(counter == counter)
    ?

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    12
    this is the cross checking method. i need to compare the value of a terminal counter with an operator counter(my application).

  4. #4
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    Quote Originally Posted by Mr.Bit View Post
    this is the cross checking method. i need to compare the value of a terminal counter with an operator counter(my application).
    then you should name them differently. From that pseudo code it looks like you're comparing the same variable with itself...

    QuantumPete
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  5. #5
    Registered User
    Join Date
    Oct 2007
    Posts
    12
    you are right, im sorry to leave you confused!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. control flow question?
    By unix7777 in forum C++ Programming
    Replies: 2
    Last Post: 11-12-2008, 02:32 PM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. Replies: 6
    Last Post: 11-10-2005, 01:37 PM
  4. Bison, flex and flow control
    By Crashgr in forum Linux Programming
    Replies: 0
    Last Post: 07-20-2005, 04:00 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM