Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005
    Posts
    2

    Unanswered: Two actions, Single if statement

    Quick question. I'm trying to perform two actions in a single If statement in a formula. I would like to populate a local variable with test and also create a counter in a shared variable.

    shared numbervar CountError;
    local stringvar Atfault;
    if isnull({DataMachine.Length}) or {DataMachine.Length} = 0 then
    atfault := "Drill, ";
    CountError = CountError+1;

    This doesn't work for obvious reasons, but I can't seem to wrap my head on how to think around it. I could just create another if statement, but I was hoping to keep my code clean because I'm always having to change things around.

    Thank You

  2. #2
    Join Date
    Aug 2002
    Location
    Cambridge, England
    Posts
    47
    Put the statments in brackets:

    shared numbervar CountError;
    local stringvar Atfault;
    if isnull({DataMachine.Length}) or {DataMachine.Length} = 0 then
    (atfault := "Drill, ";
    CountError = CountError+1)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •