Announcement

Collapse
No announcement yet.

open pdf file from pbcc

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

  • Reise Jacobs
    started a topic open pdf file from pbcc

    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

  • Izzy Zeitz
    replied
    Yo, people... Play nice... Lets not take our eyes off of the ball...

    Izzy Z

    Leave a comment:


  • Michael Mattias
    replied
    >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.

    Leave a comment:


  • Stuart McLachlan
    replied
    > 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.

    Leave a comment:


  • Michael Mattias
    replied
    >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.

    Leave a comment:


  • Stuart McLachlan
    replied
    Yours may. Many don't. The default PBEdit - "Create new file as - Generic PB Program" doesn't.

    Leave a comment:


  • Michael Mattias
    replied
    "Ahem" my <posterior>!

    Every program includes the Windows headers!

    Leave a comment:


  • Stuart McLachlan
    replied
    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

    Leave a comment:


  • Michael Mattias
    replied
    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

    Leave a comment:


  • Reise Jacobs
    replied
    thank you

    Thank you very much Stuart.

    Reise

    Leave a comment:


  • Stuart McLachlan
    replied
    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

    Leave a comment:


  • Reise Jacobs
    replied
    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

    Leave a comment:


  • Stuart McLachlan
    replied
    Quote the filename:
    SHELL ENVIRON$("COMSPEC")+" /c ""TEST ABC.PDF"""

    Leave a comment:

Working...
X