View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sat May 02, 2020 6:22 pm Post subject: Using multiple %ww to set options |
|
|
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. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sat May 02, 2020 9:11 pm Post subject: |
|
|
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:
Code: | 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.
Code: | IA = WINIO@('%ww['//whatever you want//']&') |
There are probably other ways too.
Eddie |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sat May 02, 2020 10:24 pm Post subject: |
|
|
a nice technique Eddie but isn't that particular type of insertion likely to upset the status quo of your program structure ? _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sun May 03, 2020 3:40 am Post subject: |
|
|
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:
Code: |
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. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Sun May 03, 2020 8:20 am Post subject: |
|
|
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. |
|
Back to top |
|
|
|