Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Move placement of field based on length of another field
Message
De
26/09/2006 11:16:37
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01157231
Message ID:
01157262
Vues:
19
>Step 1: Change FIELD02's left to be the same as FIELD01's left
>Step 2: Change FIELD02's width to match its original right edge
>Step 3: Change FIELD02's expression to be something like this:
>
>    PADL(FIELD02, ExtraSpaces(FIELD01))
>
>Step 4: Create an ExtraSpaces( ) function:
>
>FUNCTION ExtraSpaces(lcField1Value)
>   ** Font info for field 1
>   lcName1 = "Arial"
>   lcSize1 = 12
>   lcStyle1 = "B"
>
>   ** Font info for field 2
>   lcName2 = "Arial"
>   lcSize2 = 10
>   lcStyle2 = "N"
>
>   lnTextWidth = TXTWIDTH(lcField1Value,lcName1,lcSize1,lcStyle1)*;
>            FONTMETRIC(6,lcName1,lcSize1,lcStyle1)
>
>   lnSpaceWidth = TXTWIDTH(SPACE(1),lcName2,lcSize2,lcStyle2)*;
>            FONTMETRIC(6,lcName2,lcSize2,lcStyle2)
>
>   lnSpaces = CEILING(lnTextWidth/lnSpaceWidth)
>
>   RETURN lnSpaces
>ENDFUNC
>
>
>I hope this makes sense. I can send you a sample if you need it.

Exactly what I had in mind, and actually with all the details I meant to leave to him as homework. You saved me a few minutes :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform