Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collect words not same
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01024414
Message ID:
01024479
Vues:
19
Dear all
>How can a collect words those are not same(not reapted words) from a table and copy into other dbf or cursor.one by one
>thanks


Hi Khubaib,
try this:
SET EXACT OFF

CREATE Table yourcursor (statements M(4))

INSERT INTO yourcursor VALUES ('Specifies the string to be evaluated')
INSERT INTO yourcursor VALUES ('Specifies the index position of the word to be returned')
INSERT INTO yourcursor VALUES ('Specifies the string whose words will be counted')
INSERT INTO yourcursor VALUES ('Specifies one or more optional characters used to separate words in cString')
INSERT INTO yourcursor VALUES ('Count supports the Access method')
INSERT INTO yourcursor VALUES ('Since Count is read-only, it does not support the Assign method')

CREATE TABLE my_words (mtext c(50))
INDEX ON UPPER(mtext) TAG my_words

SELECT yourcursor

SCAN
    m.my_var = STRTRAN(ALLTRIM(yourcursor.statements),' ',CHR(13))
    m.number_of_words = MEMLINE(m.my_var)
    FOR m.my_cicle = 1 TO m.number_of_words
        m.new_word = ALLTRIM(MLINE(m.my_var,m.my_cicle))
        SEEK UPPER(m.new_word) IN my_words
        IF NOT FOUND('my_words')
           INSERT INTO my_words VALUES (m.new_word)
        ENDIF
    ENDFOR
ENDSCAN

SELECT my_words
BROWSE NORMAL
CLOSE DATABASES ALL
HTH
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform