This affects the beta versions and also the official version 7.84.

When the dialog box opens, return the text (optional).

When we place the mouse cursor in the edit box and leave it empty, clicking OK return the text (optional).
Code
alias test { dialog -m test test }

dialog test {
  title ""
  option pixels
  size -1 -1 306 95
  text "Enter the text:", 1, 14 12 280 16
  edit "", 2, 10 32 290 21, autohs optional
  button "&OK", 3, 142 65 76 23, ok default
  button "&Cancel", 4, 223 65 76 23, cancel
}
on *:dialog:test:*:*:{
  if ($devent == init) { did -f $dname 1 }
  elseif ($devent == sclick) && ($did == 3) { echo Return: $did(2) }
  elseif ($devent == edit) && ($did == 2) { echo Return: $did(2) }
}

I found this bug after encountering several variables that, when empty, contained the text (optional).

Last edited by TECO; 22/08/26 01:04 PM.

TECO
irc.PTirc.org (Co-Admin)