You'd think this would be faster, but NO!!!!!! [Resolved]
#4
(10-13-2022, 11:41 PM)Kernelpanic Wrote: Even if I can't describe it exactly right away, but actually it is clear.

Compare this in the For Loop:
Code: (Select All)
h = SCREEN(j, k + i)
    IF h = ASC(g.flagship) OR h = g.m_asc THEN
        IF h = ASC(g.flagship) THEN

With the:
Code: (Select All)
IF SCREEN(j, k + i) = ASC(g.flagship) OR SCREEN(j, k + i) = g.m_asc THEN
   IF SCREEN(j, k + i) = ASC(g.flagship) THEN
My feeling tells me it's better. I hope my feeling is not wrong.

To my good friend from Germany with uneven tan lines....

Yes, that code I posted is not the best. I hate to use this term, but I was "transitioning" into a SELECT CASE model, but before I got to that part, I noticed the horrible lag making the SCREEN() function into a variable created.

So, what am I really going to use in the program? This...

Code: (Select All)
FOR i = 0 TO LEN(a.ship) - 1
    SELECT CASE SCREEN(j, k + i)
        CASE ASC(g.flagship)
            ii = 1
            EXIT FOR
        CASE g.m_asc
            ii = 2
    END SELECT
NEXT

Thank, and as a side note, I'm not big on castles, but if I took my wife to Germany, she'd be more than happy to push my ass down that Alpine Coaster!

Pete
Reply


Messages In This Thread
RE: You'd think this would be faster, but NO!!!!!! - by Pete - 10-14-2022, 02:20 AM



Users browsing this thread: 13 Guest(s)