Raised This Month: $ Target: $400
 0% 

[ Solved ] with code that change 1 letter


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-18-2014 , 07:22   Re: Help with code that change 1 letter
Reply With Quote #6

If the error only occurs in the replace funciton then it is likely because Rletter is not a valid string. Make it a valid string (dimension it as with 2 cells).

However, it would be better to completely eliminate Rletter and any formats. Simply use the Chars[random(sizeof(Chars))] in the containi() function (make sure that it is an array of strings and not characters; I can't tell if you have the correct structure or not based on the code that you have given).

This still leaves the possibility of an infinite loop so you would want to put in a timeout. Alternatively, you can find a "only once random function" so that you will be able to know that you hit each letter at least once. This means your loop will have a maximum number of executions (you probably would use a for loop with a break in this case).
__________________
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode