dialog test {
  title "Test Dialog"
  size [color:blue]$calc($window(-1).w - 100)[/color] 0 [color:red]100[/color] 100
}
The 
blue test is calculating the X position by subtracting the 
width of the dialog from the width of the resolution (
$window(-1).w). The dialog should appear in the top right corner.
dialog test2 {
  title "Test Dialog (2)"
  size $calc($window(-1).w - 100) [color:green]$calc($window(-1).h - 100)[/color] 100 [color:orange]100[/color]
}
This dialog will open in the bottom right corner. The 
green text is used in this case to subtract the 
height of the dialog from the height of the resolution (
$window(-1).h).