This shows you the differences between two versions of the page.
fr:readbyte [2016/01/01 22:45] |
fr:readbyte [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== ReadByte ===== | ||
+ | ==== Format ==== | ||
+ | **readbyte**\\ | ||
+ | **readbyte**()\\ | ||
+ | **readbyte**(// | ||
+ | ==== Description ==== | ||
+ | Lit et retourne le prochain octet depuis un fichier. | ||
+ | Le fichier en question doit avoir été ouvert grâce à la fonction [[open|Openb]], | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | < | ||
+ | cls | ||
+ | f$ = " | ||
+ | |||
+ | print " | ||
+ | openb f$ | ||
+ | reset | ||
+ | for t = 1 to 20 | ||
+ | n = r() | ||
+ | print n+" "; | ||
+ | | ||
+ | next t | ||
+ | |||
+ | close | ||
+ | |||
+ | print " | ||
+ | openb f$ | ||
+ | while not eof | ||
+ | print readbyte()+" | ||
+ | end while | ||
+ | |||
+ | |||
+ | print " | ||
+ | seek 10 | ||
+ | while not eof | ||
+ | print readbyte()+" | ||
+ | end while | ||
+ | |||
+ | |||
+ | close | ||
+ | |||
+ | end | ||
+ | |||
+ | function r() | ||
+ | r = int(rand*256) | ||
+ | end function | ||
+ | </ | ||
+ | Affichera quelque cose comme : | ||
+ | < | ||
+ | nouveau fichier | ||
+ | 181 163 155 23 46 93 122 212 178 225 1 62 113 130 202 52 185 51 37 165 | ||
+ | ouverture et lecture | ||
+ | 181 163 155 23 46 93 122 212 178 225 1 62 113 130 202 52 185 51 37 165 | ||
+ | positionnement en 10 et lecture | ||
+ | 1 62 113 130 202 52 185 51 37 165 | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ==== Voir Aussi ==== | ||
+ | [[close|Close]], | ||