how can I peek a word value?
Blitz3D Forums/Blitz3D Programming/how can I peek a word value?| 
 | ||
| Trying to use the peek command but theres no word for it. I'm guessing to use PeekInt() to get a word, I'm not sure. | 
| 
 | ||
| How many bytes do you want to read: peekbyte, peekshort or peekint are all useful... | 
| 
 | ||
| trying to peek a word not a byte, rather two bytes. | 
| 
 | ||
| Two bytes -> PeekShort(). | 
| 
 | ||
| thanks for the info, I appreciate the help. one thing, about the FOR loop, the step command only takes constant values. How can I use a assigned variable? ex. range = 12 FOR b=0 TO length STEP range | 
| 
 | ||
| You can't, you'll have to redesign the loop as a While or Repeat. 
b = 0
While b <= length    ;Shouldn't this be < ?
    ...
    b = b + range
Wend
 | 
| 
 | ||
| It should be just "<" if you're starting from 'zero' (and you are: "b = 0"). If you started at '1' then you can let it get to the 'length' (which is always 1-based as well). Last edited 2011 | 
| 
 | ||
| Also, you can use this: const range=12 For b=0 to length STEP rangeOr this: For b_=0 to length/range b=b_*range | 
| 
 | ||
| What I do often is to run for..next as normal:  For k=1to 10 Next And then judt throw in k*range wherever k effexts what happens. Equivalent to "1to 10 Step range". Last edited 2011 Last edited 2011 | 
| 
 | ||
| Also, this: For b=0 to length print b b = b + range-1 Next |