PDA

View Full Version : Very slowly works with strings


relo
10-17-2007, 05:36 AM
Very slowly works with strings.
There is a dim from 5000 lines, a simple cycle of check borrows about 3 seconds.

dim(words_spr$, 9000);
words_count$=5000;
game_nastr.wordin$="GAME";

cn_p$ = false;
for (i$, 0, words_count$)
s$ = upper(words_spr$[i$]);
if (s$ == game_nastr.wordin$)
cn_p$ = true;
break;
end;
end;


How it is possible to accelerate such check?

PointOfLight
10-17-2007, 09:55 PM
Were you doing this on a PC or PPC?* I just tried the program on my PC, and put a messagebox in at the end of the loop, and the messagebox pops up almost immediately after it's done compiling.

PointOfLight
10-17-2007, 09:59 PM
Well, I answered my own question.* It was a PPC problem.* Don't know why it does what it does, but here's a solution:

s$ = words_spr$[i$];
s$ = upper(s$);

For some reason, it seems a lot happier doing a call to upper on a regular variable than on an array element.

kornalius
10-17-2007, 11:34 PM
I will look into this one, it should be slower normally.

relo
10-18-2007, 08:17 AM
ok

relo
10-23-2007, 11:53 AM
reading string problem. :)

kornalius
10-23-2007, 01:43 PM
Relo, I have fixed the problem in 1.40 beta 1.