bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] prompting


From: Dr . Jürgen Sauermann
Subject: Re: [Bug-apl] prompting
Date: Wed, 12 Jun 2019 21:18:32 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]