Home · Articles · Downloads · Forums · LinksSeptember 06 2010 05:14:52
Navigation
Home
Articles
Downloads
FAQ
Forums
Contact Me
Links
Photo Gallery
Search
Register
Latest Articles
5GL:Property, Method...
Limnor vs. Computer ...
Codeless vs Coding
Community Conduct
View Thread
Limnor Community Portal | General Limnor Discussion | How to...
Author Validating Inputs, Variables and Arrays
frangonve
Member

Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08
Posted on 27-02-2010 10:39
Hello,

I'm writing a very simple tool to help cash line attendant to calculate the cash balance.


You can download the project here:

http://rapidshare.com/files/356657297/EuroNotesAndCoins.zip

Please can you give me a hint to enhance the tool programming and specially filtering input typing mistakes (alphabetical or special chars) and to allowing the button to reset the input fields to zero.

Currently only the two top and the botton input fields are operating.

If you have another option to upload the project and so avoiding the hassle to download from rapidshare host, please let me know.

Cheers

Francisco

Edited by frangonve on 28-02-2010 18:38
Author RE: Validating Inputs
yw
Administrator

Posts: 670
Location: ***
Joined: 23.06.05
Posted on 27-02-2010 18:17
A new version at http://www.limnor.com/Studio/LimnorStudioSetup.msi includes a control, TextboxNumber. It works as a normal TextBox except that it has two extra properties: TargetType and ValidateCulture. TargetType specifies what kind of number is acceptable. ValidateCulture indicates what culture to be used when validating the Text. Invalid characters will be ignored.
For reseting the textbox, use a Set Property action to set Text property to 0.
Author RE: Validating Inputs
frangonve
Member

Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08
Posted on 28-02-2010 13:20
Thanks for your help.

Due to the limitation of size in math expresion editor where I have to calculate the total amount as:

500*{Form1.TextBoxNumber1.Text}+
200*{Form1.TextBoxNumber2.Text}+
100*{Form1.TextBoxNumber3.Text}+
50*{Form1.TextBoxNumber4.Text}+
...
0.05*{Form1.TextBoxNumber14.Text}+
0.01*{Form1.TextBoxNumber15.Text}+

I've found 2 options (perhaps there an easier one that I ovelooked...):

1 Storing each partial result in an independent variable and then adding them to compute the total amount or creating a 2 dimensions array (2 * 15):

500,{Form1.TextBoxNumber1.Text}
200,{Form1.TextBoxNumber2.Text}
100,{Form1.TextBoxNumber1.Text}
...
0.05,{Form1.TextBoxNumber14.Text}
0.01,{Form1.TextBoxNumber15.Text}

and then calculate the Total as


for j=0 to 14
Total= Total+Array(j,0)*Array(j,1)
next

Please can you give us an example to create and populate the array and then computing the Total

Cheers

Francisco

Edited by frangonve on 28-02-2010 18:43
Author RE: Validating Inputs
frangonve
Member

Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08
Posted on 28-02-2010 17:37
Hi,

I'm playing a bit with variables and I think i've found a bug:



As you can see in the picture, I've defined the variable x|0 as a constant value (500). When running this value is not taken. But if I define x|0 as a property then the value is taken correctly as you can see in this example:

http://rapidshare.com/files/357222183/Arrays003.zip

Cheers

Francisco
Author RE: Validating Inputs, Variables and Arrays
frangonve
Member

Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08
Posted on 02-03-2010 05:42


Edited by frangonve on 02-03-2010 06:02
Author RE: Validating Inputs, Variables and Arrays
yw
Administrator

Posts: 670
Location: ***
Joined: 23.06.05
Posted on 02-03-2010 22:14
The math expression bug has been fixed.
For displaying number formatted, the number's ToString(CultureInfo) can be used. I'll do some experiments.
Copy/paste can be done by Clipboard class under System.Windows.Forms namespace, using SetText to copy, using GetText to do paste.
In your case, if the labels are changed to TextBoxes then the copy/paste are automatically available without programming.
I'll to the last two questions later...
Author RE: Validating Inputs, Variables and Arrays
yw
Administrator

Posts: 670
Location: ***
Joined: 23.06.05
Posted on 04-03-2010 00:51
A new version was uploaded at http://www.limnor.com/Studio/LimnorStudioSetup.msi.
The TextBoxNumber is enhanced by adding a new property DisplayFormat. See http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx and http://msdn.microsoft.com/en-us/library/0c899ak8(VS.71).aspx for how to use DisplayFormat. For example, if DisplayFormat is N then thousand group will be used, that is, displayed as 1,234,567.89 or 1.234.567,89 depending on the ValidateCulture. If ValidateCulture is CurrentCulture and your computer is using Spanish culture then it will display 1.234.567,89
If you use TextBoxNumber to replace the Label to show parital results and the total and you get both functionality of showing numbers in formats and copy the number to clipboard.
Author RE: Validating Inputs, Variables and Arrays
frangonve
Member

Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08
Posted on 04-03-2010 17:35
Thanks a lot for your help!!

