home *** CD-ROM | disk | FTP | other *** search
/ Computerworld Gratis 30 Hours of Connection / Image(2).iso / infovia / win31 / genteach.wt_ / genteach.wt
Text File  |  1995-07-15  |  2KB  |  110 lines

  1. <* 
  2. *>
  3. :(mm,#!,()) 
  4. :(o,,(
  5. <**************************>
  6. <* GENTEACH Common Macros *>
  7. <**************************>
  8. ))
  9.  
  10. :(s,teach.)
  11.  
  12. :(mm,#!,(    :(o,,<* Process TRAC return codes *>)
  13. ))
  14.  
  15. :(o,,(
  16. <***************************************************************>
  17. <* Get input until recognized prompt or until timer expires      *>
  18. <***************************************************************>
  19. ))
  20. :(mm,teach.iwt2,(
  21.     :(s,<0>retval)        <* Reset the return value *>
  22.     :(s,<0>timer,:(xcm))    <* Reset timer *>
  23.     :(s,<0>prompt,(<1p>))
  24.  
  25.     <* Loop until we find a prompt *>
  26.     :(pcd,(
  27.         :(s,<0>retval,:(r,<0>retval):(i2))    <* Get data *>
  28.  
  29.  
  30.         :(s,<0>ptest,:(r,<0>retval))
  31.  
  32.         :(tsd,<0>ptest)                <* go to end *>
  33.         :(s,<0>ptest,:(pc,(
  34.             :(tai,:(tn,<0>ptest,-1,(:(px))),!,,
  35.                 (:(tnd,<0>ptest,1):(tpb,<0>ptest):(pr,0)))
  36.         ),-1))
  37.  
  38.         <* Crop if needed *>
  39.         :(agi,:(tl,<0>ptest),:(tl,<0>prompt),(
  40.             :(tps,<0>ptest,:(as,:(tl,<0>ptest),:(tl,<0>prompt)))
  41.                 :(s,<0>ptest,:(tpe,<0>ptest))
  42.         ))
  43.  
  44.         <* Exit if match found *>
  45.         :(ttci,<0>ptest,:(r,<0>prompt),(:(px)))
  46.  
  47.  
  48.         :(ei,<2>,,,(
  49.             <* Timer expired *>
  50.             :(agi,:(as,:(xcm),:(r,<0>timer)),0<2>,(
  51.                 :(px)
  52.             ))
  53.         ))
  54.     ),-1)
  55.  
  56.     :(r,<0>ptest)
  57.  
  58.     :(d,<0>timer,<0>retval,<0>ptest,<0>prompt,<0>temp,<0>sflag,<0>tchar)
  59. ))
  60.  
  61. :(o,,(
  62. <***************************************>
  63. <* Code to handle unrecognized prompts *>
  64. <***************************************>
  65. ))
  66. :(mm,teach.help,(
  67.     :(s,<0>response,:(win_prompt,(How should I respond to "):(r,
  68.         <1>)("?),,,(Abort this script.),(Ignore this prompt.)))
  69.     :(pc,(
  70.         :(ei,:(r,<0>response),(Abort this script.),(
  71.             :(g)
  72.         ))
  73.         :(ei,:(r,<0>response),(Ignore this prompt.),(
  74.             :(px)
  75.         ))
  76.         :(win_sendkeys,:(r,<0>response)(<Enter>))
  77.     ),1)
  78. ))
  79.  
  80.  
  81. :(o,,(
  82. <******************************>
  83. <* Retrieve the user's userid *>
  84. <******************************>
  85. ))
  86. :(mm,teach.username,(
  87.     :(ei,:(win_username),,(
  88.         :(win_username,:(win_prompt,(Enter your username:)))
  89.     ))
  90.     :(win_username)
  91. ))
  92.  
  93. :(o,,(
  94. <********************************>
  95. <* Retrieve the user's password *>
  96. <********************************>
  97. ))
  98. :(mm,teach.passcode,(
  99.     :(ei,:(win_passcode),,(
  100.         :(win_passcode,:(win_prompt,(Enter your password:),*))
  101.     ))
  102.     :(win_passcode)
  103. ))
  104.  
  105. :(o,,(
  106. <*********************>
  107. <* END Common Macros *>
  108. <*********************>
  109. ))