Case...of - function

kwbburmeisterkwbburmeister Member Posts: 15
Hello everyone!

I've got a question concerning the "Case...of"-function (and sorry, I searched the forum, but I didn't find anything matching):

I'm using a function, giving return-values dependent on the country code of a customer. E.g. for 'DE' give me '002', for 'NL' give me '003'. How can I give a general return value for all countries not covered in the "Case...of"-function? E.g. "All other countries" := '099'?

Thank you very much for your help!

Sascha

Comments

  • vijay_gvijay_g Member Posts: 884
    Add a field in Country Table name "Country Code" and based on this field return value.
  • SogSog Member Posts: 1,023
    Altough I encourage you to use the solution of vijay_g the case else statement in C/AL is case else:
    case Country of
      'DE':exit('002');
      'NL':
        begin
          exit('003');
        end;
      else
        begin
          exit('099');
        end;
    end;
    
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • kwbburmeisterkwbburmeister Member Posts: 15
    Thank you very much. You helped me perfectly... ;-)
Sign In or Register to comment.