Print/Save Anandtech thread - improved method

Discussion in 'Software for Windows' started by Muse, Aug 1, 2002.

  1. Muse

    Muse Lifer

    Joined:
    Jul 11, 2001
    Messages:
    17,258
    Likes Received:
    4
    When you print a long thread on these forums don't you get sick of seeing everybody's signature's... again and again? Here's a function I wrote that deletes all that stuff. You need some version of FoxPro to do this (another dBase derivative would work, maybe with a tweak or two). What you do is click the printer icon - the right-most one at the top right of each post and you will get your printable version of the entire thread. Copy this to your clipboard and then run the FoxPro function I've pasted below. You will then have a version of the thread on your clipboard that doesn't have all those signature lines.

    FUNCTION AT
    * Cut the signature lines out of Anandtech formatted-for-printing threads
    PRIVATE cbuild, cleft, n, ccurrent
    n=1
    cbuild=''
    ccurrent=ALLTRIM(_CLIPTEXT)
    ccurrent=SUBSTR(ccurrent,AT(CHR(13),ccurrent)+1) && Gets rid of the "Print this thread." preamble.
    ccurrent=ALLTRIM(ccurrent)
    DO WHILE SUBSTR(ccurrent,1,1)=CHR(13)
    ccurrent=SUBSTR(ccurrent,2)
    ENDDO
    ccurrent=SUBSTR(ccurrent,1,AT(CHR(13),ccurrent)) + CHR(13) + SUBSTR(ccurrent,AT(CHR(13),ccurrent))
    cleft=ccurrent
    DO WHILE .T.
    cbuild=cbuild + IIF(n>1, '- - - - - - - - - - - - - - - - - - - - - -','') + CHR(13) + ;
    SUBSTR(cleft,1,AT('---------------',cleft)-1)
    cleft=SUBSTR(cleft,AT('Date Posted',cleft,n))
    IF !'Date Posted'$cleft
    EXIT
    ENDIF
    n=n+1
    ENDDO
    cbuild=ALLTRIM(cbuild)+'- - - - - - - - - - - - - - - - - - - - - - - -';
    +CHR(13)+' Original post end.'
    cbuild=STRTRAN(cbuild,CHR(13)+CHR(13)+'Date Posted','- - - - - - - - - - - - - - - - - - - - - -'+CHR(13)+'Date Posted')
    _CLIPTEXT=cbuild
    RETURN
     
  2. Muse

    Muse Lifer

    Joined:
    Jul 11, 2001
    Messages:
    17,258
    Likes Received:
    4
    Anybody tried this?
     
  3. Muse

    Muse Lifer

    Joined:
    Jul 11, 2001
    Messages:
    17,258
    Likes Received:
    4
    This has a bug. I'll debug and post the code. If I can't fix it I'll delete...