Silverfrost Forums

Welcome to our forums

Using multiple %ww to set options

2 May 2020 5:22 #25322

I had a curiosity.

Can you place separate %ww's with different options for the same window? It appears that 2 (or more?) %ww's can occur (unlike some other commands). I was unsure that the options would be used on %ww's after the first. It would appear to be so; just checking.

It would be very useful to apply some window options (like [independent] or [topmost]) outside of some window preamble function.

2 May 2020 8:11 #25323

Of course. You can divide your WINIO@ statements across many calls, and put the %ww in its separate forms in an IF THEN ELSE sequence, as in:

      IF (NOPT .EQ. 1) THEN
      IA = WINIO@('%ww[independent]&')
      ELSE IF (NOPT .EQ. 2) THEN
      IA = WINIO@('%ww[topmost]&')

and so on. You can also splice in things into the WINIO@ format string.

      IA = WINIO@('%ww['//whatever you want//']&')

There are probably other ways too.

Eddie

3 May 2020 2:40 #25324

Eddie, your second example is something I have been using for quite a while.

Some (most?) format codes are not allowed to appear twice. Some are, but syntactically, they must differ (%sc comes to mind). Some require additional information in the same line (syntax rules for menu items). Others have loose rules; for example, you can have two menu items that refer to the same shortcut key sequence, but no error generated.

It would make some sense that a %ww with it numerous arguments could be split across multiple lines. Your first example is NOT what I was looking for. The syntax would be more like:

    i = winio@('%ww[independent]&')
.
.
.
.
    i = winio@('%ww[topmost]&')

Granted, in this simple example, it would make more sense to have it all in one line. Just imagine for a moment that the first statement is in a routine that creates a preamble to a window (with standard menu items, accelerator keys, %sc callbacks, etc.) and the second line is in the routine that requires this window have topmost status. Rather than complicating the situation with mostly unused arguments in the preamble call, just place the specific calls needed in the original module.

A bit different that your example.

3 May 2020 7:20 #25325

Bill

Yes, you can use %ww more than once within one winio@ continuation sequence and the options will be combined in the order that they are presented. So if an option conflicts with an earlier option then the latter will apply.

Please login to reply.