Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Once more into the Word breach, my friends
Message
De
16/12/2011 14:00:04
 
 
À
16/12/2011 11:01:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 7
Divers
Thread ID:
01531193
Message ID:
01531206
Vues:
62
>Hi Gang
>
>I'm hoping y'all aren't getting as tired of these questions as I am, but here goes one more.
>
>Got everything printing into table cells, figured out how to spilt the columns so the questions print top-to-bottom, everything's hunky AND dorry until I let it run without any suspends or any information wait windows - and everything works just fine for 3 pages and then it seems to either skip over or ignore the 'check for new page' test.
>
>here's that section of code
>
>
>  Scan While cat = mcat
>    nRow = nRow + 1
>    oRow = oTab.Rows[nRow].Range()
>    orow.cells[1].range.paragraphformat.linespacing = 10
>    Store '' To fblock, line1, line2, line3, line4, line5
>    If Empty(stem)    && just the responses
>      line1 = Iif(qstnum < 10,' ' + Alltrim(Str(qstnum)), Alltrim(Str(qstnum)));
>        + '. a) ' + Alltrim(respa) + CR
>      line2 = Space(4) + 'b) ' + Alltrim(respb) + CR
>      line3 = Space(4) + 'c) ' + Alltrim(respc) + CR
>      line4 = Space(4) + 'd) ' + Alltrim(respd)
>    Else
>      line1 = Iif(qstnum < 10,' ' + Alltrim(Str(qstnum)), Alltrim(Str(qstnum)));
>        + '. ' + Alltrim(stem) + CR
>      line2 = Space(4) + 'a) ' + Alltrim(respa) + CR
>      line3 = Space(4) + 'b) ' + Alltrim(respb) + CR
>      line4 = Space(4) + 'c) ' + Alltrim(respc) + CR
>      line5 = Space(4) + 'd) ' + Alltrim(respd)
>    Endif
>    fblock = line1 + line2 + line3 + line4 + line5
>    ** If we've 'run off the page' - time to move to column 2
>    ** maxRow holds end of this page row
>    ** HoldRow holds "next row to print"
>    ** mCurPage holds current page
>    If oSec.Range.Information(3) <> mcurpage
>wait window "Now Printing page " + alltrim(str(mcurpage)) timeout 3  && This shows for the first 3 pages, after that - no
>      maxRow = nRow -1
>      nRow = HoldRow
>      mcurpage = oSec.Range.Information(3)
>    Endif
>
>
>
>Secondarily, after printing a section of questions, I've got to print some instructions before the next section of questions. To do this, I have the following:
>
>
>  If mcat = '40'
>    oRow = oTab.Rows[nRow].Range()
>    oRow.Cells.Merge()
>    oRow.Cells[1].Range.InsertAfter("Directions for items 57-66.  " + ;
>      "You will hear conversations or persons giving information.  " + ;
>      "Select the best answer and mark your answer sheet, a, b, c, or d." + CR)
>  Endif
>
>
>Works beautifully, the problem is when I go to print the next question with
> oRow = oTab.Rows[nRow].Range()
> oRow.Cells[1].Range.InsertAfter(fblock)
>
>it tells me that oRow isn't an object. I've been told that once you merge cells on a row, it merges all rows from that point? Say what?
>

Not sure what's going on with the first problem, but you can use DEBUGOUT to send info to the Debugger to see what's going on.

On the second problem, add the row after the instructions first, holding a reference in another variable, then merge the row you need to merge.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform