Advertisement
delysio

Błąd w pętli

Dec 6th, 2020
1,303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.75 KB | None | 0 0
  1. program test;
  2.  
  3. uses atari, crt;
  4.  
  5. var
  6.     tmpByte : byte;
  7.     tmpByte2: byte;
  8.     tmpByte3: byte;
  9.     data    : string;
  10.  
  11. begin
  12.  
  13.     data := ':delysio!~delysio@130xe.atari.org.pl PRIVMSG testttt :TESTINK';
  14.     tmpByte := 38;
  15.  
  16.     for tmpByte2 := tmpByte + 9 to 100 do
  17.     begin
  18.         if data[tmpByte2] = ':' then break
  19.     end;
  20.  
  21.     Writeln('tmpByte2 = ', tmpByte2); // Tu jest zero - chyba źle ;)
  22.  
  23.     for tmpByte2 := (tmpByte + 9) to 100 do
  24.     begin
  25.         Inc(tmpByte3); // W sumie może tu być cokolwiek, byle coś było zamiast samego if then break
  26.         if data[tmpByte2] = ':' then break
  27.     end;
  28.  
  29.     Writeln('tmpByte2 = ', tmpByte2); // A tu jest tyle ile być powinno, czyli 52 :)
  30.  
  31.     repeat until keypressed;
  32.  
  33. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement