Announcement

Collapse

PM and other Problems

We seem to be experiencing system-wide problems with Personal Messages, Notifications, and other secondary systems. Our Forum Hosting company has been alerted. This DOES affect the ability of Admins to respond to outstanding PMs, forum-access requests, and other items as well; please be patient.
See more
See less

open pdf file from pbcc

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • open pdf file from pbcc

    OPENNING A PDF FILE FROM PBCC WORKS IF THE FILENAME HAS NO SPACES
    eg.
    SHELL ENVIRON$("COMSPEC")+" /c TESTABC.PDF"
    works fine

    However if the .pdf file has spaces it does not work
    eg.
    SHELL ENVIRON$("COMSPEC")+" /c TEST ABC.PDF"
    does not work
    is ther a better way to open a PDF fie from PBCC??

    Thanks, Reise

  • #2
    Quote the filename:
    SHELL ENVIRON$("COMSPEC")+" /c ""TEST ABC.PDF"""
    --
    [URL="http://www.camcopng.com"]CAMCo - Applications Development & ICT Consultancy[/URL][URL="http://www.hostingpng.com"]
    PNG Domain Hosting[/URL]

    Comment


    • #3
      how can i use a variable

      Thanks. That worked ; how can i do it using a variable?
      Variable aa$
      aa$="test abc.pdf"

      shell environ$("comspec")+ " /c aa$ ??

      I tried several methods using chr$(34) for a quotation mark but i still was unable to do it

      thanks, reise

      Comment


      • #4
        Code:
        aa$ = "test abc.pdf"
        SHELL environ$("comspec") + " /c  "  + CHR$(34) + aa$ + CHR$(34)
        or
        Code:
        aa$ = "test abc.pdf"
        SHELL environ$("comspec") + " /c  "  + $DQ + aa$ + $DQ
        --
        [URL="http://www.camcopng.com"]CAMCo - Applications Development & ICT Consultancy[/URL][URL="http://www.hostingpng.com"]
        PNG Domain Hosting[/URL]

        Comment


        • #5
          thank you

          Thank you very much Stuart.

          Reise

          Comment


          • #6
            Code:
            szFile= "filename with or without spaces it doesn't care.pdf"
            ShellExecute GetDesktopWindow(), "open", szFile, BYVAL %NULL*, BYVAL %NULL*, ChoiceOfShowCmd
            * or other choice. Refer to documentation.

            MCM
            Michael Mattias
            Tal Systems Inc.
            Racine WI USA
            mmattias@talsystems.com
            http://www.talsystems.com

            Comment


            • #7
              Ahem!

              Code:
              #INCLUDE "Win32API.inc"
              ...
              szFile= "filename with or without spaces it doesn't care.pdf" 
              ShellExecute GetDesktopWindow(), "open", szFile, BYVAL %NULL*, BYVAL %NULL*, ChoiceOfShowCmd
              --
              [URL="http://www.camcopng.com"]CAMCo - Applications Development & ICT Consultancy[/URL][URL="http://www.hostingpng.com"]
              PNG Domain Hosting[/URL]

              Comment


              • #8
                "Ahem" my <posterior>!

                Every program includes the Windows headers!
                Michael Mattias
                Tal Systems Inc.
                Racine WI USA
                mmattias@talsystems.com
                http://www.talsystems.com

                Comment


                • #9
                  Yours may. Many don't. The default PBEdit - "Create new file as - Generic PB Program" doesn't.
                  --
                  [URL="http://www.camcopng.com"]CAMCo - Applications Development & ICT Consultancy[/URL][URL="http://www.hostingpng.com"]
                  PNG Domain Hosting[/URL]

                  Comment


                  • #10
                    >The default PBEdit - "Create new file as - Generic PB Program" doesn't.

                    So what?

                    Doesn't everyone use "Create new file as - MY TEMPLATE FILE", ???

                    That template feature is really nice since you can create 'new' with all the COMMENTED options and library procedures and macros you know you are going to want anyway.

                    Oh, you didn't invest an hour or so setting up "YOUR" template file? Well, it's your ten minutes per program now and forever you're wasting.
                    Michael Mattias
                    Tal Systems Inc.
                    Racine WI USA
                    mmattias@talsystems.com
                    http://www.talsystems.com

                    Comment


                    • #11
                      > Doesn't everyone use "Create new file as - MY TEMPLATE FILE", ???

                      I suspect that most users don't. But that's beside the point.

                      Not every program includes Win32API.inc.

                      I would not be surprised to find out that most programs don't include it.
                      --
                      [URL="http://www.camcopng.com"]CAMCo - Applications Development & ICT Consultancy[/URL][URL="http://www.hostingpng.com"]
                      PNG Domain Hosting[/URL]

                      Comment


                      • #12
                        >I would not be surprised to find out that most programs don't include [WIndows' API header files].

                        Maybe demo and play programs, but it's hard for me to imagine ANY Real World application which does not use at least one Windows API call; and regardless, it costs nothing but a few milliseconds at compile time to "just #INCLUDE it"

                        However, this may have changed somewhat with the addition of all those WM_xxxx constants as "predefined equates" but I wouldn't know about that because I don't get "undefined equate" errors on WM_xxxx items, probably because they are all in WIN32API.INC.
                        Michael Mattias
                        Tal Systems Inc.
                        Racine WI USA
                        mmattias@talsystems.com
                        http://www.talsystems.com

                        Comment


                        • #13
                          Yo, people... Play nice... Lets not take our eyes off of the ball...

                          Izzy Z

                          Comment

                          Working...
                          X