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,988 of 11,847   
   Kim Ahmad to All   
   Reading the optional fields in MPL   
   26 Jul 22 11:25:36   
   
   From: irfon.ahmad@gmail.com   
      
   I'm attempting to read the optional user fields from an MPL script, but while   
   I have it "working", the way I'm doing it is exceedingly kludgey and there are   
   still issues. It was suggested on Reddit that I might be running into a bug. I   
   wonder if someone    
   can enlighten me.   
      
   So, paring the script down to just the relevant bit, I expected to be able to   
   use something like this:   
      
   Uses User   
   While GetUser(CurrentUser) Do Begin   
      Writeln(UserOpts[1])   
   CurrentUser:= CurrentUser+1   
   End   
         
   In order to display a list of the 2nd optional field for all users. However,   
   no matter what index I put into UserOpts[1], I get fairly muddled results.   
   UserOpts[7] gives me the 2nd user field with the first five characters cut   
   off. Eventually I wound up    
   using this:   
      
     Writeln(copy(striplow(UserOpts[0]),2,length(striplow(UserOpts[0]))-1))   
      
   The reason I went with that is that polling UserOpts[0] reliably included the   
   entire second optional field but with a bunch of garbage ahead of it, and that   
   was my kludgey way of working around that.   
      
   The continuing issues, though: If someone edits their entry for the optional   
   field to something shorter, the data past the end remains. So if that field   
   contained abcdef and I changed it to xyz, then ran the script, for that user   
   it would become xyzdef.    
   If I open users.dat in a hex editor and zero out the offending characters it   
   fixes it, but this is clearly not how I'm supposed to be doing any of this. :)   
      
   Is there another way I should be indexing into the UserOpts array? Or is there   
   a bug in how the script is retrieving the data? Any ideas?   
      
   --- 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