Message: Is there a UI way to query if an alias is defined? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Is there a UI way to query if an alias is defined? 

Forum: (Graphical) User Interfaces
Date: 03 Feb, 2017
From: Michael H. Kelsey <Michael H. Kelsey>

I am working on a macro file to do some relatively complex geometry configuration, including computing values to be used for some of the dimensions. This macro file will depend on two "input" parameters which I would like to make optional. That is, I want to allow the user to set either of these parameters, but if they did not do so, I want to provide default values within my macro file.

In a shell script, I could do this by querying whether the given variable has been defined or not, e.g.,

  if (! $?SOMENAME) set SOMENAME = <default-value>

I don't see any way to do this in a macro file. I've looked at all of the /control/xxx commands. The obvious "/control/if" and "/control/doif" only handle numerical comparisons. But if I try substituting in one of my aliases, it will fail with an error:

  PreInit> /control/doif {BADALIAS} = 0. /control/echo BADALIAS is zero
  Alias <BADALIAS> not found -- command ignored
  command refused (600)

Is there any conditional like "if defined" that I could use for this purpose?

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Is there a UI way to query if an alias is defined?   (Makoto Asai - 03 Feb, 2017)
2 None: Re: Is there a UI way to query if an alias is defined?   (Makoto Asai - 03 Feb, 2017)
1 More: Re: Is there a UI way to query if an alias is defined?   (Michael H. Kelsey - 04 Feb, 2017)
(_ None: Re: Is there a UI way to query if an alias is defined?   (Makoto Asai - 04 Feb, 2017)
 Add Message Add Message
to: "Is there a UI way to query if an alias is defined?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]