Skip to main content
Known Participant
Jul 4, 2017 4:59 AM UTC
Answered

cSavepath not saving based on if then statements

HI,

I am trying to make it so if the total number of pages (numPages) is 1, then the code inserts the "1" +  "page" and if there is a total of 3 pages , it would insert save as "3" + "pages".  I don't understand why the following is not saving the pdf with the cSavePath (i.e., filename) based on whether the total # of pages is 1 or not 1:

        cSavePath += " - "

        cSavePath += event.target.numPages

        If (event.target.numPages == "1")

       {cSavePath += " page"}

        

        If (event.target.numPages != "1")

        {cSavePath += " pages"}

    

I even tried as numerical value:

cSavePath += " - "

        cSavePath += event.target.numPages

        If (event.target.numPages = 1)

       {cSavePath += " page"}

        

        If (event.target.numPages > 1)

        {cSavePath += " pages"}

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jul 4, 2017 8:16 AM UTC

Also, it's "if", not "If"...

3 replies

Bernd Alheit
Community Expert
Community Expert
Jul 4, 2017 6:59 AM UTC

Use == not = for the comparsion.

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jul 4, 2017 8:16 AM UTC

Also, it's "if", not "If"...

Translate
suemo22Author
Known Participant
Jul 4, 2017 3:01 PM UTC

Ughh, yes.  It was the "If" vs. the "if".  Thx.

Translate