would someone be so kind to explain the difference of
oWdn:Say
and the SAY class.
oSay is repainted automatically what does this mean for the memory usage.
Thanks in advance
Otto
oWdn:Say - SAY class
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: oWdn:Say - SAY class
oWnd:Say() is just a text printed on the specified window while TSay is a real control. And yes, it surely uses more resources but I wouldn't care.Otto wrote:would someone be so kind to explain the difference of
oWdn:Say
and the SAY class.
oSay is repainted automatically what does this mean for the memory usage.
Thanks in advance
Otto
EMG
Hello Enrico,
thank you.
But memory seems to be a problem. See my test - prg.
Maybe I call it the wrong way.
But if you call the test function with oSay more times the program crashes.
Regards,
Otto
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
STATIC n
function Main()
local oWnd, oFont
N:=1
DEFINE FONT oFont NAME "Arial" SIZE 20, 30
DEFINE WINDOW oWnd FROM 1, 1 TO 30, 80 TITLE "Testing Method Say()"
@ 1, 1 BUTTON " oWnd : Say " OF oWnd SIZE 60, 25 ;
ACTION test2(oWnd,oFont)
@ 1, 30 BUTTON " oSay " OF oWnd SIZE 60, 25 ;
ACTION test(oWnd,oFont)
ACTIVATE WINDOW oWnd MAXIMIZED
RELEASE FONT oFont
return
//----------------------------------------------------------------------------//
func test(oWnd,oFont)
LOCAL I:=0
FOR N := 1 TO 60 STEP 2
FOR I := 1 TO 200 STEP 4
@ n,I SAY ALLTRIM(STR(i))+" ." OF oWnd FONT ofont COLORS nRGB( 255, 0, 0 ) , nRGB( 55, 55, 255)
NEXT
NEXT
msginfo("ENDE")
return nil
func test2(oWnd,oFont)
LOCAL I:=0
FOR N := 1 TO 60 STEP 2
FOR I := 1 TO 200 STEP 4
oWnd:Say( n, I, ALLTRIM(STR(i))+" .", nRGB( 255, 0, 0 ) , nRGB( 255, 2255, 255),oFont )
NEXT
NEXT
msginfo("ENDE")
return nil
thank you.
But memory seems to be a problem. See my test - prg.
Maybe I call it the wrong way.
But if you call the test function with oSay more times the program crashes.
Regards,
Otto
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
STATIC n
function Main()
local oWnd, oFont
N:=1
DEFINE FONT oFont NAME "Arial" SIZE 20, 30
DEFINE WINDOW oWnd FROM 1, 1 TO 30, 80 TITLE "Testing Method Say()"
@ 1, 1 BUTTON " oWnd : Say " OF oWnd SIZE 60, 25 ;
ACTION test2(oWnd,oFont)
@ 1, 30 BUTTON " oSay " OF oWnd SIZE 60, 25 ;
ACTION test(oWnd,oFont)
ACTIVATE WINDOW oWnd MAXIMIZED
RELEASE FONT oFont
return
//----------------------------------------------------------------------------//
func test(oWnd,oFont)
LOCAL I:=0
FOR N := 1 TO 60 STEP 2
FOR I := 1 TO 200 STEP 4
@ n,I SAY ALLTRIM(STR(i))+" ." OF oWnd FONT ofont COLORS nRGB( 255, 0, 0 ) , nRGB( 55, 55, 255)
NEXT
NEXT
msginfo("ENDE")
return nil
func test2(oWnd,oFont)
LOCAL I:=0
FOR N := 1 TO 60 STEP 2
FOR I := 1 TO 200 STEP 4
oWnd:Say( n, I, ALLTRIM(STR(i))+" .", nRGB( 255, 0, 0 ) , nRGB( 255, 2255, 255),oFont )
NEXT
NEXT
msginfo("ENDE")
return nil
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Yes, because you are creating more and more TSay objects while one would be enough. Once created you can simply refresh it or change its text.Otto wrote:Hello Enrico,
thank you.
But memory seems to be a problem. See my test - prg.
Maybe I call it the wrong way.
But if you call the test function with oSay more times the program crashes.
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact: