Search tips

apple banana
Find rows that contain at least one of the two words.

+apple +juice
Find rows that contain both words.

+apple macintosh
Find rows that contain the word 'apple', but rank rows higher if they also contain 'macintosh'.

+apple -macintosh
Find rows that contain the word 'apple' but not 'macintosh'.

+apple ~macintosh
Find rows that contain the word 'apple', but if the row also contains the word 'macintosh', rate it lower than if row does not. This is "softer" than a search for '+apple -macintosh', for which the presence of 'macintosh' causes the row not to be returned at all.

+apple +(>turnover >strudel)
Find rows that contain the words 'apple' and 'turnover', or 'apple' and 'strudel' (in any order), but rank 'apple turnover' higher than 'apple strudel'.

Find rows that contain words such as 'apple', 'apples', 'applesauce', or 'applet'.

"some words"
Find rows that contain the exact phrase 'some words' (for example, rows that contain 'some words of wisdom' but not "some noise words").

By continuing to use this site you agree to the use of cookies. For more information and to find out how to change this click here. Accept Cookies
Please enable cookies in your browser for this website.
Advanced search

Dynamical Access to Signal Names

Last updated: 2018-10-16

My signal names only differs in an index, like channel1, channel2, etc. Is it possible to access the different signal names dynamically in a script instead of accessing each signal with a separate command?


Yes, it is possible to access dynamically to the signals with the help of reference variables.

Here is an example:

function Function ()
  varref ref;
  int i;
  char signal[50];
  double sum;
  sum = 0;
  // loop over signals
  for (i=1; i<=3;i++)
    // loop over channel1, channel2 and channel3
    SPrint(signal, "channel%d", i);
    // assigning a signal to the reference
    XCPsim.GetVariableByName(ref, signal);
    // The reference behaves like a signal
    sum = sum + ref;
  return sum;

Article Options
Views: 827
Rate this article: