0

我有一个显示语句,如果逻辑为真,我只显示其中一个值。如何不显示列的标签(即空白)

 def var one as char label "one" no-undo.
 def var two as char label "two" no-undo.
 def var three as char label "three" no-undo.
 def var four as char label "four" no-undo.
 def var logic as logi no-undo init no.

 display  
   one
   two
   three
   four when logic
 with stream-io width 80.
4

2 回答 2

4
define variable one as character no-undo initial "xyz".
define variable two as character no-undo initial "123".

define variable f as handle no-undo.
define variable h as handle no-undo.

form
  one two
 with frame a
.

f = frame a:handle.

if two = "" then
  do:
    h = f:first-child.
    walk_tree: do while valid-handle( h ):
      if h:name = "two" then
        do:
          h:label = "x".
          leave walk_tree.
        end.
      h = h:next-sibling.
    end.
  end.

display
  one two
 with frame a
.
于 2013-07-23T18:54:38.703 回答
0

简单的方法:

def var a as char label "One"   init "AAA".    
def var b as char label "Two"   init "BBB".    
def var c as char label "three" init "CCC".    
def var logic as logical init false.

form a b c with frame a no-underline.    
if logic = false then c:label in frame a = "".    
display a b c when logic   with frame a.
于 2013-08-30T14:16:15.970 回答