home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.bbs.mystic      Mystic Sysops are mystical nerds...      11,847 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,419 of 11,847   
   g00r00 to All   
   Re: Issue with MPL script   
   07 Jan 22 15:29:26   
   
   From: nospam.g00r00@f215.n129.z1.fidonet.org   
      
    LW> I'm currently having a play around with MPL scripts (A46 Win32) and   
    LW> appear to have run into an issue regarding the 'KeyPressed/ReadKey'   
    LW> functions in the following code:   
      
   My first suggestion would be to update to the A47 release since I no longer   
   have the A46 code to make a fix if we do determine a bug exists.  It could be   
   something fixed in A47 as well.   
      
    LW>   gExitFlag := false;   
    LW>   repeat   
    LW>     write('|[X00|[Y00' + int2str(gCount));   
    LW>     gCount := gCount + 1;   
    LW>     if (keypressed()) then   
    LW>       begin   
    LW>         if ('q' = readkey()) then   
    LW>           gExitFlag := true;   
    LW>       end   
    LW>   until gExitFlag = true;   
      
   Assuming you're not trying to do more than what you're showing here you could   
   simplify this with a single line like:   
      
   Repeat Until OneKey('Q') = 'Q';   
      
   Or   
      
   Repeat Until UpCase(ReadKey) = 'Q';   
      
   In any case, if you are going to loop like you are there I would suggest   
   putting some minor delay in there so as to not blow up your CPU usage.  Maybe a   
   delay(10) at the bottom of the repeat loop.   
      
   ... Some people have no idea what they're doing, and are really good at it!   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca