You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

  • "StefanSchnell" is male
  • "StefanSchnell" started this thread

Posts: 102

Date of registration: Mar 13th 2009

Location: Oberirsen - Germany

Occupation: Senior Software Engineer

Hobbies: Programming aund Photography

  • Send private message

1

Sunday, May 24th 2009, 12:33pm

How to use a simple debug class

Hello community,
Sysinternals is a very good source for advanced system utilities and technical informations. Look at miscellaneous utitilities and DebugView. "This program intercepts calls made to DbgPrint by device drivers and OutputDebugString made by Win32 programs. It allows for viewing and recording of debug session output on your local machine or across the Internet without an active debugger." It is one of my favorite programs to view variables, state of programs or something else. I think it is a good addition to any log solution - look here. So I create a small class to use the Debug.Print or Debug.Output command as you know it in VB:

Jabaco Source

1
2
3
4
'-Output to console- 
  Debug.Print "Dies ist ein Test" 
'-Output to DebugView- 
  Debug.Output "Dies ist ein Test"

The class is very simple and it is nothing more to do as embedd it via F1 in Jabaco:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//-Begin----------------------------------------------------------------
  /**
   * @(#)Debug.java
   *
   * @author Stefan Schnell
   * @version 0.01 09/05/24
   */
  import com.eaio.nativecall.*;
  public class Debug
    {
      static
        {
          try
            {
              NativeCall.init();
            }
          catch (Exception ex)
            {
 
            }
        }
      //-Procedure OutputDebugString------------------------------------
        private static void OutputDebugString(String Text)
          {
            VoidCall OutputDebugStringA = new VoidCall("kernel32.dll", 
              "OutputDebugStringA");
            OutputDebugStringA.executeCall(new Object[] {Text});
            OutputDebugStringA.destroy();
          }
      //-Procedure Output-----------------------------------------------
        public void Output(String Text)
          {
            if (Text.length () > 256)
              {
                Text = Text.substring(0, 256);
              }  
            OutputDebugString(Text);
          }
    
      //-Procedure Print------------------------------------------------
        public void Print(String Text)
          {
            java.lang.System.out.println(Text);
          }
    
  }
//-End------------------------------------------------------------------

Cheers
Stefan
Visit my personal or commercial site
If you have questions or suggestions, write me an eMail or
meet me here

This post has been edited 1 times, last edit by "StefanSchnell" (Aug 2nd 2009, 7:56am)


  • "StefanSchnell" is male
  • "StefanSchnell" started this thread

Posts: 102

Date of registration: Mar 13th 2009

Location: Oberirsen - Germany

Occupation: Senior Software Engineer

Hobbies: Programming aund Photography

  • Send private message

2

Sunday, August 2nd 2009, 8:01am

New update version available

Hello community,
after the new version of Jabaco, with the new Debug class, here the updated version - renamed to DebugExt and a little modification in the interface.
Cheers
Stefan
StefanSchnell has attached the following file:
  • debug.zip (2.99 kB - 373 times downloaded - latest: Aug 9th 2019, 8:03pm)
Visit my personal or commercial site
If you have questions or suggestions, write me an eMail or
meet me here

Rate this thread
WoltLab Burning Board