Search found 38 matches

by tsh73
Thu Jun 28, 2018 10:01 pm
Forum: Liberty BASIC Language
Topic: MOD speed
Replies: 6
Views: 2116

Re: MOD speed

So few interesting things I got from it 1) newer computer at my workplace works about 2x faster then my old home one But different constructs differ in speed gain 2) I was coding "getting digits from a number" as nn = 987654321 while nn d=nn mod 10 'print d nn=int(nn/10) wend That explains why MOD s...
by tsh73
Thu Jun 28, 2018 9:29 pm
Forum: Liberty BASIC Language
Topic: MOD speed
Replies: 6
Views: 2116

Re: MOD speed

My code had a bug, AND the idea of counting down from the largest possible integer is ridiculous. I still think idea is Ok. We need larges number - so first one that fits would work. The only problem is that it happens very-very afterwards... But how can one be CERTAIN that no nine-digit integer wi...
by tsh73
Wed Jun 27, 2018 9:52 pm
Forum: Liberty BASIC Language
Topic: MOD speed
Replies: 6
Views: 2116

Re: MOD speed

Jack, you program instantly (!) said What is the largest integer that contains all different, non-zero digits; and such that each digit is evenly divisible into the integer? The answer is 987654312 Program Completed. Now 987654312 surely not divisible by 5 so there are some errors in a program. As a...
by tsh73
Sat Jun 23, 2018 10:24 pm
Forum: Liberty BASIC Language
Topic: MOD speed
Replies: 6
Views: 2116

MOD speed

Hello all (a bit of long story) Recently there was a task posted at LB forum http://libertybasiccom.proboards.com/thread/241/challenge-easy-task-fast Basically, it lead me to writing a program with long calculation involving MOD I made some assumptions as to how to reduce search, and got right answe...
by tsh73
Sat Jun 09, 2018 7:14 pm
Forum: BASIC code examples
Topic: Some benchmarking about swapping two variables
Replies: 2
Views: 1423

Re: Some benchmarking about swapping two variables

>>'must be ODD !
LOL
;)

Thanks.
by tsh73
Thu May 17, 2018 10:01 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 41
Views: 11112

Re: Formatting Numeric Input

Just to say, it does about everything I would ask. Here I rewrote it without using ASCII codes (same number of lines really, but now I see "-" and "." in code ;) ) (Oh. And it uses GOTO as CONTINUE statement ;) ) function num$(d$) t = 0 for i=1 to len(d$) a$=mid$(d$,i,1) if a$="." then t = t + 1 if ...
by tsh73
Tue Apr 17, 2018 4:49 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 41
Views: 11112

Re: Formatting Numeric Input

I'm afraid that couldn't be done quite right. Do we have caret position (insertion point)? If not, how program could tell which dot is old and which new? Without that we only could remove one dot - first or last positionally, arbitrary choice to be made And insertion point will move to the end of cu...
by tsh73
Mon Apr 16, 2018 9:08 pm
Forum: General Board
Topic: I HAVE BEEN BANNED FROM THE LB FORUM!!!
Replies: 10
Views: 4480

Re: I HAVE BEEN BANNED FROM THE LB FORUM!!!

There are members of the LBB forum who are moderators on the LB Forum. Perhaps they would like to explain why I have been banned. (Here my view what happened, may be not 100% accurate, not official statement anyway) Current policy - more or less - is that mentioning LBB is prohibited. You have been...
by tsh73
Mon Apr 16, 2018 3:09 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 41
Views: 11112

Re: Formatting Numeric Input

I'm still puzzled by this code. What does "a=8" do? Just clears that code, in effect removing character? So almost anything besides 8 will do? (last line in effect allows only ".","-" and digits - so using anything else instead of 8 will do the same) Now, t1 is not used. Something is left? (kind of ...
by tsh73
Sat Apr 14, 2018 10:52 am
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 41
Views: 11112

Re: Formatting Numeric Input

about leading '0' and trailing '.'
I think it makes sense to fix on leaving the cell.
I don't know how this event could be hooked - but at least there is a way to check if cell has focus or not.
So if it doesn't have focus you can do extra check and change say '0025.' to '25' or '25.0'.