Specifies the code to be executed when a For Each command or Xfor Each does not filter any record.
When None
<CodeWhenNone>
It is often necessary to execute a certain code when a For Each or Xfor Each does not filter any record.
To simplify the logic of the For Each and to provide more programming clarity, the command When None can be used.
It is important to clarify that if For Eachs are included within a When None, neither joins nor any type of filter will be inferred with respect to the For Each that includes the When None command.
Use of this clause is in the numbering procedure
For each
where NumCode = &code
&LastNum = LastNum + 1
LastNum = &LastNum
when none
&LastNum = 1
New
NumCode = &code
LastNum = &LastNum
EndNew
EndFor
In this example, you update the last number for the document specified by &code, If the record does not exist, you insert it in the table.
Commands: For each command (XEv2, XEv3), XFor Each, XFor First
For Each command - For Each command (XEv3)
XFor Each Command
XFor First Command