Author Topic: Random number messing things up  (Read 1534 times)

bous006

  • Guest
Random number messing things up
« on: January 18, 2013, 11:49:42 am »
Hey,

I have an app that uses a random number generator to decide which value of a char[][] array to print out. The problem is, after 48 or so new prints nothing prints out and i have to restart the app completely to get any more output. if any one could help I would appreciate it greatly.

Thanks

ciuffolo

  • Guest
Re: Random number messing things up
« Reply #1 on: January 18, 2013, 12:08:22 pm »
Post your part of code, the Random() function isn't very hard to apply, maybe you are doing something wrong

bous006

  • Guest
Re: Random number messing things up
« Reply #2 on: January 18, 2013, 12:19:09 pm »


This is in the main:
RandomSetSeed(TimerGetMs());

and this is in a function:
char bleh[50][500] = ...                           // all the random stuff is here
   NoteSetVisible(bla,0);                     //instead of replacing text im just making one invisible                                                                                      then the next one visible
   NoteSetEditable(bla,0);                   //so they cant edit the note(but its not working)

   i = Random(50);                               // this is where i think the problem is
   bla = NoteAdd(60,120,200,300);
   NoteSetText(bla,bleh);

   NoteSetVisible(bla,100);

   more = ImageAdd("Images/More.png");
   ViewAdd(more,75,390,blehMix,0);

ciuffolo

  • Guest
Re: Random number messing things up
« Reply #3 on: January 18, 2013, 01:18:21 pm »
Ok, first, try to put it in OnTimer, and when the function is called?
Second, you set i like a random number, but where you use i?
Aren't you going to di something like that?
Code: [Select]
NoteSetText(bla,bleh[i]);

bous006

  • Guest
Re: Random number messing things up
« Reply #4 on: January 20, 2013, 12:26:40 pm »
I have the thing, i just didnt put it. And sadly the problem with using OnTimer is that i have multiple of the of the functions which all print out different things and they all have separate buttons for that. so im not exactly sure how to implement it
« Last Edit: January 20, 2013, 06:09:48 pm by bous006 »