Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing numbers with text 1

Status
Not open for further replies.

cobweb

IS-IT--Management
May 5, 2002
95
GB
Hi there:
For reasons too awful to discuss here (legacy systems!)I need to be able to replace some - not all - contents of a numeric field with text.
The field currently comprises values but I need to duplicate every record and replace the value in the duplicate with the letters STR (to advise the application that will receive the file that the value is Sterling - I'm in the UK).
I am currently exporting the file as text with the duplicate value being 99999999, then in DOS replacing 99999999 with "STR"....but its a pain to do it every evening!
If I try to bring the file into Paradox then the resulting value field, now text, is left aligned and will not budge to the right!And my lovely legacy system discards all that!

I am sure Paradox can do something here....
 
cobweb,

The problem is that once you include string data in the field, Paradox can no longer represent the numeric values as numbers.

When you import data, Paradox needs to discover the lowest common denominator for a field's data values in order to save as many of those values as possible. In other words, you're getting an alpha field because STR is an alphanumeric value.

It then gets creates as an alpha field and alpha field values are always left aligned be default.

A quick fix might be to change the Text Formatting properies of the field object itself. However, if you need to treat the numeric values as numers (perhaps using calculated fields), then you're going to need to find a different way of handling the export for your legacy application.

Perhaps it would be better to add an additional field for exporting to your legacy application, one that gets either a copy of the numeric value or the letters "STR" as appropriate.

You could add code to update this field every time updates are made through your form.
Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top