Ariane Soft PPL2 Pocket Programming DataMite

Go Back   ArianeSoft Forums > PPL version 2 > Support

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-04-2010, 03:10 PM
rik rik is offline
Junior Member
 
Join Date: Jun 2009
Posts: 4
Default How to make a numeric edit input

Hi,

I would like to make a numeric edit imput box, only numeric and comma
imput allowed.
How I can do this?

Giuseppe
Reply With Quote
  #2  
Old 01-04-2010, 11:15 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

Welcome Giuseppe
unfortunalty there isn't a predefined way to do this, so you have to check every single input if it is a digit or not.
try the following:
1. make a new form with an editbox
2. add the event OnChange for the editbox
3. switch to code view ('view project source' icon)
4: insert this code in the OnChange function:
PHP Code:
text$=Edit1.text;
length$=length(text$);
lastchar$=chr(text$[length$-1]);
if(
isdigit(lastchar$)==False)
 
Edit1.text=mid(text$,0length$-);
end
now you can add another if-loop for the comma.
you can also insert this code per visual programming, but this way its a bit faster.
Reply With Quote
  #3  
Old 01-05-2010, 07:24 AM
rik rik is offline
Junior Member
 
Join Date: Jun 2009
Posts: 4
Default

Tkank You very much.

I'll try it.

Giuseppe
Reply With Quote
  #4  
Old 01-05-2010, 05:01 PM
kornalius kornalius is offline
Administrator
 
Join Date: Apr 2006
Posts: 551
Default

You could also create a new component inherited from PEdit and just add ES_NUMBER to the PEdit.Create proc.
__________________
Regards,
Alain Deschenes
ArianeSoft Inc.
http://www.arianesoft.ca
Reply With Quote
  #5  
Old 01-05-2010, 07:22 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

that is even a better solution, have overlooked this editbox style
Reply With Quote
  #6  
Old 01-05-2010, 10:21 PM
Kobus Kobus is offline
Senior Member
 
Join Date: Feb 2009
Location: Spain
Posts: 141
Default

Heyyyyyy Nicknack,

You have a green card, remember.

All your posts are so much more than just helpfull.
When your name shows up, I immediately get a smile on my face.

Greetzzz,
Helen.
Reply With Quote
  #7  
Old 01-06-2010, 12:26 PM
kornalius kornalius is offline
Administrator
 
Join Date: Apr 2006
Posts: 551
Default Re: How to make a numeric edit input

True that. Nicknack is amazing! Thank god he is around.
__________________
Regards,
Alain Deschenes
ArianeSoft Inc.
http://www.arianesoft.ca
Reply With Quote
  #8  
Old 01-07-2010, 08:24 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

I'm feeling very grateful, but I don't do it selfless, I get always get something back from you
Reply With Quote
  #9  
Old 01-25-2010, 11:29 AM
rik rik is offline
Junior Member
 
Join Date: Jun 2009
Posts: 4
Default

Quote:
Originally Posted by kornalius View Post
You could also create a new component inherited from PEdit and just add ES_NUMBER to the PEdit.Create proc.
Pls can You post an example on how to inherit form PEdit and how to right align text?

Regards,

Giuseppe
Reply With Quote
  #10  
Old 01-26-2010, 07:56 PM
Nicknack Nicknack is offline
Senior Member
 
Join Date: Nov 2006
Location: Germany
Posts: 527
Default

ES_RIGHT should be the adequate style. concerning inherting, simply inherit the PEdit class and copy/rewrite the create function to your needs. see the help file topic about classes for further info.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (c) ArianeSoft Inc.
Copyright © 2009 www.ppl-lang.com - All rights reserved
Web Design by BR Web Consulting Ltd