Cheers

Francisco
Author RE: Validating Inputs, Variables and Arrays
yw
Administrator

Posts: 670
Location: ***
Joined: 23.06.05
Posted on 04-03-2010 20:08
For question of using arrow keys as tab and shift-tab, we uploaded two videos showing how to do it. See http://www.limnor.com/index.html?Doc=studio_video.html.
For improvement of turnning empty to 0 for TextBoxNumber, it is done for version at http://www.limnor.com/Studio/LimnorStudioSetup.msi.
Author RE: Validating Inputs, Variables and Arrays
frangonve
Member

Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08
Posted on 06-03-2010 01:28
Hello,

Thanks a lot.

I started to assign {TAB}/+{TAB} to Down/Up keys, and I have this question:

After I setup the handler with its actions in the first TextBoxNumber, Have I to repeat the whole process with the remaining TextBoxNumbers or can I assign the same handler (or a copy) to another TextBoxNumbers? If so please let me know how.

Cheers

Francisco

Edited by frangonve on 06-03-2010 01:29
Author RE: Validating Inputs, Variables and Arrays
yw
Administrator

Posts: 670
Location: ***
Joined: 23.06.05
Posted on 06-03-2010 12:01
Good the question.
The way object-oriented programming do it is to make such a TextBoxNumber a new class. Add the handlers or other common functionality to it. Then use this new TextBoxNumber class in the Form.
This traditional way has one problem: we must know what we want before we start developing our Forms.
Author RE: Validating Inputs, Variables and Arrays
frangonve
Member

Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08
Posted on 06-03-2010 13:56
Great... I'll create a new class following the steps in the tutorial. Right?

When you say "This traditional way has one problem:..."

Do you mean that there is another way without this problem?
Is it possible to add new features to classes in use?

Cheers

Francisco

Edited by frangonve on 06-03-2010 13:59
Author RE: Validating Inputs, Variables and Arrays
frangonve
Member

Posts: 110
Location: Madrid (Spain) until I can live at the beach
Joined: 18.06.08
Posted on 07-03-2010 01:16
I'm trying to create a subclass based in the TextboxNumber class, But I can't find this class in the Namespaces tree.
Please. Can you help me to find it?
Author RE: Validating Inputs, Variables and Arrays
yw
Administrator

Posts: 670
Location: ***
Joined: 23.06.05
Posted on 08-03-2010 11:58
You may click the Add button to find the FormComponents.dll. I'll ask the devs to add it to Namespaces for convinience.
When I say "the traditional way..." there is not an alternative as far as I know for all object-oriented approaches such as C++, Delphi, C#, Java, etc.
Some innovations can be done in this area. For example, generate new class based on an existing component used in a form, let the user to switch the type of an existing component used in a form.
Author RE: Validating Inputs, Variables and Arrays
yw
Administrator

Posts: 670
Location: ***
Joined: 23.06.05
Posted on 09-03-2010 17:23
A new update is available at http://www.limnor.com/Studio/LimnorStudioSetup.msi.
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Shoutbox
You must login to post a message.

yw
16/04/2010 17:25
It is available at http://www.limnor.com/dow
nloads/LimnorPerformerRef
erences.pdf


tangocash
15/04/2010 13:03
Hi limnor performers reference pdf link in rapidshare is down. I really need to download it. aj.soho@gmail.com

yw
28/08/2009 11:31
try set RThreshold = 1

Fredpret
27/08/2009 15:52
I cannot receive via the rs232 performer yet hyper terminal works. Any suggestion or help will be most welcome. Thanks

admin
06/05/2009 14:30
Fredpet - please post your inquiry in the forums so others can comment and benefit from the replies.

Fredpret
06/05/2009 10:46
I cant transfer data to a page variable. i thought it was exrtemely simple but no go. I shall be very grateful for any help

lammies
16/03/2009 10:45
will excel and word performers work with MSP Office 2007?

Raven
27/12/2008 10:48
Limnor Rocks !!!

piyushvishvas
13/07/2008 14:24
Limnor is great tool for developers. piyushvishvas wwww.vishvas.org

SOE
18/12/2007 15:06
Project browser and action list are awesome ways to help program visually. It truly allows you to organize, see the logic involved, and help program. You don't have this view point using traditio

Shoutbox Archive
Forum Threads
Newest Threads
Scraping revisited
TreeviewX change icon
Scraping HTML or CSV...
Treeview help
Old limnor
Hottest Threads
how to make repor... [33]
Filling database ... [31]
my project [31]
Users Management [30]
Possible Bugs Rep... [26]