Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File is not open
Message
De
08/11/2009 07:25:21
 
 
À
08/11/2009 07:05:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01433741
Message ID:
01433744
Vues:
40
Looks like you are scanning mytable and closing all the tables in the middle of the scan so mytable is no longer open.

>thank you for reply
>
>i hope it is clear to undersatnd.
>
>SET SAFETY OFF
>SET TALK OFF
>SET STATUS OFF
>
>       SELECT * FROM SOSO WHERE flg="1"        ;
>       nofilter;
>       INTO TABLE NEW1 
> 
>     SELECT DISTINCT office,DEPARTMENT FROM new1 INTO TABLE mytable1
>     USE mytable1
> 
>SCAN
>       m.office=office
>       m.DEPARTMENT=DEPARTMENT
>       thisform.text1.Value=m.office
>       thisform.text3.value=m.DEPARTMENT
>       COUNT TO THISFORM.TEXT2.VALUE
>       THISFORM.TEXT41.Value="NEW1"+".DBF"
>      CLOSE all
>          Use (thisform.text41.value) Exclusive
>
>           gnFieldcount = AFIELDS(gaMyArray)
>       For nCount = 1 To gnFieldcount 
>           If left(Upper(gaMyArray(nCount,1)),1)='Q' and gaMyArray(nCount,2)='C'&& begin with q and ather charcters
>              Wait "Converting "+gaMyArray(nCount,1) WINDOW nowait 
>              Alter table (thisform.text41.value) alter column (gaMyArray(nCount,1)) n(10,2)
>           EndIf 
>       EndFor 
>       Wait clear
>
>
>************************************
>      CLOSE all
>            #Define ANSWERCOUNT 6
>            #Define QUESTIONCOUNT 3
>            Local array aStruc[(ANSWERCOUNT+1)*2,4]
>            Local ix,lnPair
>            aStruc = 0
>            aStruc[1,1] = 'Question'
>            aStruc[1,2] = 'C'
>            aStruc[1,3] = 5
>
>     For lnPair=1 To ANSWERCOUNT
>           aStruc[m.lnPair*2,1] = 'CountOf'+Ltrim(Str(m.lnPair))
>           aStruc[m.lnPair*2,2] = 'I'
>           aStruc[m.lnPair*2,3] = 4
>
>           aStruc[m.lnPair*2+1,1] = 'PctOf'+Ltrim(Str(m.lnPair))
>           aStruc[m.lnPair*2+1,2] = 'B'
>           aStruc[m.lnPair*2+1,3] = 8
>           aStruc[m.lnPair*2+1,4] = 2
>     Endfor
>
>          aStruc[(ANSWERCOUNT+1)*2,1] = 'Total' 
>          aStruc[(ANSWERCOUNT+1)*2,2] = 'I'
>          aStruc[(ANSWERCOUNT+1)*2,3] = 4
> 
>        SET SAFETY off
>             Create table answers From Array aStruc
>          lcText4Table =  ALLTRIM(thisform.text41.value)
>          lcText4Alias = "Questions"
>            IF NOT USED(lcText4Alias)
>                SELECT 0
>                USE (lcText4Table) ALIAS Questions
>             ENDIF
>
>           For ix=1 To FCOUNT(lcText4Alias) 
>              IF UPPER(LEFT(FIELDS(ix,lcText4Alias),1)) == "Q" 
>                thisform.GetCounts(m.ix,lcText4Alias+'.'+FIELDS(ix))
>             ENDIF
>            ENDFOR
> 
>             Select answers
>                      ALTER TABLE answers  add COLUMN question1 Character(100) 
>                       ALTER TABLE answers  ALTER COLUMN question Character(10) 
>*************************************8
>      cSelect = "SELECT [sum] AS Question"
>        FOR cFlds = 2 TO FCOUNT("Answers")
>             cFldName = FIELDS(cFlds)
>          IF UPPER(LEFT(cFldName,7)) == "COUNTOF"
>              cSelect = cSelect + [,] + " SUM("+FIELDS(cFlds)+") AS "+FIELDS(cFlds)
>          ELSE
>              cSelect = cSelect + [,] + " 0 AS "+FIELDS(cFlds)
>          ENDIF
>       NEXT
>          cSelect = cSelect + " FROM Answers INTO ARRAY sumAnswers"
>          &cSelect
>         SUM CountOf1 TO nTest
>         INSERT INTO Answers FROM ARRAY sumAnswers
>
>        *****************************************
>            CLOSE ALL
>              CLEAR
>               SET SAFETY OFF
>               USE answers
>                 GO top
>                 replace question1 WITH "  ???I ?I? ??? ?????? C?????E C?????E                           " 
>                  SKIP
>                 replace question1 WITH " ???I ?I? ??? ?????? C?????E C?????E                         " 
>                  SKIP
>                 replace question1 WITH " C?C ??? ??? EC?E?I?ICE C?E? E?C?? C?????E ?? C?IC??E        " 
>                  SKIP
>                 replace question1 WITH "COC?? ?? EECI? C?????E E?? ???C??                              " 
>                  SKIP
>                 replace question1 WITH " C?C ??? ??? E??E??CE ???? C?????E  EC?IC??E                  " 
>                  SKIP
>                 replace question1 WITH "C?C ??? ??? E?? CIC?E C?????E E??I ?? C?C?E?C? E??E?? C?CIC?     " 
>                  SKIP
>                 replace question1 WITH "C?C ??? ???  EC?IC?  CIC?E C?????E E??I ?? C?C?E?C? E??E?? C?CIC?" 
>                  SKIP
>                 replace question1 WITH LTRIM("C?C COC?? E?O? C?????E EC?IC??E                        ") 
>                  SKIP
>                 replace question1 WITH "C?C ??? C?E?ICI ??OC??E ????E? C?????E E??? ?E?? ???C?? EC?IC??E " 
>                  SKIP
>                 replace question1 WITH "COC?? ?? ??I ???? C?????E EC???C?? C?????E ?C?????E EC?E??C?    " 
>                  SKIP
>                 replace question1 WITH LTRIM("C??C??E ??C?I ?? ?O? C?????E ?? C?IC??E                   " )
>                  SKIP
>                 replace question1 WITH "?? E?UE E??CIE ?C?CE C?C?E??E ?? C?IC??E   (???)  ??  (?C)  " 
>                  SKIP
>                 replace question1 WITH " ??? ?O? C??????CE WorkFlow  ?? ??C?I  (???)  ??  (?C)  " 
>                  SKIP
>                 replace question1 WITH "C?C ??? ??? E??CI?  C?????E C?????E ?? C?IC??E (???)  ??  (?C) " 
>                 SKIP
>                 replace question1 WITH "C?C ??? I?C?E E??C?? C?????E C?????E ?? C?IC??E   (???)  ??  (?C)" 
>                 SKIP
>                 replace question1 WITH "?? C?????E C?????E E??? CIC?? ?? C????   (???)  ??  (?C)" 
>                 SKIP
>                 replace question1 WITH "?? E?E?I C? C?IC??E ???E C??CE ?EECI? C??????CE (???)  ??  (?C)" 
>                 SKIP
>                 replace question1 WITH "C??????" 
>
>             ****************************************************************
>     CLOSE all
>       USE answers excl
>           ALTER table answers ADD COLUMN no n(3)
>           ALTER table answers drop COLUMN no 
>          ALTER table answers ADD COLUMN no n(3)
>                  
>                    m.i=0 
>            FOR m.i=i TO 17
>                   REPLACE no WITH m.i
>                   skip
>             endfor
>
>
>
>
>     CLOSE ALL
>         USE answers
>             SELECT  no, question,question1 ,'count',countof1,countof2, countof3,countof4,countof5;
>                   FROM answers  ;
>                       UNION ALL;
>             SELECT  no,question,question1,'persentage',pctof1,pctof2, pctof3,pctof4,pctof5;
>             FROM answers INTO CURSOR mucur  READWRITE  ORDER BY no    
>*************************************************************************
>
>    SCAN
>           replace question WITH "C?E??C?"
>        SKIP
>           replace question1 WITH ""
>           replace question WITH "%"
>           replace  countof1 WITH ROUND(countof1,2) 
>           replace  countof2 WITH ROUND(countof2,2)
>           replace  countof3 WITH ROUND(countof3,2)
>           replace  countof4 WITH ROUND(countof4,2)
>           replace  countof5 WITH ROUND(countof5,2)
>     endscan
> 
>ENDSCAN&& error message file is not open
>
>>It is very hard to read (or to understand) those commands, due to a lack of correct indentation. If you have a SCAN and its ENDSCAN, they should have the same indentation (left margin); everything in between should have an additional indentation (for example, an additional tab).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform