Hi Karen,

Do you know the programs that the users will/could run?

If so, could you create a table with three columns: Program name; file to run; 
default extension, then

You could build all (or most) of the probable calls and use the launch variable 
from there.

Particularly, no extension: run your chosen default!


For a long time now I have used this format for using launch:

SET VAR vLaunchProg TEXT = +
'C:\Program Files (x86)\Microsoft Office\Office10\WinWord.EXE'

SET VAR vLaunchParams TEXT = (.vFileName & '/mDeletedMusic')

SET VAR vLaunch TEXT = (.vLaunchProg & '|' & .vLaunchParams)

LAUNCH .vLaunch


(In this example Word is run with a macro.) It seems to be pretty well 
bulletproof that way.


Another way you might investigate is to hard code the options in  
“Switch|Endsw” format and then build and run the launch command.

Hope that helps,
Regards,
Alastair.


PS: I believe the code above to be all my own work but if anybody ever helped 
me or influenced me in any way to produce it I no longer have a record of that 
help. Therefore I would like to acknowledge whomsoever may have helped me since 
the mid 1980s and, in particular in this case, since the launch command was 
introduced.



From: Karen Tellef 
Sent: Wednesday, November 20, 2013 7:37 PM
To: RBASE-L Mailing List 
Subject: [RBASE-L] - Re: Doing a dynamic "launch" - more

Yep, I got a "launch notepad|filename|W" to work to bring notepad up with a 
filename

So now back to my original problem of figuring out when to bring Notepad up if 
there is no associated filename.

I can go totally "low tech" and do this

-- figure out the file extension by locating the period
IF vFileExt IN ('xls','pdf','doc', etc) THEN
  LAUNCH .vFileExt
ELSE
  -- do the notepad thing
ENDIF

But I was hoping to do something a little more elegant to trap an error message 
if a simple "launch" doesn't work

Karen




-----Original Message-----
From: Dennis McGrath <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Wed, Nov 20, 2013 1:25 pm
Subject: [RBASE-L] - Re: Doing a dynamic "launch" - more


This works for me.
Using the dotted variable eliminates problems with spaces in the filespec.

set var vFile = 'C:\this is a test\test.dfm'
zip notepad .vfile
return

Dennis McGrath
Software Developer
QMI Security Solutions
1661 Glenlake Ave
Itasca IL 60143
630-980-8461
[email protected]
From: [email protected] [mailto:[email protected]?] On Behalf Of Karen Tellef
Sent: Wednesday, November 20, 2013 1:08 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Doing a dynamic "launch" - more

Now that I look at this closer, it looks like I can't bring up RBEdit from 
within an RBase form anyway the way I have it.  If anyone can think of a way to 
do what I want, is there a way to launch NotePad or WordPad with a parameter to 
send in the file to open?

Karen



-----Original Message-----
From: Karen Tellef <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Wed, Nov 20, 2013 1:02 pm
Subject: [RBASE-L] - Doing a dynamic "launch"
I'd like to put up the file-finder windows box for the user to choose a file 
and 
then do a Launch. 

Problem is, they have alot of files with weird extensions like ".vrw" or ".123" 
that are not associated with Windows program but can be brought up in any text 
editor.  If they pick one of these files and try to launch it you get the 
system 
message "there is no applicaton associated with the file extension".

I was hoping I could trap this error with an error variable or with SQLCODE <> 
0 
and then bring up RBEdit, something like the below code, but it doesn't see 
this 
as an error message.   (Note:  I want to use launch because there can be Word 
or 
Excel or PDF files there too)

Any suggestions?

Karen

SET VAR vFilename TEXT = NULL
PLUGINS loadfilenameplus.rbl 'vFilename|fullpath on +     |TITLE Select file to 
display or type it in +     |VIEW_MODE Details |FILTER All Files (*.*)#*.* 

LAUNCH .vFilename
IF SQLCODE <> 0 THEN   (or I tried if xError <> 0)     RBEDIT .vFilename
ENDIF    

Reply via email to