Search found 53 matches

by RNBW
Thu May 31, 2018 11:03 am
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

We seem to have sorted out how to input numeric values into a single textbox with a validity check on each character as it is entered. So my next step is to enable this in a grid of textboxes. I had previously a solution that partially worked (it did not include entering a "0" before a decimal point...
by RNBW
Fri May 18, 2018 3:51 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

tsh73 Thank you for your help with the modification of the code to make it work. I must say it's a nice bit of code now and having seen the lines and lines of code elsewhere to produce the same or equivalent, it is very concise and saves a lot of error checking. All that it doesn't do is deal with a...
by RNBW
Wed May 16, 2018 6:09 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

@Alincon
No. _ES_NUMBER only allows the entry of characters 0 to 9. It does not permit minus or a decimal point.

However, if all you want to enter is characters 0 to 9 then it is fine and obviously saves a lot of code.
by RNBW
Sun May 13, 2018 9:14 am
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

I've resolved the "-." issue and I've added a larger font to make the display clearer. Just the zero(s) after the decimal point if the last character is "." '============================================== ' Numeric entry into a textbox. ' This permits the entry of numbers including ' "-" and ".". It...
by RNBW
Sat May 12, 2018 3:19 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

I've tried to resolve the display of -.123 to be -0.123 using the changes to the function num$(d$) as below, but it displays -00.123. How can this be resolved? function num$(d$) t = 0 for i=1 to len(d$) a=asc(mid$(d$,i,1)) if a = 46 then t = t + 1 if (a = 46) and (t > 1) then a = 0 'only DOT after F...
by RNBW
Sat May 12, 2018 10:18 am
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

The backspace character seems to be the cause of the problem with truncating the entered number if you subsequently edit it. As tsh73 says, almost any character has the same effect. chr$(77) is M, which doesn't seem to be the best to use, so I've plumped for chr$(0) which is NULL. So the following c...
by RNBW
Fri May 11, 2018 4:49 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

I've had a quick look at the code and I was surprised to find that tsh73 is correct and chr$(77) could be used rather than chr$(8) and it wouldn't make any difference. In fact just about anything could be used, but you have to use something, so I'm happy with chr$(8): it does have some logic to it o...
by RNBW
Sun May 06, 2018 11:05 am
Forum: General Board
Topic: I HAVE BEEN BANNED FROM THE LB FORUM!!!
Replies: 10
Views: 11073

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

Richard I come back from holiday and find that you have been banned from the Just Basic Forum. I echo your sentiments, particularly in view of my own experience with the Liberty Basic forum. Users of LB and JB should take note of what can happen. You can try to be helpful, but if they don't like the...
by RNBW
Tue Apr 17, 2018 6:25 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

Richard and Anatoly
Thanks for your comments. Won't be able to look further until Friday afternoon. If I don't manage that it'll be another week before my wife lets me get near a computer.

Ray
by RNBW
Tue Apr 17, 2018 2:31 pm
Forum: BASIC code examples
Topic: Formatting Numeric Input
Replies: 42
Views: 31763

Re: Formatting Numeric Input

Richard Let's assume the user has entered a number (including a decimal point) but then realises the decimal point is in the wrong place. He could first delete the old decimal point and then insert a new one - presumably that would work as expected. Alternatively he could insert a new decimal point ...