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.

tunleader

Beginner

  • "tunleader" is male
  • "tunleader" started this thread

Posts: 5

Date of registration: Mar 21st 2011

Location: Tunisia

Occupation: Developper

  • Send private message

1

Thursday, March 24th 2011, 10:09am

Class

Hi,
could someone introduce an example of class in Jabaco. I couldn't find one using the search facilty.
So PLZ help.
thx in advance
:)

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Thursday, March 24th 2011, 1:37pm

It might help to look at a sample

Keywords to look for using the search facility: constructor, inheritance, base, parent

Jabaco is supporting an extended class concept compared to VB6.
The extension includes: classes can inherit from other classes, class interfaces

Greetings

A1880

tunleader

Beginner

  • "tunleader" is male
  • "tunleader" started this thread

Posts: 5

Date of registration: Mar 21st 2011

Location: Tunisia

Occupation: Developper

  • Send private message

3

Thursday, March 24th 2011, 9:24pm

Thanks that was helpful.
But is it possible to implement an interface with Jabaco.
sorry for these silly question but I'm a java programmer and my Vb knowledge is about zero but Jabaco seems to be very promising ... .
Hope Jabaco will continue I like it a lot ... . ^^

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

4

Thursday, March 24th 2011, 10:39pm

Here is an example of an interface names "IUReset":

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
Public Function description() As String

End Function

Public Sub reset()

End Sub

Public Function query() As String

End Function


And here is an implementation:

Jabaco Source

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Implements IUCreset

Private initCalls As Integer 
Private dbField As String

Public Sub Init(left As Integer, top As Integer, width As Integer, caption As String, field As String)
   initCalls = initCalls + 1
   
   If initCalls = 1 Then
      dbField = field
      Me.Height = 27
      Me.BackColor = myForm1.BackColor 

      Label1.Caption = " " & caption
      Text1.Text = ""
      
      If field <> "" Then
         Text1.ToolTip = "Textfeld " & caption & " (Datenbankfeld '" & field & "')"
      Else
         Text1.ToolTip = "Textfeld " & caption
      End If

      myForm1.registerUsercontrol Me 
   End If 

   Me.Left = left
   Me.Top = top
   Me.Width = width
   resize
End Sub

Public Function query() As String
   Dim s As String = ""
   Dim t As String = Trim(Text1.Text)
   Dim op As String = "="
   
   If t <> "" Then
      t = Replace(t, "*", "%")
      t = Replace(t, "?", "_")
      
      If (InStr(t, "%") > 0) Or (InStr(t, "_") > 0) Then
         op = "LIKE"
      End If
      
      s = "( " & dbField & " " & op & " '" & t & "' )" & vbCrLf
   End If
   
   query = s
End Function

Public Function description() As String
   Dim s As String = ""
   Dim t As String = Trim(Text1.Text)
   
   If t <> "" Then      
      s = Trim(Label1.Caption) & " = '#MA" & t & "#MB'"
   End If
   
   description = s
End Function

Private Sub resize()
   Const xGap = 5
   Const yGap = 5
   Const h = 17

   Label1.Width = (Me.Width - 2 * xGap) / 2
   Label1.Left = 0
   Text1.Left = Label1.Left + Label1.Width + xGap
   Text1.Width = Label1.Width - Picture1.Width - 2 * xGap
   Picture1.Left = Me.Width - Picture1.Width - xGap
   
   Label1.Height = h
   Text1.Height = h
   
   Label1.Top = yGap
   Text1.Top = Label1.Top
   Picture1.Top = Label1.Top + (h - Picture1.Height)/2
End Sub

Public Sub Picture1_Click()
   reset
End Sub

Public Sub reset
   Text1.Text = ""
End Sub


Greetings!

A1880

Rate this thread
WoltLab Burning Board