Page 1 of 2

Run time error base/1449

Posted: Thu Jun 04, 2020 3:50 pm
by Paramvir
I defined a modal window in a function which is invoked from other procedure. When I invoke this modal window to display text message in an editbox, the function runs fine for some time, then after a minute or two, out of nowhere, a run time error occurs. Please see the image file attached. Error code sometimes changes like argument error, conditional error etc. Sometimes, no error comes up for sometime. In this instance, I opened the HMG source file h_EventCB.prg and, as indicated by the runtime error window, I find in line 159 (where the cursor is in the image) the error. I fail to understand what causes this and how to rectify this. I request the experts here to help in this regard. Thank you all.

Re: Run time error base/1449

Posted: Thu Jun 04, 2020 4:26 pm
by dragancesu

Re: Run time error base/1449

Posted: Thu Jun 04, 2020 4:40 pm
by Paramvir
Thank you Dragancesu for your prompt attention and reply. I would like to go through this guide. There is one thing that the error as indicated by the system, belongs to a file which is HMG source file. I have gone through my own prg files and could not locate this syntax error (&). Thank you once again.

Re: Run time error base/1449

Posted: Thu Jun 04, 2020 5:39 pm
by mol
Try to investigate sources of hmg. Sometimes it helps

Re: Run time error base/1449

Posted: Thu Jun 04, 2020 6:10 pm
by dragancesu
use &varvar

monitors the value via a debugger the value of the varvar variable

maybe it's empty, maybe it's pointing to a variable / function that doesn't exist, mostly an incorrect value

see the value of the variable that occurs in line 2722

without insight into the source we can only look at the crystal ball

Re: Run time error base/1449

Posted: Thu Jun 04, 2020 11:00 pm
by AUGE_OHR
hi,
Paramvir wrote: Thu Jun 04, 2020 3:50 pm ... I find in line 159 (where the cursor is in the image) the error.
it does not help to show "System-Error" produce by "your Code" ...

you have to go back Error-List until you reach "your Code" and 1 Step back.
between there both Points you get a Error where you can use

Code: Select all

   bError := ERRORBLOCK( { | oErr | BREAK( oErr ) } )
   BEGIN SEQUENCE
      // Code
   RECOVER USING oError
      ERRORBLOCK( bError )
      MsgStop( "Operation: " + oError:Operation + " - Description: " + oError:Description, "Error" )
      RETURN
   END SEQUENCE
   ERRORBLOCK( bError )
show us "your Code" where it begin and we can help more

Re: Run time error base/1449

Posted: Fri Jun 05, 2020 2:28 am
by Paramvir
Thank you Auge_Ohr, Mol and Dragancesu for all the help.

I give below the code of the function DISP_WIN1_MODAL. Line 2722 refers to the line ACTIVATE WINDOW Form_1 and this function is invoked from the procedure readmem and line 2272 is where the function is invoked. The run time error comes after a few seconds or even minutes when the modal window is active. Sometimes it does not come even after a long time. So something in the background happens.

Code: Select all

FUNCTION DISP_WIN1_MODAL          

PARAMETER CCCATEXT

CCCSTRING=CCCATEXT                  

CCTXT2=" "
TXT3=" "
CCTXT2:=ALLTRIM(NAM)+" BORN: "+PDATEX1
TXT3:="NUMEROLOGY FORECAST REPORT"+ "   ALPHABET SYSTEM: "+ MALPHAX



DEFINE WINDOW Form_1               ;    
      AT 90,90                        ;
      WIDTH 930                       ;
      HEIGHT 650                      ;
      TITLE "HEAD NUMEROLOGIST"    ;
      WINDOWTYPE MODAL ;
      BACKCOLOR {255,255,255} ;
      SIZABLE .F.   ;
   

@ 04, 30 LABEL ALabel1 PARENT Form_1     ;  
      WIDTH 860                             ;
      HEIGHT 28                             ;
      FONT "Lucida Console" SIZE 14 BOLD   ;
      BACKCOLOR { 204, 0, 170}      ;    // DEEP MAGENTA
      FONTCOLOR { 255,255,255}        ;
      VALUE  txt3 ;
      CENTERALIGN

@ 25, 30 LABEL BLabel1 PARENT Form_1     ;
      WIDTH 860                             ;
      HEIGHT 26                             ;
      FONT "Lucida Console" SIZE 14  BOLD  ;
      BACKCOLOR { 192, 0, 128}     ;    // PURPLE
      FONTCOLOR { 0,255,255}       ;    // cyan    
      VALUE  cctxt2 ;
      CENTERALIGN


   @ 45,30 EDITBOX editor     ;
      PARENT Form_1           ;
      WIDTH 860               ;
      HEIGHT 545              ;
      FONTCOLOR {0,0,0}     ;
      BACKCOLOR {255,255,255} ; 
      DISABLEDBACKCOLOR {255,255,240} ;
      DISABLEDFONTCOLOR {40,40,40} ;
      FONT "Lucida Console" SIZE 14  ;
      VALUE CCCSTRING ;
      READONLY;
      NOHSCROLL


 ON KEY ESCAPE ACTION Form_1.Release
 
    END WINDOW

CENTER WINDOW Form_1

ACTIVATE WINDOW Form_1   // line 2722

RETURN NIL




PROCEDURE READMEM

SAVE SCREEN TO SCR_MEM

CCATEXT=" "
CCATEXT:=FINAL_DATA

DISP_WIN1_MODAL(CCATEXT)    // line 2272

......


Thank you all.

Re: Run time error base/1449

Posted: Fri Jun 05, 2020 2:46 am
by AUGE_OHR
hi,

Code: Select all

SAVE SCREEN TO SCR_MEM
are you mix Console and GUI :?:

Re: Run time error base/1449

Posted: Fri Jun 05, 2020 3:17 am
by Paramvir
AUGE_OHR wrote: Fri Jun 05, 2020 2:46 am hi,

Code: Select all

SAVE SCREEN TO SCR_MEM
are you mix Console and GUI :?:
Yes, I use
REQUEST HB_GT_WVT_DEFAULT

Re: Run time error base/1449

Posted: Fri Jun 05, 2020 9:16 am
by dragancesu
The program cannot display the window because some variable has no good value

maybe CCTXT2: = ALLTRIM (NAM) + "BORN:" + PDATEX1

if NAM is string and PDATEX1 is a date field then ... NAM + DTOC(pdatex1), all variables must be string