PulseOut problem

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
Paul Lamar
Posts: 65
Joined: 14 May 2010, 16:01 PM

PulseOut problem

Post by Paul Lamar »

I can't seem to get this to work.
What am I doing wrong?
Attachments
putpin.jpg
(39.15 KiB) Downloaded 1504 times
IMG_0499.JPG
(58.49 KiB) Downloaded 1507 times
IMG_0500.JPG
(115.18 KiB) Downloaded 1500 times
IMG_0505.JPG
(36.06 KiB) Downloaded 1497 times
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: PulseOut problem

Post by dkinzer »

Paul Lamar wrote:What am I doing wrong?
If you change the For/Next to a Do/Loop, I think it will work fine.

As written, the For loop executes zero times. The reason is that the range of an Integer is -32768 to 32767. In this particular case the compiler doesn't give you warning that the value of 50000 can't be represented in an Integer value. The resulting code executes as if you had written:

Code: Select all

For x = 1 to -15536
Next x
- Don Kinzer
Paul Lamar
Posts: 65
Joined: 14 May 2010, 16:01 PM

Post by Paul Lamar »

Thanks Don. Too bad. No out of range error.

I'll have to keep that in mind.I

Paul
Post Reply