
alias synonymes {
  dialog -m synonymes synonymes
}

dialog synonymes {
  size -1 -1 300 340
  title Systeme De Synonymes Par Dj Dgé
  button "Fermer",1, 5 315 285 20, cancel
  text "Le Mot",2, 10 20 50 20
  box "",3, 5 3 285 80
  edit "",4, 50 15 230 20, autovs, autohs
  button "Lancer",5, 10 55 100 20
  edit "Attente De Connexion",6, 130 55 150 20, read
  edit "",7, 5 100 285 200, multi, return, autovs, autohs, vsbar, hsbar

}

on *:dialog:Synonymes:sclick:5: {
  set %Synonymes $did(4)
  did -ra Synonymes 6 Connexion en cours...
  sockopen Synonymes elsap1.unicaen.fr 80
}

on *:sockopen:Synonymes:{
  sockwrite -n Synonymes GET http://elsap1.unicaen.fr/cgi-bin/trouveter?refer=%23&requete= $+ %synonymes $+ &Envoi=OK  $crlf $+ $crlf
  did -ra Synonymes 6 Connexion Effectué
}

on *:sockread:Synonymes:{
  if ($sockerr > 0) { return }
  :nextread
  sockread %temp
  if ( color="#FF0000" align="left"> isin %temp ) { did -a Synonymes 7 $remove(%temp,color="#FF0000" align="left">,</td>,</TR>,<TR>,<TR height=8><TD><font size=-1>,</font>,<hr noshade size= width=,0,1,2,3,4,5,6,7,8,9,<td width=>,<hr noshade size= width=)  $+ $crlf }

}
