Zmodem commented on a Page, drive properties  -  Sep 10, 2008

You've still got the drive being set globally, basically due to not inferring the var function before it. All you really need to do is move the variable up after the first declared local variable, adding a comma of course.

Suggestion: How about double-clicking a line in the listbox sends the line to your clipboard?

You can also save line and spaces, and also clean up the code, by grouping the dialog events into one event. Here's the new event, all you would need is to replace the other on dialog events with just this one (with the clipboard thing added):

on *:dialog:drive.properties:*:*: {
  var %d = $dname, %e = $devent, %i = $did
  if (%e == init) { did -b %d 4 }
  if ((%e == edit) && (%i == 3)) { did - $+ $iif($disk($did(3)),e,b) %d 4 }
  if ((%e == sclick) && (%i == 4) && ($disk($did(3)))) {
    var %a = did -a drive.properties 5, %drive = $did(drive.properties,3)
    did -r drive.properties 5
    %a Listing %drive Properties
    %a ------------------------
    %a Path: $disk(%drive).path
    %a Type: $disk(%drive).type
    %a Label: $disk(%drive).label
    %a Size: $bytes($disk(%drive).size,g) Gbs
    %a Free: $bytes($disk(%drive).free,g) Gbs
  }
  if ((%e == dclick) && (%i == 5)) { clipboard $did(5,$did(5).sel) }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.