Hi Bill,
maybe you meant to:
resp←(∼∧\ans='
')/ans
instead of:
resp←(∧\ans≠'
')/ans
to discard the leading blanks? Like in:
⎕CR 'prompt'
resp←prompt pr
⍝ Subroutine to prompt for user input.
⍞←pr
ans←⍞
'ans is:' ans
resp←(∼∧\ans=' ')/ans
'resp is:' resp
prompt '<-prompt->'
<-prompt-> the answer
ans is: the answer
resp is: the answer
the answer
Best regards,
/// Jürgen
On 6/12/19 8:06 PM, Bill Daly wrote:
I'm
sending thee a workspace created after I encountered an error in
function prompt. I've also included a log of how I encountered
the error.
The next to last command, ⍞←wp∆txt∆assemble invpr displays a
report. All of the heading data except the time stamp were input
using the function call: invpr←wp∆init 'Target'. The following
lines show that interactive session, including the line: Title of
workpaper Target Investments
The report shows the first letter was some how dropped. My
debugging has shown that this occurs in the function prompt:
∇resp←prompt pr;test;sink;ans
⍝ Subroutine to prompt for user input.
sink←⍞←pr
ans←⍞
test←(∧\ans≠' ')/ans
→(utl∆numberp test←prompt∆keys ans)/kw
resp←ans
→0
kw:
resp←test
→0
∇
After executing line 3 having executed: prompt 'Title of
workpaper ', ans was 'arget Investments'.
I am as always
Confused In Langhorne
|