Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing fields
Message
From
04/08/1999 08:00:26
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Parsing fields
Miscellaneous
Thread ID:
00249648
Message ID:
00249648
Views:
56
Question:

We are writing a Windows system to replace a DOS system that started in dBASE II over 15 years ago. Certain table design decisions were required in those days and continue today. Many fields are stored as a sequence of Y's or N's. Some fields contain code sequences BA,00001, etc. We are using parameterized views to access the free tables that contain many different "codes". The code field is 5 characters in length, but some codes are only 1 character while others are 2 ,3 or 4, as well as some are zero-filled numbers. In several views, I use expressions to extract data elements and assign a name in the expression. (sample follows:

IIF(Mastdesm.codetype="#",RIGHT(Mastdesd.codecode,Mastdesm.codelength),ALLTRIM(Mastdesd.codecode)) AS cboboundcode


The Customer file (for example), only stores the 2 characters. Some of the Forms we need to create have MANY fields that require this parsing process.

AFAIK, the view is fairly efficient in creating a column of these "phantom" fields for all records in the underlying table. As you know, the controlsource value of the combobox has to exactly match the value in the boundcolumn.

We considered "fixing up" cboxxxx.value by padding the controlsource walue as needed to get 5 characters instead of using the expression in the view to create a boundcolumn value that is from 1-5 characters long.

MY Question: Which method gives us the least performance hit? In other languages, parsing a string is a fairly slow process. Are expressions in a view optimized?

I know, we should make the necessary changes, BUT we need to release the Windows system in pieces and have it co-exist with the DOS Clipper 5.0 system. We estimate that replacement of all DOS programs might take 2 - 3 years, and we can't wait that long. Maybe, in version 2.

TIA
Mike
Mike
Next
Reply
Map
View

Click here to load this message in the networking platform