Shop OBEX P1 Docs P2 Docs Learn Events
Why can't I get away with this? — Parallax Forums

Why can't I get away with this?

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2011-01-22 16:02 in Accessories
r := sdfat.popen(string("games.csv"),"r")  
      repeat
        r := sdfat.pgetc
          if r < 0
             StringSend(0, 13) 
             quit
          if r > 0
             StringSend(0, r)
             'pst.char(r)


Naturally this is at root of reading a file from SD and displaying it.

I'm sure I should be thinking about this different somehow, but I've never worked "backend" of a webserver.

OBC

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-01-22 16:02
    Bah!

    Just needed to think about it out loud.. (thanks for listening..) <SMIRK>
          x:=0
          bytefill(@mydata,0,150)
          
          r := sdfat.popen(string("games.csv"),"r")  
    
          repeat 
            r := sdfat.pgetc
            
              if r < 0
                 'StringSend(0, 13) 
                 quit
                 
              if r > 0
                 mydata[x]:=r
                 x++
    
              if r == 44
                 StringSend(0, @mydata)
                 'Stringsend(0,string("***",CR,CR))  
                 bytefill(@mydata,0,150)
                 x:=0
    
Sign In or Register to comment.