FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Change the REPLACE command
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM

Change the REPLACE command

Posted: Mon Oct 18, 2010 04:39 PM
Hi, I need to change the replace command to add a function when he is executed.
Code (fw): Select all Collapse
   #command REPLACE [ <f1> WITH <x1> [, <fn> WITH <xn>] ]                  ;
            [FOR <for>]                                                    ;
            [WHILE <while>]                                                ;
            [NEXT <next>]                                                  ;
            [RECORD <rec>]                                                 ;
            [<rest:REST>]                                                  ;
            [ALL]                                                          ;
                                                                           ;
         => DBEval(                                                        ;
                    {|| _FIELD-><f1> := <x1> [, _FIELD-><fn> := <xn>]},    ;
                    <{for}>, <{while}>, <next>, <rec>, <.rest.>            ;
                  )

   #command REPLACE <f1> WITH <v1> [, <fN> WITH <vN> ]                     ;
         => _FIELD-><f1> := <v1> [; _FIELD-><fN> := <vN>]

I need to change to something like that:
=> If (  <f1>  = "RESGISTRO" .Or. <fn> = "RESGISTRO",;
                        _FIELD-><f1> := <v1> [; _FIELD-><fN> := <vN>],;
                        _FIELD-><f1> := <v1> [; _FIELD-><fN> := <vN>];
                        REGISTRA())
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2

Continue the discussion