Post Reply 
Help asked: systemRPL ^IFMain question
02-04-2016, 09:16 PM (This post was last modified: 02-04-2016 09:41 PM by brrm.)
Post: #5
RE: Help asked: systemRPL ^IFMain question
(02-04-2016 01:58 AM)DavidM Wrote:  Hope this helps!
- David

It certainly does!

Thank you very much!

When I worked on it I ran into another problem.

When I use your code, it works as desired, but ONLY if I enter the decimal separator to force a real (i.e. type '7.' followed by <SUM>) it gives the correct answer.

If I omit the separator (i.e. type '7' followed by <SUM>) then the result is garbage.

I was able to fix this with CK&DISPATCH1.

The final source code is:
Code:
' ::
  IfMsgGet3KeysMenu OVER#=case ::
    DROP
    { NullMenuKey
      { "CANCL"  :: TakeOver FLASHPTR IfONKeyPress ; }
      { "\8DA+B" :: TakeOver                 ( KeyProcNS for calculation of A+B )
          EditLExists? IT ::
            EDITLINE$ DOSTR>                 ( Get the current edit string and parse it )
            :: CK&DISPATCH1                  ( check type and convert to real if necessary )
                                                        BINT1 :: FLASHPTR IfSetCurrentFieldValue ; ( Set the value obtained as the current field value )
                                                ;
                                          InitEd&Modes                     ( Clear the current EditLine )
          ;
          Field1 FLASHPTR IfGetFieldValue    ( Retrieve A )
          Field2 FLASHPTR IfGetFieldValue    ( Retrieve B )
          %+                                 ( A+B )
          Field3 FLASHPTR IfSetFieldValue    ( Show result on Form )
        ;
                        }
                }
    TRUE                                     ( We handled the message )
  ;        
  DROPFALSE                                  ( We don't handle any other message )
;

Regards bram
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-04-2016 09:16 PM



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