Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00920850
Message ID:
00920926
Vues:
15
>hi all-
>
>I am working on this code and and need a way to a way of resetting the chapters every time a section ends
>
>Each section is separated with a sec1, sec2, sec3, etc.. with chapters inside it.
>
>f = FILETOSTR("family.txt")
>nchap = alines(aword, f, "CHAPTER")
>
>FOR x = 1 TO nchap
>	t_andcnt = OCCURS(" and ", aword[x])
>	? "Chapter ",x, ":", t_andcnt, "occurrences"
>ENDFOR
>
>thanks..
* This puts chaperters in a cursor in reverse order
* Untested
create cursor curFamily (nChap I,cChap m)
cfamily=filetostr("family.txt")
nMaxLen=len(cfamily)
nChapters=occurs("CHAPTER",cFamily)
for c=nChapters to 1 step -1
lcChapter=substr(cfamily,rat("CHAPTER",cfamily),nMaxLen)
append blank in curFamily
replace nChap with c, cChap with lcChapter in curFamily
cFamily=left(cFamily,rat("CHAPTER",cfamily)-1)
endfor
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform