Página 1 de 1

Own objects in debugger

Publicado: Jue May 10, 2007 7:13 pm
por Gejza Horvath
Hi,
I'm using my own classes linked from my library. It works fine, but I can't inspect this
object created from my class. The Inspect variable window displays a closed TreeView item
and double clicking on it doesn't expand it.
Any advise?
Gejza Horvath

Own objects in debugger

Publicado: Jue May 10, 2007 7:55 pm
por ignacio
Gejz,
In order to see your own class members you must use the command PROPERTY
instead of DATA.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
news:[email=46435338@ozsrv2.ozlan.local...]46435338@ozsrv2.ozlan.local...[/email]
> Hi,
>
> I'm using my own classes linked from my library. It works fine, but I
> can't inspect this object created from my class. The Inspect variable
> window displays a closed TreeView item and double clicking on it doesn't
> expand it.
> Any advise?
>
> Gejza Horvath
>

Own objects in debugger

Publicado: Jue May 10, 2007 8:03 pm
por jfgimenez
Gejza,
> In order to see your own class members you must use the command PROPERTY
> instead of DATA.
Also, derive your classes from TComponent.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

Own objects in debugger

Publicado: Vie May 11, 2007 3:18 pm
por Gejza Horvath
Thanks,
this works fine, but a little problem. In class declaration i have:
CLASS GenFile FROM TComponent
PUBLISHED:
PROPERTY Size INIT 0
PROPERTY Position INIT 0
PROPERTY Bof INIT .T.
PROPERTY Eof INIT .T.
PROPERTY Err INIT 0
PROPERTY Handle
PROPERTY Name
PROPERTY FullName
PROPERTY Extension
PROPERTY BytesToRead INIT 2048
PROPERTY Date INIT CTOD(SPACE(8))
PROPERTY Time
PROPERTY Path
PROPERTY Drive
PROPERTY FileName
..
..
ENDCLASS
*************************
METHOD New(cFname) CLASS GenFile
..
..
..
WITH OBJECT Self
:Extension := SUBSTR(cFname,nPosDot + 1)
:Name := cFileName // Nazov suboru bez cesty ale s rozsirenim
:FullName := :Drive + :Path + :Name // plny nazov
:Date := FILEDATE(:FullName)
:Time := FILETIME(:FullName)
:Size := FILESIZE(:FullName)
:Handle := 0
:Position := 0
:BytesToread := 0
:Bof := .T.
:Eof := .T.
:FileName := TFileName():New(:FullName)
END WITH
..
..
RETURN Self
************************
CLASS TxtFile FROM GenFile
PUBLISHED:
PROPERTY Delimiter INIT CHR(13)+CHR(10) // oddelovac riadkov
PROPERTY LineNum INIT 1 // cislo Riadku, na ktorom stojime
PROPERTY LineLen INIT 255 // Dlzka riadku
METHOD New // Velkost bloku bude riadok
METHOD ReadLn // Nacitaj N riadkov
METHOD WriteLn
METHOD Open
METHOD Close
ENDCLASS
********************************
The TxtFile is a subclass of the GenFile class. I'm using this class to read a text file
line by line and show it in MemoEdit:
..
..
oFile := TxtFile():New("D:projektmulti.prg")
oFile:Open()
DO WHILE ! oFile:Eof
cLine := oFile:ReadLn()
::oMemo1:Value += cLine + CRLF
ENDDO
oFile:Close()
..
..
I have problem with property FileName, which is a standard Xailer class. In the Inspect
variable window now all the oFile variable properties are visible, the Filename displays
object of class TFileName, but I can't expand it double clicking on it, to show his
properties. Any advise?
Gejza Horvath

Own objects in debugger

Publicado: Vie May 11, 2007 7:34 pm
por ignacio
Gejza,
TFileName() class does not have any DATA members, all are methods.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
news:[email=46446d7d@ozsrv2.ozlan.local...]46446d7d@ozsrv2.ozlan.local...[/email]
> Thanks,
> this works fine, but a little problem. In class declaration i have:
>
> CLASS GenFile FROM TComponent
> PUBLISHED:
> PROPERTY Size INIT 0
> PROPERTY Position INIT 0
> PROPERTY Bof INIT .T.
> PROPERTY Eof INIT .T.
> PROPERTY Err INIT 0
> PROPERTY Handle
> PROPERTY Name
> PROPERTY FullName
> PROPERTY Extension
> PROPERTY BytesToRead INIT 2048
> PROPERTY Date INIT CTOD(SPACE(8))
> PROPERTY Time
> PROPERTY Path
> PROPERTY Drive
>
> PROPERTY FileName
> .
> .
> ENDCLASS
> *************************
> METHOD New(cFname) CLASS GenFile
> .
> .
> .
>
> WITH OBJECT Self
> :Extension := SUBSTR(cFname,nPosDot + 1)
> :Name := cFileName // Nazov suboru bez cesty ale s
> rozsirenim
> :FullName := :Drive + :Path + :Name // plny nazov
> :Date := FILEDATE(:FullName)
> :Time := FILETIME(:FullName)
> :Size := FILESIZE(:FullName)
> :Handle := 0
> :Position := 0
> :BytesToread := 0
> :Bof := .T.
> :Eof := .T.
> :FileName := TFileName():New(:FullName)
> END WITH
> .
> .
> RETURN Self
> ************************
>
> CLASS TxtFile FROM GenFile
> PUBLISHED:
> PROPERTY Delimiter INIT CHR(13)+CHR(10) // oddelovac riadkov
> PROPERTY LineNum INIT 1 // cislo Riadku, na ktorom stojime
> PROPERTY LineLen INIT 255 // Dlzka riadku
>
>
> METHOD New // Velkost bloku bude riadok
> METHOD ReadLn // Nacitaj N riadkov
> METHOD WriteLn
> METHOD Open
> METHOD Close
>
> ENDCLASS
> ********************************
>
>
> The TxtFile is a subclass of the GenFile class. I'm using this class to
> read a text file line by line and show it in MemoEdit:
> .
> .
> oFile := TxtFile():New("D:projektmulti.prg")
> oFile:Open()
> DO WHILE ! oFile:Eof
> cLine := oFile:ReadLn()
> ::oMemo1:Value += cLine + CRLF
> ENDDO
> oFile:Close()
> .
> .
>
> I have problem with property FileName, which is a standard Xailer class.
> In the Inspect variable window now all the oFile variable properties are
> visible, the Filename displays object of class TFileName, but I can't
> expand it double clicking on it, to show his properties. Any advise?
>
>
> Gejza Horvath
>