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.

  • "george karrar" is male
  • "george karrar" started this thread

Posts: 5

Date of registration: Sep 26th 2011

Location: Preveza

Occupation: Photographer - Programmer

  • Send private message

1

Monday, September 26th 2011, 6:10pm

Empty String

I have just 2 textbox and a command button on a form. This programm run as a VB program. I do a test on jabaco and I found this:
An unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will be shut down.

java.lang.NumberFormatException: empty String

May be wrong variable initialisation!(this program do a conversion from Greek letters to latin letters utilized a select case, reducing letters)
Private Sub Command1_Click()
Text1(1).Text = ""
a$ = ""
c$ = Text1(0).Text
b$ = ""
c$ = ""
e$ = ""
k = False
If Text1(0).Text <> "" Then
mtop = Len(Text1(0).Text)
i = 0
While i < mtop
k = False
i = i + 1
e$ = Mid$(Text1(0).Text, i, 1)
a$ = LCase(e$)
k = Not (a$ = e$)
Select Case a$
Case "α"
If i < mtop Then
If LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ι" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ί" Then
i = i + 1
b$ = "e"
ElseIf LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "υ" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ύ" Then
If i < mtop - 1 Then
Select Case LCase$(Mid$(Text1(0).Text, i + 2, 1))
Case "κ", "π", "τ", "χ", "φ", "θ", "σ", "ξ", " "
b$ = "af"
Case Else
b$ = "av"
End Select
Else
b$ = "af"
End If
i = i + 1
Else
b$ = "a"
End If
Else
b$ = "a"
End If
Case "ά"
b$ = "a"
Case "β"
b$ = "v"
Case "γ"
If i < mtop Then
If Mid$(Text1(0).Text, i + 1, 1) = "γ" Then
i = i + 1
b$ = "gq"
Else
b$ = "g"
End If
Else
b$ = "g"
End If
Case "δ"
b$ = "d"
Case "ε"
If i < mtop Then
If LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ι" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ί" Then
i = i + 1
b$ = "i"
ElseIf LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "υ" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ύ" Then
If i < mtop - 1 Then
Select Case LCase$(Mid$(Text1(0).Text, i + 2, 1))
Case "κ", "π", "τ", "χ", "φ", "θ", "σ", "ξ", " "
b$ = "ef"
Case Else
b$ = "ev"
End Select
Else
b$ = "ef"
End If
i = i + 1
Else
b$ = "e"
End If
Else
b$ = "e"
End If
Case "έ"
b$ = "e"
Case "ζ"
b$ = "x"
Case "η", "ι", "υ", "ή", "ί", "ύ", "ϊ", "ΐ", "ϋ", "ΰ"
b$ = "i"
Case "ο"
If i < mtop Then
If LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ι" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ί" Then
i = i + 1
b$ = "i"
ElseIf LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "υ" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "ύ" Then
i = i + 1
b$ = "u"
Else
b$ = "ο"
End If
Else
b$ = "ο"
End If
Case "ω", "ό", "ώ"
b$ = "ο"
Case "ρ"
If i < mtop Then
If Mid$(Text1(0).Text, i + 1, 1) = "ρ" Then
i = i + 1
End If
End If
b$ = "r"
Case "σ", "ς"
If i < mtop Then
If Mid$(Text1(0).Text, i + 1, 1) = "σ" Then
i = i + 1
End If
End If
b$ = "s"
Case "λ"
If i < mtop Then
If Mid$(Text1(0).Text, i + 1, 1) = "λ" Then
i = i + 1
End If
End If
b$ = "l"
Case "μ"
If i < mtop Then
If Mid$(Text1(0).Text, i + 1, 1) = "μ" Then
i = i + 1
End If
End If
b$ = "m"
Case "ν"
If i < mtop Then
If Mid$(Text1(0).Text, i + 1, 1) = "ν" Then
i = i + 1
End If
End If
b$ = "n"
Case "π"
If i < mtop Then
If Mid$(Text1(0).Text, i + 1, 1) = "π" Then
i = i + 1
End If
End If
b$ = "p"
Case "κ"
If i < mtop Then
If Mid$(Text1(0).Text, i + 1, 1) = "κ" Then
i = i + 1
End If
End If
b$ = "q"
Case "θ"
b$ = "z"
Case "ξ"
b$ = "j"
Case "τ"
b$ = "t"
Case "φ"
b$ = "f"
Case "χ"
b$ = "k"
Case "ψ"
b$ = "c"
Case Else
b$ = a$
End Select
If k Then
c$ = c$ + UCase$(Left$(b$, 1)) + Mid$(b$, 2)
Else
c$ = c$ + b$
End If
Wend
Text1(1).Text = c$
End If
End Sub

  • "george karras" is male
  • "george karras" started this thread

Posts: 5

Date of registration: Sep 26th 2011

Location: Preveza

Occupation: Photographer - Programmer

  • Send private message

2

Monday, September 26th 2011, 6:43pm

I found the bugs,
Dim e$ ' at second line..a$ or b$ or c$ not needed to have a Dim statement ????



If k Then
c$ = c$ + UCase$(Left$(b$, 1)) + Mid$(b$, 2)
Else
c$ = c$ + b$
End If



