Hi Terry,
STRPCCMD issues a command to your 5250 emulator, telling the emulator
(which is, after all, a Windows program) to run a command on the PC.
The length of the command string that you can send to STRPCCMD is 123,
because it sends the command to the PC in the form of a green screen
field that's 128 chars long. It uses 5 characters to pass options to
the emulator, and the remaining 123 are the command. The emulator
understands (thanks to the 5 characters) that this is a command, and
should be run instead of displaying it to the user -- but under the
covers it's really just a screen with a 128 character field on it.
So it's STRPCCMD that's limited to 123 characters. Not the DOS "start"
utility (which doesn't have any limit that I know of)
When the emulator receives the command, it parses out the program name
(by searching for the first space in the command string). It finds that
program on disk -- and if it's a native Windows program, it tells
Windows to run it. If it's not a native Windows program, it's assumed
to be an MS-DOS program, so it opens a DOS prompt and runs the command
from that prompt.
The problem with the DOS prompt is that some characters have special
meanings. The ampersand, that's the & symbol, is one of the characters
that has a special meaning. Semi-colons, carets, quotes, spaces, and a
bunch of other things have a special meanings as well. You either need
to escape these special characters, or you need to find a way to avoid
sending the command string through a DOS prompt.
Walden's answer works by escaping the special characters. Putting a
caret, i.e. the ^ symbol, before each ampersand tells MS-DOS not to
treat them as special characters.
Bob Roche's answer launches a Windows program named RunDLL32. Since this
is a Windows program, it never goes to a DOS prompt, and therefore
characters that are special in MS-DOS aren't an issue.
Personally, I prefer the RUNDLL32 option because it doesn't open the
stupid black MS-DOS window where the user can see it -- which I find
ugly -- and also because I don't have to write code that searches for
special characters and escapes them.
Terry Anderson wrote:
Greetings List,
I hope all of you had a merry Christmas and have a happy and
prosperous new year.
Here is what I am trying to do. I have a CGIDEV2 program that adds
footnotes to an RFQ. Since several divisions will be using this
program, I need to send the division name as well as the RFQ number
to the CGI program.
I have the following commands in my CL program:
CHGVAR VAR(&PCCOMMAND) VALUE('START
http://xx.xx.xxx.xx:8014/citcgidevp/GETDIV2?division=' *TCAT
&DIVISION *TCAT '&qstrat_rfq=' *TCAT &QLMRFQ#)
STRPCCMD PCCMD(&PCCOMMAND) PAUSE(*NO)
I can get this to work if I key it into the command line of the
browser but not when I call it from the CL. Can some one tell me
what I am doing wrong? I saw an older post somewhere that said that
the START command was limited to 123 characters. Is that correct and
if so, how do you get around this limitation?