![]() |
|
|||||||
| PowerBASIC Console Compiler User to user discussions about the PowerBASIC Console Compiler product line. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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""" |
|
#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 |
|
#4
|
|||
|
|||
|
Code:
aa$ = "test abc.pdf"
SHELL environ$("comspec") + " /c " + CHR$(34) + aa$ + CHR$(34)
Code:
aa$ = "test abc.pdf"
SHELL environ$("comspec") + " /c " + $DQ + aa$ + $DQ
|
|
#5
|
|||
|
|||
|
thank you
Thank you very much Stuart.
Reise |
|
#6
|
|||
|
|||
|
Code:
szFile= "filename with or without spaces it doesn't care.pdf" ShellExecute GetDesktopWindow(), "open", szFile, BYVAL %NULL*, BYVAL %NULL*, ChoiceOfShowCmd MCM |
|
#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 |
|
#8
|
|||
|
|||
|
"Ahem" my <posterior>!
Every program includes the Windows headers! |
|
#9
|
|||
|
|||
|
Yours may. Many don't. The default PBEdit - "Create new file as - Generic PB Program" doesn't.
|
|
#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. |
|
#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. |
|
#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. |
|
#13
|
|||
|
|||
|
Yo, people... Play nice... Lets not take our eyes off of the ball...
Izzy Z |
![]() |
| Tags |
| file name, pdf, spaces |
| Thread Tools | |
| Display Modes | |
|
|