Post Reply 
Help asked: systemRPL ^IFMain question
02-03-2016, 09:23 AM (This post was last modified: 02-03-2016 09:27 AM by brrm.)
Post: #3
RE: Help asked: systemRPL ^IFMain question
(02-02-2016 08:19 PM)wojtek Wrote:  Nobody will know how to help you until you provide a sample of the code you've written

Thanks.

Here's the code of the message handler.
Code:

IfMsgGet3KeysMenu OVER#=case ::
    DROP
    { 
*
* two other key definitions are not shown here for brevity
*      
      { "\8DREV."  ::  ( KeyProcNS for calculation of REV )
         TakeOver
         FLASHPTR IfEnterKeyPress        ( do 'enter' )
         LAM 'Quit ITE ::
            DROP 3DROP                       ( clean the stack )
            FALSE ' LAM 'Quit STO           ( do not quit )
     ; ::
            ( To do: find out how to update the value of the current )
            ( field so only 1 keypress is needed instead of 2 )                            
     ;

         #0 FLASHPTR IfGetFieldValue    ( Retrieve COST )
         #2 FLASHPTR IfGetFieldValue    ( Retrieve Margin )
         100. SWAP %- %/ %10* %10*  ( do computation )
         #1 FLASHPTR IfSetFieldValue     ( show value on Form )
       ; } }
       TRUE                                       ( we handled the message )
    ;    
    DROPFALSE
;

This works, except that following the IfEnterKeyPress, the current field is not updated with the contents of the edit line, so that the previous value of that field is used in the computation. Only after a second keypress the calculation is performed with all the correct values.

I am looking forward to any info on how to solve this.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Help asked: systemRPL ^IFMain question - brrm - 02-03-2016 09:23 AM



User(s) browsing this thread: 1 Guest(s)