This message contains graphics. If you do not see the graphics: Graphic Version.
 
Is TX a spreadsheet? More on VSSPELL

Your VSSPELL Experiences

After our call for comments about VSSPELL last week, several of you have been so kind as to place a few words on our Discussion Forum. Firstly, to those people we are most thankful and very grateful that you have taken the time from your busy schedule to share your experiences with other TX Text Control users. We are also equally thankful to the people at VideoSoft who have also commented on some of the issues raised by you. VideoSoft's comments enforce their commitment to working with TX Text Control, allowing all users of our software product to easily add advanced spell checking and thesaurus features to their TX based application.

One issue which has surfaced though this feedback initiative is that many of you have had difficulty with the underline feature of VSSPELL: When using the CheckTyping method, you have a choice of TypingErrorAction: One of those choices is to underline for which you may set the UnderlineColor and UnderlineStyle. Then, when an end user is typing into a TX control and types in a misspelled word, as soon as the user presses the space bar to start the next word, an underline should appear. It is up to the developer to decide what to do at that point. If the user continues to type, as soon as a correctly spelled word is typed, the underline will be gone.

It would seem that the underline-while-you-type feature is the only area where there appears to be some incompatibility issues between the two programs. We are currently working with VideoSoft to resolve the inconsistencies when trying to use the underline feature with TX Text Control. Within the next few weeks, we will be releasing a free Service Pack which will resolve this problem.

Top TX Tip: TX pretends to be a spreadsheet

Welcome to this week's tantalizingly top TX tip. We going to be looking at a feature which is not directly from TX but which is nether the less most interesting: A very often posed question we get here in the Support Department is, "how do I get TX to pretend it is a spreadsheet? I want to use TX to produce a grid and then I want to apply mathematical functions on these cells. Is this possible or do I have to purchase a separate grid control?"

Take a look at this example. While it is not quite as sophisticated as MS Excel, it does show how easy it is to automate calculations using TX. In fact, this is exactly what we have done with our Office Suite.

So, back to the example application

1) Visual Basic

Function CalculateSum() As String Dim sum As Currency Dim price As Currency Dim count As Currency Dim s As String sum = 0 For i = nTableCalcStart To nTableCalcEnd price = TXTextControl1.TableCellText(tid, i, nPriceCol) count = TXTextControl1.TableCellText(tid, i, nNumberCol) sum = sum + price * count Next i ' now return correctly formatted result CalculateSum = Format(sum, "#,###0.00") End Function

2) Delphi:

Function TForm1.CalculateSum : String; var sum, price, count : Currency; i : Integer; begin sum := 0; For i := nTableCalcStart To nTableCalcEnd do begin price := StrToCurr(removeThousands(TXTextControl1.TableCellText [tid,i,nPriceCol])); count := StrToInt(TXTextControl1.TableCellText[tid, i, nNumberCol]); sum := sum + price * count; end; // Now return correctly formatted result CalculateSum := FormatCurr('#,###0.00', sum) End;

What is actually going on here?

In both examples there are some global variables defined. nTableCalcStart is the row number from which to start building the sum. nTableCalcEnd is the according end value. nPriceCol is the number of the column that holds the price and nQuantityCol is the column that holds the quantity.

Now building the sum is pretty easy: Simply grab the value from the first price cell, multiply it with the according quantity value. Do this for each row and add all these values.

The hard part is to convert the sum back into a nicely formatted currency value. Thankfully both, Delphi and VB, provide a function to do this, so you don't have to worry about it.

The other direction is even easier in VB. The string that is grabbed from a table cell can simply be assigned to a currency value and the type conversion is done internally by VB. Delphi provides conversion methods to convert strings into numbers, but the StrToCurr method doesn't accept a "." or "," as a thousand divider. So, an additional function is required to remove these first.

Free Advertising For Your TX Text Control Application

For you long-time TX users, I guess you are getting fed up of reading about this, but as there are more than 1200 new TX Text Control Newsletters readers per month, I do have to repeat this about once a month. Please do not despair!

So, to all you new to TX Text Control: We would like to give you the opportunity of free advertising for your TX Text Control based product on our web site.

All we ask is that you send us your text, as well as a few screenshots detailing how you used TX Text Control in your software application and within about two days of receiving this material, we will add your story, along with your logo and your name to our sample application pages.

So far we have had a terrific response to our request for sample TX Text Control applications from the hard core TX users, but I am know there are thousands of other TX based applications out there - all of which should be added to the sample application page. Just send me a short text, explaining how you used TX Text Control to implement your application and you get free advertising for this product on our web site. I'm looking forward to receiving your material!

FREEVBCODE.COM - Free High-Quality VB Code

FreeVBCode.com contains almost 700 snippets, classes, controls, and applications with full Visual Basic Source Code. To ensure quality, all code is tested before it is posted. New code is added every day. Visit us at http://www.freevbcode.com, and don't forget to check out our discussion forum and our new Windows 2000 section!

http://www.freevbcode.com


Best regards

The Newsletter Team

Text Control GmbH respects your online time and privacy. We only send this newsletter to TX Text Control customers and people who have signed up to receive it. However, if you would prefer not to receive future issues of the newsletter, you may unsubscribe at any time. If you received this newsletter forwarded from a colleague or friend, you may wish to subscribe directly.

Sent to: N/A.

Imprint | Unsubscribe | Subscribe

© 2000 Text Control GmbH. All Rights Reserved.