![](templates/Classic/images/spacer.gif) |
Dasyr Newbie
Joined: 29 Jan 2016 Posts: 8
|
Posted: Thu Jun 09, 2016 11:31 am
CMUD & Windows |
Can someone see what I am doing wrong here?
I am attempting to make a window docked (I believe being the correct term according the the CMUD help files) inside my main window, this is the code I am using which works as intended in zMUD.
Code: |
#if %window(Communication)==0 {#MAKEW Communication open "scrolling=yes|internal=yes|align=top"} |
It wouldn't be a problem if this window wasn't docked if I could simply drag it to dock it as in zMUD, at one point I did so by dragging the window to some arrows which appeared in the middle of my main window but this is no longer working for whatever reason.
The main reason I forsook CMUD a few years ago in favour of zMUD was due to this general odd behaviour around windows.
EDIT:
Pinning my main window allowed me to dock my new window with the arrow method mentioned above but would still be interested to hear if there's something amiss with my command or another way makewindow can be used |
|
|
![](templates/Classic/images/spacer.gif) |
shalimar GURU
![](images/avatars/114658559147aeed8fee539.gif)
Joined: 04 Aug 2002 Posts: 4717 Location: Pensacola, FL, USA
|
Posted: Thu Jun 09, 2016 1:21 pm |
Your expression should be in parenthesis.
#if (%window(Communication)==0)
And I see no reason why the docking system would fail you now. |
|
_________________ Discord: Shalimarwildcat |
|
|
![](templates/Classic/images/spacer.gif) |
Vijilante SubAdmin
![](images/avatars/7230815434153eca6be3ad.gif)
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Jun 10, 2016 5:05 pm |
I believe the %window function returns null when the window does not exist. Any of the following would be correct:
#IF (!%window(Communications)) {...}
#IF (!(%window(Communications))) {...}
#IF (%window(Communications)="") {...}
#IF (%window(Communications)=="") {...}
CMud does not see "" and 0 as equivalent because it will convert the 0 to a string "0" which does not equal "". However the empty test does provide false on both zero and null and negation works fine.
It is almost impossible to have too many parenthesis, and it is a good habit to get into typing them. The time spent typing a few hundred extra pairs of parenthesis over thousands of lines is much less then the time it takes to find a bug because a==7&&b||c!=3 did not evaluate in the order you expected. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
![](templates/Classic/images/spacer.gif) |
Dasyr Newbie
Joined: 29 Jan 2016 Posts: 8
|
Posted: Fri Jun 10, 2016 6:45 pm |
Thanks guys,
The reason the ( ) are missing is because I was using { } in zMUD to encase my statement and had to remove them to get my scripts to work in CMUD, the if check evaluates as intended as it stands. |
|
|
![](templates/Classic/images/spacer.gif) |
|
|