typestar

Reading a control in Igor Pro

ControlInfo asks a control what it holds, without keeping a copy yourself.

Function ReadPanel()
    ControlInfo/W=AnalysisPanel thrSet
    Variable threshold = V_value

    ControlInfo/W=AnalysisPanel waveSel
    String chosen = S_value

    ControlInfo/W=AnalysisPanel smoothChk
    if (V_flag == 0)
        Print "no such control"
        return -1
    endif

    Printf "%s at %g, smoothing %d\r", chosen, threshold, V_value
    return 0
End

How it works

  1. It fills V_value, S_value and S_dataFolder in the local scope.
  2. V_flag says what kind of control it found, or zero for none.
  3. It is the way to read one control from another control's action.

Keywords and builtins used here

The run, in numbers

Lines
16
Characters to type
317
Tokens
50
Three-star pace
90 tpm

At the three-star pace of 90 tokens a minute, this run takes about 33 seconds.

Type this snippet

Step 1 of 5 in Wiring it up, step 13 of 18 in Panels & GUI.

← Previous Next →