PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Douglas McDonald on January 28, 2013, 04:17:32 PM

Title: Ztrace
Post by: Douglas McDonald on January 28, 2013, 04:17:32 PM
I know Ztrace is not really a part of FF  but maybe I can get an answer. Does ztrace have a problem with types or vars assigned from types?

'Type Test_struct
'    StepNr As String * 10
'    Relay As Relays
'    AD   As ADC
'   
'End Type

        ts(j-1).StepNr = testX(j,0) 'get Realys

doesn't      ztrace ts(j-1).StepNr
works       ? ts(j-1).StepNr

if I put it in a temp var:

dim temp as string
     
      temp = ts(j-1).StepNr 
doesn't      ztrace temp
works       ? temp


the same thing goes for  Ztrace str$(xyz.some_Long) doesn't work

ztrace "xzy" ok
ztrace str$(some_number) ok

Is there any documentation on ztrace? I'll look again on Jose's site

Thank you
Doug
     
Title: Re: Ztrace
Post by: Eddy Van Esch on January 28, 2013, 04:29:47 PM
Doug,

This works for me in FF 3.62:
Function FORM1_IMAGEBUTTON1_BN_CLICKED ( _
                                       ControlIndex     As Long,  _  ' index in Control Array
                                       hWndForm         As Dword, _  ' handle of Form
                                       hWndControl      As Dword, _  ' handle of Control
                                       idButtonControl  As Long   _  ' identifier of button
                                       ) As Long
zTrace Str$(hWndControl)
zTrace Str$(hWndControl) + Str$(hWndForm)
End Function

I remember though that zTrace (once) used to require an ASCIIZ string as an argument.
Title: Re: Ztrace
Post by: Eddy Van Esch on January 28, 2013, 04:38:15 PM
Ah, just noticed you wanted variables from types.
That works too:

Function FORM1_IMAGEBUTTON1_BN_CLICKED ( _
                                       ControlIndex     As Long,  _  ' index in Control Array
                                       hWndForm         As Dword, _  ' handle of Form
                                       hWndControl      As Dword, _  ' handle of Control
                                       idButtonControl  As Long   _  ' identifier of button
                                       ) As Long
'Type TestType Dword
'  a As Integer
'  b As Long
'End Type

Dim abcd(4) As TestType
abcd(1).b = -34

MsgBox(Str$(abcd(1).b))
zTrace Str$(abcd(1).b)
zTrace Str$(hWndControl) + Str$(hWndForm)
End Function
Title: Re: Ztrace
Post by: Douglas McDonald on January 28, 2013, 05:19:15 PM
Ok thank I must have something strange going on here. I'll re-download the latest ztrace.

Thank you
Title: Re: Ztrace
Post by: Douglas McDonald on January 28, 2013, 05:38:28 PM
 I'm using ztrace ver 1.52. It looks like you still have to use asciiz strings

zTrace 1.52

Is a small Win32 SDK DLL to display debugging information into a popup window tool, and/or a text file.
zTrace uses a distinct thread to work in parallel of the current application you want to debug.

zTrace is very useful at development time to check whether a program operates properly, it has been modeled onto the WinDev's Trace API.

Declaration:
Code: [Select]

DECLARE FUNCTION zTrace LIB "zTrace.DLL" ALIAS "zTrace" (zMessage AS ASCIIZ) AS LONG

Code: [Select]

DECLARE FUNCTION zDebug LIB "zTrace.DLL" ALIAS "zDebug" (zMessage AS ASCIIZ) AS LONG


Syntax to use:
Code: [Select]

zTrace("StringInformation")

Code: [Select]

zDebug("StringInformation")


I'll have to try your code samples and see whats going on.

Thank you