Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY with memo
Message
De
14/11/2014 16:18:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01610927
Message ID:
01611018
Vues:
40
>>Boris,
>>
>>Thanks!
>>
>>There are quite a number of fields in the table. Is there an easy way to construct the FieldListWithoutMemo, other than doing it by hand?
>
>It is easy to write a function :-)
>
>MyCopy(AliasHere,"c:\test\FooWithoutMemo"      ,0)
>MyCopy(AliasHere,"c:\test\FooWithConvertedMemo",1)
>
>
>*** This is only EXAMPLE, you should add error handling here
>FUNCTION MyCopy(lcAlais, lcTargetFile, lnTypeOfMemo)
>    LOCAL lcCurrentAlias, laFields[1], lnFields
>    LOCAL lnFor, lcSelect
>    lcCurrentAlias = ALIAS()
>    lnFields = AFIELDS(laFields, m.lcAlias)
>    lcSelect = "SELECT "
>
>    FOR lnFor = 1 TO lnFields
>        IF laFields[m.lnFor,2] == "M" && Memo
>           IF m.lnTypeOfMemo == 1
>              lcSelect = lcSelect + [CAST(]+laFields[m.lnFor,1]+[ AS C(255)) AS ]+laFields[m.lnFor,1]+[, ]
>           ENDIF
>        ELSE
>           lcSelect = lcSelect + laFields[m.lnFor,1]+[, ]
>        ENDIF
>    NEXT
>    lcSelect = LEFT(lcSelect,LEN(lcSelect)-2)+" FROM "+m.lcAlias+[ INTO CURSOR crsForCopy"
>    &lcSelect
>    COPY TO (lcTargetFile)
>    USE IN SELECT("crsForCopy")
>    IF NOT EMPTY(lcCurrentAlias)
>       SELECT (lcCurrentAlias)   
>    ENDIF
>RETURN
>
>
>NOT TESTED!!!!

It's perfect. Thanks. BTW, AS C(255) doesn't work. The max is 254.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform