Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional Formatting of Field Values
Message
De
20/08/2008 09:55:35
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
20/08/2008 09:46:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01340331
Message ID:
01340364
Vues:
12
>>>>Just show it.
>>>
>>>Oh, that should be simpler than I thought, then. Just make a UDF that takes the field and formats the result according to some rule.
>>>
>>>I think that the real question is, depending on what condition do you want to change the display format? Depending on the answer to that question, you will put the formatting options into different places.
>>>
>>>A certain field always uses a certain format: some sort of data dictionary.
>>>
>>>The same field will appear different for different users (depends on user preferences): some table that stores user preferences.
>>>
>>>The same field will appear different between different records, depending on some additional criteria: either deduce the formatting from other fields, or store an additional field for the display options.
>>
>>I think that this is the one that applies to mine. I will have one set of records per carrier/payor in the table with as many records in the set as there are fields to be formatted. Each record would additionally have the name of the field to be formatted and the value from the dropdown. Then when I'm processing my message, I would lookup the carrier/payor and appropriate field name to get the corresponding formatting value. Then have a CASE to handle what to do with that particular field value.
>>
>>Does that sound reasonable?
>
>Yes, more or less.
>
>To make this generic, I would create a UDF which produces the desired output. Then, you just show the result of the UDF in a report, or on screen.
>
>Parameters might include:
>
  • The actual value to be processed, e.g. a certain date. In practice, you would usually pass the field as a parameter.
    >
  • What type of field it is - date, SSN, ... This might be coded as 1, 2, 3, or some more readable format, such as "date", "ssn", ...
    >
  • The code for a specific format, this will vary depending on the field type. You may code this as 1, 2, 3, as you suggested, or also use a more readable code, such as (for the case of a date): "dmy", "ymd", etc.

    Ok, but the UDF would still be a series of CASE statements to return the correctly formatted field value, right?
  • Précédent
    Suivant
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform