Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weirdness 3
#6
Does this work for you?

It crashes for me.

I seem to have crashes if I use @ anywhere.

I also can't seem to get logical operators to work properly. This code has both (but the crash prevents me testing the AND)

Oh, yes, - the strings. I couldn't seem to find a convenient way of putting in a 0 byte to null terminate them. I didn't really want to put in DEFB "string" and then DEFB 0 each line. So they are 48 [ascii zero] terminated instead Wink

Code:
teams:
asm
DEFB "Arsenal0"
DEFB "Aston V.0"
DEFB "Brighton0"
DEFB "Coventry0"
DEFB "Everton0"
DEFB "Ipswich0"
DEFB "Liverpool0"
DEFB "Luton0"
DEFB "Man.City0"
DEFB "Man.Utd0"
DEFB "Norwich0"
DEFB "Notts.F.0"
DEFB "Swansea0"
DEFB "Spurs0"
DEFB "Watford0"
DEFB "West Ham0"
DEFB "Blackburn0"
DEFB "Bolton0"
DEFB "Cambridge0"
DEFB "Charlton0"
DEFB "Chelsea0"
DEFB "Crystal P.0"
DEFB "Derby Co.0"
DEFB "Fulham0"
DEFB "Grimsby0"
DEFB "Leeds0"
DEFB "Middlesbro0"
DEFB "Newcastle0"
DEFB "Oldham0"
DEFB "Q.P.R.0"
DEFB "Rotherham0"
DEFB "Sheff.Wed0"
DEFB "Bradford0"
DEFB "Brentford0"
DEFB "Bristol R.0"
DEFB "Cardiff0"
DEFB "Doncaster0"
DEFB "Exeter0"
DEFB "Lincoln0"
DEFB "Millwall0"
DEFB "Newport0"
DEFB "Orient0"
DEFB "Oxford0"
DEFB "Plymouth0"
DEFB "Preston0"
DEFB "Reading0"
DEFB "Southend0"
DEFB "Walsall0"
DEFB "Blackpool0"
DEFB "Bury0"
DEFB "Colchester0"
DEFB "Crewe0"
DEFB "Darlington0"
DEFB "Halifax0"
DEFB "Hartlepool0"
DEFB "Hereford0"
DEFB "Hull0"
DEFB "Mansfield0"
DEFB "Port Vale0"
DEFB "Rochdale0"
DEFB "Scunthorpe0"
DEFB "Stockport0"
DEFB "Torquay0"
DEFB "York City0"
end asm
teamsEnd:

PRINT "Hello World"
PRINT @teams

FUNCTION getTeam(teamNum as uInteger) as String
    DIM var as uInteger
        let var=@teams
    DIM loopy, currentChar as uByte
    DIM stringBuild as String

    WHILE (teamNum AND var < @teamsEnd)
        IF PEEK var <>48 THEN:
            LET var=var+1
        ELSE
            LET teamNum=teamNum-1
            LET var=var+1
        END IF
    END WHILE
              
    WHILE peek var <> 48
        LET stringBuild$=Stringbuild$+CHR$(peek var)
        LET var=var+1
    END WHILE
    
    return stringBuild$
END FUNCTION
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)