I'm working on something that needs to enter items into a hash table if something else is busy. I've been just writing the que to a file and having the file just delete the first line once the que is used. But I figured I'd start trying out hash tables thanks to someone showing me how they actually work.

hashtable is quetest

If the @window is open, add item to the quetest table by number (found out that can't happen so i decided to try que"number". Once the @window is closed, it then reads the quetest hash table for the next text if any. Below is just a sample of getting it to work, im using @window because in the script i'm actually working on will be a picture window and the %text will be used with drawtext. The window will popup show the text then close after a certain amount of time, when closed it runs the command again to check if there are any ques, if so it sends the que to the text and pops the window up again. But I dunno how to accompish this with hash tables. I suppose what I need is a way to resort teh hash table once the first item is always deleted but I read on here on several posts that sorting hash tables is impossible.

Example:
Code:
alias quetest {
  var %text
  if ($window(@quetest)) { 
    ;write quetest.txt $1-
    hadd -ms quetest que $+ $calc($hget(quetest,0).item +1) $1- 
    halt
  }
  if (!$window(@quetest)) { 
    if ($hget(quetest,0).item != 0) {
      ;%text = $read(quetest.txt,1) | write -dl1 quetest.txt
      %text = $hget(quetest,que"numofoldestentry") | hdel -s quetest que"numofoldestentry"
    }
    else { %text = $1- }
  }
  if (%text) {
    window -k0 @quetest 2 2 200 200
    aline @quetest test %text
    timerwincloseqt 1 4 window -c @quetest
    timerchkquetest 1 5 quetest
  }
}


I hope that I explained what I'm wanting it to do, but my luck I probably confused everyone heh. Any help appreciated, thanks in advance.