Search found 16 matches
- Tue Sep 24, 2013 10:49 pm
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
Very nice and clear example. It explains the problem. Thank You.
- Tue Sep 24, 2013 8:32 pm
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
Thank You very much for all explanations, but this is unclear: ...As long as you do calculate your values in every iteration in a while loop you get no problems. As soon as you start to increment the value and check it for a expected end result you get problems because you cant increment and compare ...
- Wed Sep 18, 2013 9:05 pm
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
Now I completely do not understand what's going on. The problem and previous answers were clear: loop "For To Next" does not work with floats, because it could reduce the accuracy of calculations and the speed of loop. "For To Next" is reserved only for integers. If we want to use floats, we have to ...
- Wed Sep 18, 2013 7:19 pm
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
Oh, i just saw you didnt actualy step fractions, so whats the point of your benchmark?
Correct, but Thorium did not tell you why. A variable without type that is used for the first time in the program becomes automatically an integer type, that is, with the extension .i, and your variable x has no ...
Correct, but Thorium did not tell you why. A variable without type that is used for the first time in the program becomes automatically an integer type, that is, with the extension .i, and your variable x has no ...
- Wed Sep 18, 2013 5:31 pm
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
My result for third loop, 306 sec, was not the error of mine. I checked it several times, and I obtained the same results. But now after rebooting the computer, I run this code again, and received better result od 18.5 seconds. The 306 sec may look suspicious, but recently the similar situation was ...
- Wed Sep 18, 2013 10:14 am
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
Thank You charvista, for explanation and nice code. I run it on my laptop, and here are results:
1st loop 7.9 sec
2nd loop 18 sec
3rd loop 306 sec !!! No, I am not wrong, it is correct result in my case. First I thought, that my laptop freezed or seemd to calculate it forever, but after 306 seconds ...
1st loop 7.9 sec
2nd loop 18 sec
3rd loop 306 sec !!! No, I am not wrong, it is correct result in my case. First I thought, that my laptop freezed or seemd to calculate it forever, but after 306 seconds ...
- Tue Sep 17, 2013 8:28 pm
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
...In one of the many other threads it was due to speed and precision.
Basically, you get faster speeds and perfect precision using loops
such as While/Wend or Repeat/Until instead... Interesting problem. I compared the speed (cycle time) of two types of loops, using FreeBasic, JustBasic and ...
Basically, you get faster speeds and perfect precision using loops
such as While/Wend or Repeat/Until instead... Interesting problem. I compared the speed (cycle time) of two types of loops, using FreeBasic, JustBasic and ...
- Tue Sep 17, 2013 4:29 pm
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
I thank all of You for detailed and clear explanations! 
Now I understand reason to use only integers in the loops.

Now I understand reason to use only integers in the loops.
- Tue Sep 17, 2013 11:38 am
- Forum: Coding Questions
- Topic: For-Next loop with non integer values
- Replies: 49
- Views: 14657
Re: For-Next loop with non integer values
This problem also intrigued me and wondered. In some Basic's dialects (FreeBasic, JustBasic, LibertyBasic and probably in more) the simple, nice and clear loop, for instance
for i = 1 to 5 step 0.3
next i works fine. But in PureBasic is prohibited. I read about it, but I did not understand answers ...
for i = 1 to 5 step 0.3
next i works fine. But in PureBasic is prohibited. I read about it, but I did not understand answers ...
- Tue Aug 20, 2013 12:25 pm
- Forum: General Discussion
- Topic: Closed topic
- Replies: 1
- Views: 1171
Closed topic
Why had You closed this topic? http://www.purebasic.fr/english/viewtopic.php?f=7&t=44957&p=421952#p421952 I just posted a message about PureBasic, but what I wrote there WAS NOT MY OPINION. As a wrote, I am beginner in PureBasic and I can't discuss about it. Mentioned opinion was published at Polish ...
- Tue Aug 20, 2013 9:26 am
- Forum: General Discussion
- Topic: Promoting PureBasic
- Replies: 6
- Views: 2835
Re: Promoting PureBasic
I talked about PureBasic on the Polish discussion forum, dedicated to programming and different programming languages. One person said that this dialect is, at least in Poland, very unpopular and even niche. Below are a translated quote:
No demand for such a product. Who needs a language that ...
No demand for such a product. Who needs a language that ...
- Mon Aug 19, 2013 5:56 pm
- Forum: Coding Questions
- Topic: Console question
- Replies: 12
- Views: 1776
Re: Console question
Thank all of You very much for extended help ad support!
- Mon Aug 19, 2013 1:44 am
- Forum: Coding Questions
- Topic: Console question
- Replies: 12
- Views: 1776
Re: Console question
Thank You very much for the answer. Now the prime numbers are correctly shown on the screen (2, 5, 7, 11...), but when I opened the generated txt file, there are inside STILL weird symbols (i.e. ㄠ″㜱ㄠ‹㌲㈠‹ㄳ㌠‷ㄴ㐠″㜴㔠″㤵㘠‱㜶㜠‱㌷㜠), NOT prime numbers. Maybe it is a bug of PureBasic or my system?
- Mon Aug 19, 2013 12:00 am
- Forum: Coding Questions
- Topic: Console question
- Replies: 12
- Views: 1776
Re: Console question
Thanks for the answer. But weird symbols are still during n = 2000. And what can I use instead of debug command? Noto for debugger but for the console? I tried to use something like ReadString, but I obtain the error.
- Sun Aug 18, 2013 11:24 pm
- Forum: Coding Questions
- Topic: Console question
- Replies: 12
- Views: 1776
Re: Console question
First of all, many thanks for "TI-994A" for his answer and additional extended support.
I added a command to write calculated prime numbers to a text file, and it works almost fine. But there is a problem: the prime numbers are correctly calculated and stored in a file up certain values. But when I ...
I added a command to write calculated prime numbers to a text file, and it works almost fine. But there is a problem: the prime numbers are correctly calculated and stored in a file up certain values. But when I ...