' You see I replace + with & and the scrip works...' with + perform nymper addition and gives 0.0 to C$ at line "C$=C$+B$"
so this is the right script (see the + symbol is good before MID$
If k Then
c$ = c$ & UCase$(Left$(b$, 1)) + Mid$(b$, 2)
Else
c$ = c$ & b$
End If

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

3

Monday, September 26th 2011, 6:52pm

Don't know, if it works correct. But your code without exception:

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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
Private Sub Command1_Click()
Text1(1).Text = ""
Dim a As String = ""
Dim c As String = Text1(0).Text   ' here you define c
Dim b As String = ""
c = ""  ' and here you makes the string empty
Dim E As String = ""
Dim k As Boolean = False
If Text1(0).Text <> "" Then
  Dim mtop As Integer = Len(Text1(0).Text)
  Dim i As Integer = 0
  While i < mtop
    k = False
    i = i + 1
    e = Mid$(Text1(0).Text, i, 1)
    a = LCase(e)
    k = Not (a = e)
    Select Case a
      Case "a"
        If i < mtop Then
          If LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Then
            i = i + 1
            b = "e"
          ElseIf LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Then
          If i < mtop - 1 Then
            Select Case LCase$(Mid$(Text1(0).Text, i + 2, 1))
              Case "?", "p", "t", "?", "f", "?", "s", "?", " "
                b = "af"
              Case Else
                b = "av"
            End Select
          Else
            b = "af"
          End If
            i = i + 1
          Else
            b = "a"
          End If
        Else
        b = "a"
        End If
      Case "?"
        b = "a"
      Case "ß"
        b = "v"
      Case "?"
        If i < mtop Then
          If Mid$(Text1(0).Text, i + 1, 1) = "?" Then
            i = i + 1
            b = "gq"
          Else
            b = "g"
          End If
        Else
          b = "g"
        End If
      Case "d"
        b = "d"
      Case "e"
        If i < mtop Then
          If LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Then
            i = i + 1
            b = "i"
          ElseIf LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Then
            If i < mtop - 1 Then
              Select Case LCase$(Mid$(Text1(0).Text, i + 2, 1))
                Case "?", "p", "t", "?", "f", "?", "s", "?", " "
                  b = "ef"
                Case Else
                  b = "ev"
              End Select
            Else
              b = "ef"
            End If
              i = i + 1
          Else
            b = "e"
          End If
        Else
          b = "e"
        End If
      Case "?"
        b = "e"
      Case "?"
        b = "x"
      Case "?", "?", "?", "?", "?", "?", "?", "?", "?", "?"
        b = "i"
      Case "?"
        If i < mtop Then
          If LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Then
            i = i + 1
            b = "i"
          ElseIf LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Or LCase$(Mid$(Text1(0).Text, i + 1, 1)) = "?" Then
            i = i + 1
            b = "u"
          Else
            b = "?"
          End If
        Else
          b = "?"
        End If
      Case "?", "?", "?"
        b = "?"
      Case "?"
        If i < mtop Then
          If Mid$(Text1(0).Text, i + 1, 1) = "?" Then
            i = i + 1
          End If
        End If
        b = "r"
      Case "s", "?"
        If i < mtop Then
          If Mid$(Text1(0).Text, i + 1, 1) = "s" Then
            i = i + 1
          End If
        End If
        b = "s"
      Case "?"
        If i < mtop Then
          If Mid$(Text1(0).Text, i + 1, 1) = "?" Then
            i = i + 1
          End If
        End If
        b = "l"
      Case "µ"
        If i < mtop Then
          If Mid$(Text1(0).Text, i + 1, 1) = "µ" Then
            i = i + 1
          End If
        End If
        b = "m"
      Case "?"
        If i < mtop Then
          If Mid$(Text1(0).Text, i + 1, 1) = "?" Then
            i = i + 1
          End If
        End If
        b = "n"
      Case "p"
        If i < mtop Then
          If Mid$(Text1(0).Text, i + 1, 1) = "p" Then
            i = i + 1
          End If
        End If
        b = "p"
      Case "?"
        If i < mtop Then
          If Mid$(Text1(0).Text, i + 1, 1) = "?" Then
            i = i + 1
          End If
        End If
        b = "q"
     Case "?"
       b = "z"
     Case "?"
       b = "j"
     Case "t"
       b = "t"
     Case "f"
       b = "f"
     Case "?"
       b = "k"
     Case "?"
       b = "c"
     Case Else
       b = a
   End Select
   If k Then
     c = c + UCase$(Left$(b, 1)) + Mid$(b, 2)
   Else
     c = c + b
   End If
  Wend
  Text1(1).Text = c
  End If
End Sub


Edit: I haven't your font installed for Jabaco. So sadly some of your characters are replaces with an question mark.

This post has been edited 1 times, last edit by "theuserbl" (Sep 26th 2011, 6:58pm)


  • "george karras" is male
  • "george karras" started this thread

Posts: 5

Date of registration: Sep 26th 2011

Location: Preveza

Occupation: Photographer - Programmer

  • Send private message

4

Wednesday, September 28th 2011, 1:26am

Jabaco works great with Greek letters.
The program has no meaning for someone who cannot understand greek language.But this was a simple program to test jabaco.
As you see, I found the bugs...I have VB5 and jabaco in a notebook. Its very hard for anyone to make jabaco to act as VB. But jabaco is a rapid application developer...with a VB style of programming.
George

Rate this thread
WoltLab Burning Board