dpalme
asked on
SNDMSG in CL program
Is there a way to call the sndmsg command without having to pass it all the parameters?
IE: I want to display to the user the sndmsg prompt and let them enter the appropriate values instead of having to write a screen to handle the sending of the message.
IE: I want to display to the user the sndmsg prompt and let them enter the appropriate values instead of having to write a screen to handle the sending of the message.
Murphey's probably shown all you need. If you post what parms you'd like the user to see and/or change, we can provide a clear example. An example would help others in the future (which is a good part of the value of EE).
Tom
Tom
Example:
If you include the next command in a CL, the SNDMSG prompt will show up automatically,
and give the user the posibility to enter the messagetext and the receiver's user ID
SNDMSG ??MSG() ??TOUSR()
BTW if you are on a command prompt screen you can press F13 to see all
details and posibilities of the prompting.
eg. ?SNDMSG wil prompt automatically without using the F4 key
If you include the next command in a CL, the SNDMSG prompt will show up automatically,
and give the user the posibility to enter the messagetext and the receiver's user ID
SNDMSG ??MSG() ??TOUSR()
BTW if you are on a command prompt screen you can press F13 to see all
details and posibilities of the prompting.
eg. ?SNDMSG wil prompt automatically without using the F4 key
ASKER
The CL code I have coded for this is:
if (&fld001 *eq 9) do
? sndmsg
enddo
As long as the user enters some text in the sndmsg screen and enters a user name and sends the message, NO PROBLEM, it works perfectly; however if the user after getting the sndmsg display decides against it and F3's out the program generates an error: CPF 6801.
would changing the command to SNDMSG ??MSG() ??TOUSR() correct this?
if (&fld001 *eq 9) do
? sndmsg
enddo
As long as the user enters some text in the sndmsg screen and enters a user name and sends the message, NO PROBLEM, it works perfectly; however if the user after getting the sndmsg display decides against it and F3's out the program generates an error: CPF 6801.
would changing the command to SNDMSG ??MSG() ??TOUSR() correct this?
ASKER
I guess I answered my own question, it still generates an error.
Any suggestions on how to avoid the 6801 error on this?
Any suggestions on how to avoid the 6801 error on this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can use selective prompting:
E.g.
OVRDBF ?*FILE(FILEA) ??TOFILE(&FILENAME) ??MBR(MBR1)
Result:
?*FILE -- the command is shown with parameter FILE filled but protected
??TOFILE -- the TOFILE is filled with the contents of var &FILENAM but can be updated
??MBR -- the MBR is filled with the constant MBR1 but can be updated
there are more selective prompts to use here they are:
Selective
Prompting
Character Description
?? The parameter is displayed and input-capable.
?* The parameter is displayed but is not input-capable.
Any user-specified value is passed to the command
processing program.
?< The parameter is displayed and is input-capable, but
the command default is sent to the CPP unless the
value displayed on the parameter is changed.
?/ Reserved for IBM use.
?– The parameter is not displayed. The specified value
(or default) is passed to the CPP. Not allowed in
prompt override programs.
?& The parameter is not displayed until F9=All
parameters is pressed. Once displayed, it is
input-capable. The command default is sent to the
CPP unless the value displayed on the parameter is
changed.
?% The parameter is not displayed until F9=All
parameters is pressed. Once displayed, it is not
input-capable. The command default is sent to the
CPP.
(copied from: http://www.code400.com/viewsamples.php?lang_id=2)
Regards,
Murphey