My CNC Programm: Too long + NaN + error

Watchkido1

Active Member
Licensed User
Hello

(This is a Google translation from German)

I have a problem with my CNC program.
It is mistaken.
I can not find the error.
I think the formulas are simple. :-(
Also this "NaN" bothers me.
How do I remove it?
I also find that the program is too large.
Does anyone have a tip to shorten it?
I have in the Softwae 200 formulas.
That will be far too long.


Thanks for the help.

Frank

B4X:
'Activity module 



'edtTextRechner



Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim scvMain As ScrollView
   Dim PanelNb As Int               : PanelNb=6
   Dim PanelHeight As Int            : PanelHeight=170dip
   Dim Formel, Text(15,15) As String    : Formel = "Dreieck"
   Dim i As Int
   Dim Zahl(30,30) As Double ': zahl(30,30) = numberformat2(zahl(30,30),1,3,3,false)
   Dim lblCalc(15,15) As Label
   Dim edtCalc(15) As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
   
   Dim pnlCalc(10) As Panel 
   Dim btnCalc As Button
   
   scvMain.Initialize(1500)
   Activity.AddView(scvMain, 0, 0, 100%x, 100%y)

   
   Dreieck ' Labeltexte abholen
         
   For i=0 To PanelNb-1
   

      pnlCalc(i).Initialize("pnlCalc")

      scvMain.Panel.AddView(pnlCalc(i),0,5dip+i*PanelHeight,100%x,PanelHeight+5)
      pnlCalc(i).Tag=i
      If (i Mod 2)=1 Then
         pnlCalc(i).Color=Colors.Red
      Else
         pnlCalc(i).Color=Colors.Blue
      End If
      
      'Benennung
      lblCalc(i,1).Initialize("lblCalc1")
      pnlCalc(i).AddView(lblCalc(i,1),10dip, 5dip, 45%x, 40dip)
      lblCalc(i,1).Tag=i
      lblCalc(i,1).TextSize=20
      lblCalc(i,1).Text= Text(i,1)
      lblCalc(i,1).TextColor = Colors.Black
      lblCalc(i,1).Gravity = Gravity.RIGHT
      
      'Formel 1
      lblCalc(i,2).Initialize("lblCalc1")
      pnlCalc(i).AddView(lblCalc(i,2),10dip, 35dip, 45%x, 40dip)
      lblCalc(i,2).Tag=i
      lblCalc(i,2).TextSize=17
      lblCalc(i,2).Text=Text(i,2)
      lblCalc(i,2).TextColor = Colors.Black
      lblCalc(i,2).Gravity = Gravity.RIGHT
      
      'Formel 2
      lblCalc(i,3).Initialize("lblCalc1")
      pnlCalc(i).AddView(lblCalc(i,3),10dip, 65dip, 45%x, 40dip)
      lblCalc(i,3).Tag=i
      lblCalc(i,3).TextSize=17
      lblCalc(i,3).Text=Text(i,3)
      lblCalc(i,3).TextColor = Colors.Black
      lblCalc(i,3).Gravity = Gravity.RIGHT
      
      
      'Formel 3
      lblCalc(i,4).Initialize("lblCalc1")
      pnlCalc(i).AddView(lblCalc(i,4),10dip, 95dip, 45%x, 40dip)
      lblCalc(i,4).Tag=i
      lblCalc(i,4).TextSize=17
      lblCalc(i,4).Text=Text(i,4)
      lblCalc(i,4).TextColor = Colors.Black
      lblCalc(i,4).Gravity = Gravity.RIGHT
      
      'Formel 4
      lblCalc(i,9).Initialize("lblCalc1")
      pnlCalc(i).AddView(lblCalc(i,9),10dip, 125dip, 45%x, 40dip)
      lblCalc(i,9).Tag=i
      lblCalc(i,9).TextSize=19
      lblCalc(i,9).Text=Text(i,9)
      lblCalc(i,9).TextColor = Colors.Black
      lblCalc(i,9).Gravity = Gravity.RIGHT
      
'----------------------------------------------------------------------------      
      'Eingabefeld
      edtCalc(i).Initialize("edtCalc")
      pnlCalc(i).AddView(edtCalc(i),55%x, 5dip, 35%x, 35dip)'55%x, 70dip, 35%x, 25dip)
      edtCalc(i).Tag=i
      edtCalc(i).TextSize=15
      edtCalc(i).InputType = edtCalc(i).INPUT_TYPE_NONE
      edtCalc(i).Text = 0
'----------------------------------------------------------------------------      
   
      'Ergebnis 1
      lblCalc(i,5).Initialize("lblCalc")
      pnlCalc(i).AddView(lblCalc(i,5),55%x, 40dip, 35%x, 25dip)
      lblCalc(i,5).Tag=i&5
      lblCalc(i,5).TextSize=17
      lblCalc(i,5).Text= Zahl(i,5)
      lblCalc(i,5).Color = Colors.LightGray
      lblCalc(i,5).TextColor = Colors.Black
      lblCalc(i,5).Gravity = Gravity.CENTER_HORIZONTAL
            
      'Ergebnis 2       
      lblCalc(i,6).Initialize("lblCalc")
      pnlCalc(i).AddView(lblCalc(i,6),55%x, 70dip, 35%x, 25dip)
      lblCalc(i,6).Tag=i&6
      lblCalc(i,6).TextSize=17
      lblCalc(i,6).Text=Zahl(i,6)
      lblCalc(i,6).Color = Colors.LightGray
      lblCalc(i,6).TextColor = Colors.Black   
      lblCalc(i,6).Gravity = Gravity.CENTER_HORIZONTAL   
         
      'Ergebnis 3      
      lblCalc(i,7).Initialize("lblCalc")
      pnlCalc(i).AddView(lblCalc(i,7),55%x, 100dip, 35%x, 25dip)
      lblCalc(i,7).Tag=i&7
      lblCalc(i,7).TextSize=17
      lblCalc(i,7).Text=Zahl(i,7)
      lblCalc(i,7).Color = Colors.LightGray
      lblCalc(i,7).TextColor = Colors.Black
      lblCalc(i,7).Gravity = Gravity.CENTER_HORIZONTAL

      'Ergebnis 4   
      lblCalc(i,8).Initialize("lblCalc")
      pnlCalc(i).AddView(lblCalc(i,8),55%x, 130dip, 35%x, 25dip)
      lblCalc(i,8).Tag=i&8
      lblCalc(i,8).TextSize=17
      lblCalc(i,8).Text=Zahl(i,8)
      lblCalc(i,8).Color = Colors.LightGray
      lblCalc(i,8).TextColor = Colors.Black
      lblCalc(i,8).Gravity = Gravity.CENTER_HORIZONTAL


   Next
   

   edtCalc(0).Text  = 90.0 '"Kathete a"
   edtCalc(1).Text = 90.0 '"Kathete b"
   edtCalc(2).Text = 0'"Hypotenuse c"
   edtCalc(3).Text = 0 '"Winkel Alpha"
   edtCalc(4).Text= 0 '"Winkel Beta"
   edtCalc(5).Text= 90.0 '"Winkel Gamma"
   
   For i = 0 To 5
    edtCalc(i).Text = NumberFormat2(edtCalc(i).Text,0,3,3,False)
   Next

   
   scvMain.Panel.Height=PanelNb*PanelHeight+10
   
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub lblCalc_Click ' übernahme der Ergebnisse in edtCalc
   Dim Send As Label
   'Dim i As Int
   Send=Sender
   Activity.Title="Label "&Send.Tag
   i = Send.Tag
   
   Select i
      
      Case 05
         edtCalc(0).Text = lblCalc(0,5).Text
      Case 06
         edtCalc(0).Text = lblCalc(0,6).Text
      Case 07
         edtCalc(0).Text = lblCalc(0,7).Text
'      Case 08
'         edtCalc(0).Text = lblCalc(0,8).Text
      Case 15
         edtCalc(1).Text = lblCalc(1,5).Text
      Case 16
         edtCalc(1).Text = lblCalc(1,6).Text
      Case 17
         edtCalc(1).Text = lblCalc(1,7).Text
      Case 18
         edtCalc(1).Text = lblCalc(1,8).Text   
      Case 25
         edtCalc(2).Text = lblCalc(2,5).Text
      Case 26
         edtCalc(2).Text = lblCalc(2,6).Text
      Case 27
         edtCalc(2).Text = lblCalc(2,7).Text
      Case 28
         edtCalc(2).Text = lblCalc(2,8).Text   
      Case 35
         edtCalc(3).Text = lblCalc(3,5).Text
      Case 36
         edtCalc(3).Text = lblCalc(3,6).Text
      Case 37
         edtCalc(3).Text = lblCalc(3,7).Text
      Case 38
         edtCalc(3).Text = lblCalc(3,8).Text   
      Case 45
         edtCalc(4).Text = lblCalc(4,5).Text
      Case 46
         edtCalc(4).Text = lblCalc(4,6).Text
      Case 47
         edtCalc(4).Text = lblCalc(4,7).Text
      Case 48
         edtCalc(4).Text = lblCalc(4,8).Text   
      Case Else
      Msgbox("Send.Tag = "&Send.Tag, "Probleme in lblCalc_click")
      
      End Select
         
      
         
   
End Sub

Sub btnCalc_Click
   Dim Send As Button
   
   Send=Sender
   Activity.Title="Button "&Send.Tag
End Sub

Sub pnlCalc_Click
   Dim Send As Panel
   
   Send=Sender
   Activity.Title="Panel "&Send.Tag
End Sub

Sub edtCalc_EnterPressed 'Berechnung der Ergebnisse


   Dim a,b,c,α, β, γ,x As Double
   Dim Send As EditText
   
   Send=Sender
   Activity.Title="EditText "&Send.Tag&" = "&Send.Text
   


   a = edtCalc(0).Text '"Kathete a"
   b = edtCalc(1).Text '"Kathete b"
   c = edtCalc(2).Text '"Hypotenuse c"
   α  = edtCalc(3).Text '"Winkel Alpha"
   β = edtCalc(4).Text '"Winkel Beta"
   γ = edtCalc(5).Text '"Winkel Gamma"
   
      
      'Variablen zum "Dreieck"
      
'   edtCalc(0) = '"Kathete a"
'   edtCalc(1) = '"Kathete b"
'   edtCalc(2) = '"Hypotenuse c"
'   edtCalc(3) = '"Winkel Alpha"
'   edtCalc(4) = '"Winkel Beta"
'   edtCalc(5) = '"Winkel Gamma"   

'α β γ

'   Text(0,1) = "Kathete a"
'      Text(0,2) = "c * sin(α) = "
'      Text(0,3) = "c * cos(β)= "
'      Text(0,4) = "b / cot(β) ="
'      Text(0,9) = ""
      Zahl(0,5) = c * SinD(α)
      Zahl(0,6) = c * CosD(β)
      Zahl(0,7) = b * TanD(α)
      Zahl(0,8) = 0
   
'   Text(1,1) = "Kathete b"
'      Text(1,2) = "c * cos(α) ="
'      Text(1,3) = "c * sin(β) ="
'      Text(1,4) = "a / tan(α) ="
'      Text(1,9) = ""
      Zahl(1,5) = c * CosD(α)
      Zahl(1,6) = c * SinD(β)
      Zahl(1,7) = a / TanD(α)
      Zahl(1,8) = 0
   
'   Text(2,1) = "Hypotenuse c"
'      Text(2,2) = "a / sin(α) ="
'      Text(2,3) = "b / cos(α) ="
'      Text(2,4) = "a / cos(β) ="      
'      Text(2,9) = ""
      Zahl(2,5) = a / SinD(α)
      Zahl(2,6) = b / CosD(α)
      Zahl(2,7) = a / CosD(β)   
      Zahl(2,8) = 0
      
'   Text(3,1) = "Winkel Alpha"
'      Text(3,2) = "inv Sin(a/c) ="
'      Text(3,3) = "inv Cos(b/c)"
'      Text(3,4) = "inv Tan(a/b)"   
'      Text(3,9) = "90 - β"
      Zahl(3,5) = ASinD(a/c)
      Zahl(3,6) = ACosD(b/c)
      Zahl(3,7) = ATanD(a/b)   
      Zahl(3,8) = 90 - β
      
'   Text(4,1) = "Winkel Beta"
'      Text(4,2) = "180 - α - γ ="
'      Text(4,3) = "90 - α ="
'      Text(4,4) = ""      
'      Text(4,9) = ""
      Zahl(4,5) = 180 - α - γ
      Zahl(4,6) = 90 - α 
      Zahl(4,7) = 0   
      Zahl(4,8) = 0
      
'   Text(5,1) = "Winkel Gamma"
'      Text(5,2) = "180 - α - β ="
'      Text(5,3) = ""
'      Text(5,4) = ""
'      Text(5,9) = ""
      Zahl(5,5) = 180 - α - β
      Zahl(5,6) = 0
      Zahl(5,7) = 0   
      Zahl(5,8) = 0


   For i =0 To 5 
'      lblCalc(i,5).Text = Zahl(i,5)
'      lblCalc(i,6).Text = Zahl(i,6)
'      lblCalc(i,7).Text = Zahl(i,7)
      lblCalc(i,5).Text = NumberFormat2(Zahl(i,5),0,3,3,False)
      lblCalc(i,6).Text = NumberFormat2(Zahl(i,6),0,3,3,False)
      lblCalc(i,7).Text = NumberFormat2(Zahl(i,7),0,3,3,False)
   Next
   



End Sub

Sub Dreieck   ' Labeltexte
   
      Text(0,1) = "Kathete a"
      Text(0,2) = "c * sin(α) ="
      Text(0,3) = "c * cos(β) ="
      Text(0,4) = "b / cot(β) ="
      Text(0,9) = ""
      Zahl(0,5) = 0
      Zahl(0,6) = 0
      Zahl(0,7) = 0
      Zahl(0,8) = 0
   
   Text(1,1) = "Kathete b"
      Text(1,2) = "c * cos(α) ="
      Text(1,3) = "c * sin(β) ="
      Text(1,4) = "a / tan(α) ="
      Text(1,9) = ""
      Zahl(1,5) = 0
      Zahl(1,6) = 0
      Zahl(1,7) = 0
      Zahl(1,8) = 0
   
   Text(2,1) = "Hypotenuse c"
      Text(2,2) = "a / sin(α) ="
      Text(2,3) = "b / cos(α) ="
      Text(2,4) = "a / cos(β) ="      
      Text(2,9) = ""
      Zahl(2,5) = 0
      Zahl(2,6) = 0
      Zahl(2,7) = 0
      Zahl(2,8) = 0
      
   Text(3,1) = "Winkel Alpha"
      Text(3,2) = "inv Sin(a/c) ="
      Text(3,3) = "inv Cos(b/c) ="
      Text(3,4) = "inv Tan(a/b) ="   
      Text(3,9) = "90 - β ="
      Zahl(3,5) = 0
      Zahl(3,6) = 0
      Zahl(3,7) = 0   
      Zahl(3,8) = 0
      
   Text(4,1) = "Winkel Beta"
      Text(4,2) = "180 - α - γ ="
      Text(4,3) = "90 - α ="
      Text(4,4) = ""      
      Text(4,9) = ""
      Zahl(4,5) = 0
      Zahl(4,6) = 0
      Zahl(4,7) = 0   
      Zahl(4,8) = 0
      
   Text(5,1) = "Winkel Gamma"
      Text(5,2) = "180 - α - β ="
      Text(5,3) = ""
      Text(5,4) = ""
      Text(5,9) = ""
      Zahl(5,5) = 0
      Zahl(5,6) = 0
      Zahl(5,7) = 0   
      Zahl(5,8) = 0



End Sub
 

Attachments

  • edtTextRechner.zip
    9.4 KB · Views: 127

klaus

Expert
Licensed User
I had a look at your program but don't understand the logic and what exactly it is supposed to do and how.
I never got a NaN message.
Is the program you posted the version you are working with ?
To be able to help it needs much more information.

What do you mean with 'the program is too long' ?

Best regards.
 
Upvote 0

Watchkido1

Active Member
Licensed User
Hi Klaus


This is a formula calculator for about 300 formulas.
From the industrial metals sector.
Only labeling and computation will change every time.
If any formula takes away sooo much space, the thing is 10MB in size.

I offt as result "NaN" or "infinity"

This activity is decoupled from the overall program.

The idea is:
I use three variables.
In the gray fields I get results is proposed.
By clicking on the gray box, I accept the result and can continue to rake Sun

The Simple tile request is: I use three variables and the software calculates all the others. But this is the best solution I could invent

best regards

frank


------------in Deutsch -------------

Das wird ein Formelrechner für ca 300 Formeln.
Aus dem Industrie-Bereich Metall.
Nur beschriftung und Rechenweg werden sich jedesmal ändern.
Wenn jede Formel sooo viel Platz wegnimmt, wird das Ding 10MB groß.

Ich hab offt als Ergebniss "NaN" oder "Unendlich"

Diese Activity ist ausgekoppelt aus dem Gesamtprogramm.

Die Idee ist:
Ich setze 3 Variablen ein.
In den grauen Feldern bekomme ich dann Ergebnisse vorgeschlagen.
Durch klick auf das graue Feld übernehme ich das Ergebnis und kann so weiterrechen.

Der eigendliche Wunsch ist: ich setze 3 Variablen ein und die Software errechnet alle anderen. Aber das hier ist die beste Lösung die ich erfinden konnte

beste Grüße

Frank
 
Upvote 0

manios

Active Member
Licensed User
Bei mir tut das Programm nichts(?)
Kann/Muss man irgendwelche Eingaben machen?
Wenn ich versuche eine Eingabe zu machen bekomme ich die Meldung
"Probleme in lblCalc_click" Send.Tag = 55

Ist das vielleicht ein "DAU"-Test:D
 
Upvote 0

Watchkido1

Active Member
Licensed User
Bei mir tut das Programm nichts(?)
Kann/Muss man irgendwelche Eingaben machen?
Wenn ich versuche eine Eingabe zu machen bekomme ich die Meldung
"Probleme in lblCalc_click" Send.Tag = 55

Ist das vielleicht ein "DAU"-Test:D

Bei Eingabe von 2 Werten in 2 Edittextfelder sollte in einem der grauen Felder ein Ergebnis auftauchen.
Wenn man dann auf ein graues Feld tippt wird der Wert in das Edittextfeld übernommen und man kann weiterrechen.

Es soll eine "Schablone" werden für viele andere Formeln.
Ist halt das beste was ich erfinden konnte.
Hier der originale Post
 
Last edited:
Upvote 0

mc73

Well-Known Member
Licensed User
I didn't study the code thoroughly, but some progress can be done by using some extra loops:

B4X:
'Activity module 



'edtTextRechner



Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim scvMain As ScrollView
    Dim PanelNb As Int                    : PanelNb=6
    Dim PanelHeight As Int                : PanelHeight=170dip
    Dim Formel, Text(15,15) As String     : Formel = "Dreieck"
    Dim i As Int
    Dim Zahl(30,30) As Double ': zahl(30,30) = numberformat2(zahl(30,30),1,3,3,false)
    Dim lblCalc(15,15) As Label
    Dim edtCalc(15) As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
    
    Dim pnlCalc(10) As Panel 
    Dim btnCalc As Button
    
    scvMain.Initialize(1500)
    Activity.AddView(scvMain, 0, 0, 100%x, 100%y)

    
    Dreieck ' Labeltexte abholen
            
    For i=0 To PanelNb-1
    

        pnlCalc(i).Initialize("pnlCalc")

        scvMain.Panel.AddView(pnlCalc(i),0,5dip+i*PanelHeight,100%x,PanelHeight+5)
        pnlCalc(i).Tag=i
        If (i Mod 2)=1 Then
            pnlCalc(i).Color=Colors.Red
        Else
            pnlCalc(i).Color=Colors.Blue
        End If
        
        For j=1 To 4
            lblCalc(i,j).Initialize("lblCalc1")
            If i<5 Then
                pnlCalc(i).AddView(lblCalc(i,j),10dip, -25dip+j*30dip, 45%x, 40dip)
                lblCalc(i,j).Tag=i & ",1"
                lblCalc(i,j).Text= Text(i,1)
                lblCalc(i,j).Gravity = Gravity.RIGHT
            Else
                pnlCalc(i).AddView(lblCalc(i,j),55%x, 40dip+(j-5)*30dip, 35%x, 25dip)
                lblCalc(i,j).Tag=i&j & ",1"
                lblCalc(i,j).Text= Zahl(i,j)
                lblCalc(i,j).Gravity = Gravity.CENTER_HORIZONTAL
                lblCalc(i,j).Color = Colors.LightGray
            End If
            lblCalc(i,j).TextSize=17
            lblCalc(i,j).TextColor = Colors.Black
        Next 
        
'----------------------------------------------------------------------------        
        'Eingabefeld
        edtCalc(i).Initialize("edtCalc")
        pnlCalc(i).AddView(edtCalc(i),55%x, 5dip, 35%x, 35dip)'55%x, 70dip, 35%x, 25dip)
        edtCalc(i).Tag=i
        edtCalc(i).TextSize=15
        edtCalc(i).InputType = edtCalc(i).INPUT_TYPE_NONE
        edtCalc(i).Text = 0
'----------------------------------------------------------------------------        
    
        
    Next
    

    edtCalc(0).Text  = 90.0 '"Kathete a"
    edtCalc(1).Text = 90.0 '"Kathete b"
    edtCalc(2).Text = 0'"Hypotenuse c"
    edtCalc(3).Text = 0 '"Winkel Alpha"
    edtCalc(4).Text= 0 '"Winkel Beta"
    edtCalc(5).Text= 90.0 '"Winkel Gamma"
    
    For i = 0 To 5
     edtCalc(i).Text = NumberFormat2(edtCalc(i).Text,0,3,3,False)
    Next

    
    scvMain.Panel.Height=PanelNb*PanelHeight+10
    
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub lblCalc_Click ' übernahme der Ergebnisse in edtCalc
    Dim Send As Label
    Dim i0 As String
    Dim i As Int 
    Send=Sender
    Activity.Title="Label "&Send.Tag
    i0 = Send.Tag
    Try
    Dim tempT()
    tempT=Regex.Split (i0,",")
    i=tempT(0)
    Dim flagTag As Int 
    flagTag=tempT(1)
    If flagTag=1 Then
    
    Dim tempI,tempJ As Int 
        tempI=i/10
        tempJ=i Mod 10
        edtCalc(tempI).Text=lblCalc(tempI,tempJ)
    Else    
    Msgbox("Send.Tag = "&Send.Tag, "Probleme in lblCalc_click")
    End If    
    Catch
    Msgbox("Send.Tag = "&Send.Tag, "Probleme in lblCalc_click")
    End Try
            
        
            
    
End Sub

Sub btnCalc_Click
    Dim Send As Button
    
    Send=Sender
    Activity.Title="Button "&Send.Tag
End Sub

Sub pnlCalc_Click
    Dim Send As Panel
    
    Send=Sender
    Activity.Title="Panel "&Send.Tag
End Sub

Sub edtCalc_EnterPressed 'Berechnung der Ergebnisse


    Dim a,b,c,α, β, γ,x As Double
    Dim Send As EditText
    
    Send=Sender
    Activity.Title="EditText "&Send.Tag&" = "&Send.Text
    


    a = edtCalc(0).Text '"Kathete a"
    b = edtCalc(1).Text '"Kathete b"
    c = edtCalc(2).Text '"Hypotenuse c"
    α  = edtCalc(3).Text '"Winkel Alpha"
    β = edtCalc(4).Text '"Winkel Beta"
    γ = edtCalc(5).Text '"Winkel Gamma"
    
        
        'Variablen zum "Dreieck"
        
'    edtCalc(0) = '"Kathete a"
'    edtCalc(1) = '"Kathete b"
'    edtCalc(2) = '"Hypotenuse c"
'    edtCalc(3) = '"Winkel Alpha"
'    edtCalc(4) = '"Winkel Beta"
'    edtCalc(5) = '"Winkel Gamma"    

'α β γ

'    Text(0,1) = "Kathete a"
'        Text(0,2) = "c * sin(α) = "
'        Text(0,3) = "c * cos(β)= "
'        Text(0,4) = "b / cot(β) ="
'        Text(0,9) = ""
        Zahl(0,5) = c * SinD(α)
        Zahl(0,6) = c * CosD(β)
        Zahl(0,7) = b * TanD(α)
        Zahl(0,8) = 0
    
'    Text(1,1) = "Kathete b"
'        Text(1,2) = "c * cos(α) ="
'        Text(1,3) = "c * sin(β) ="
'        Text(1,4) = "a / tan(α) ="
'        Text(1,9) = ""
        Zahl(1,5) = c * CosD(α)
        Zahl(1,6) = c * SinD(β)
        Zahl(1,7) = a / TanD(α)
        Zahl(1,8) = 0
    
'    Text(2,1) = "Hypotenuse c"
'        Text(2,2) = "a / sin(α) ="
'        Text(2,3) = "b / cos(α) ="
'        Text(2,4) = "a / cos(β) ="        
'        Text(2,9) = ""
        Zahl(2,5) = a / SinD(α)
        Zahl(2,6) = b / CosD(α)
        Zahl(2,7) = a / CosD(β)    
        Zahl(2,8) = 0
        
'    Text(3,1) = "Winkel Alpha"
'        Text(3,2) = "inv Sin(a/c) ="
'        Text(3,3) = "inv Cos(b/c)"
'        Text(3,4) = "inv Tan(a/b)"    
'        Text(3,9) = "90 - β"
        Zahl(3,5) = ASinD(a/c)
        Zahl(3,6) = ACosD(b/c)
        Zahl(3,7) = ATanD(a/b)    
        Zahl(3,8) = 90 - β
        
'    Text(4,1) = "Winkel Beta"
'        Text(4,2) = "180 - α - γ ="
'        Text(4,3) = "90 - α ="
'        Text(4,4) = ""        
'        Text(4,9) = ""
        Zahl(4,5) = 180 - α - γ
        Zahl(4,6) = 90 - α 
        Zahl(4,7) = 0    
        Zahl(4,8) = 0
        
'    Text(5,1) = "Winkel Gamma"
'        Text(5,2) = "180 - α - β ="
'        Text(5,3) = ""
'        Text(5,4) = ""
'        Text(5,9) = ""
        Zahl(5,5) = 180 - α - β
        Zahl(5,6) = 0
        Zahl(5,7) = 0    
        Zahl(5,8) = 0


    For i =0 To 5 
'        lblCalc(i,5).Text = Zahl(i,5)
'        lblCalc(i,6).Text = Zahl(i,6)
'        lblCalc(i,7).Text = Zahl(i,7)
        For j=5 To 7
        lblCalc(i,j).Text = NumberFormat2(Zahl(i,j),0,3,3,False)
        Next
    Next
    



End Sub

Sub Dreieck   ' Labeltexte
    For i=0 To 5
    For j=5 To 8
    Zahl(i,j)=0
    Next
    Text(i,9)=""
    Next
        Text(0,1) = "Kathete a"
        Text(0,2) = "c * sin(α) ="
        Text(0,3) = "c * cos(β) ="
        Text(0,4) = "b / cot(β) ="
        
    Text(1,1) = "Kathete b"
        Text(1,2) = "c * cos(α) ="
        Text(1,3) = "c * sin(β) ="
        Text(1,4) = "a / tan(α) ="
        
    Text(2,1) = "Hypotenuse c"
        Text(2,2) = "a / sin(α) ="
        Text(2,3) = "b / cos(α) ="
        Text(2,4) = "a / cos(β) ="        
        
    Text(3,1) = "Winkel Alpha"
        Text(3,2) = "inv Sin(a/c) ="
        Text(3,3) = "inv Cos(b/c) ="
        Text(3,4) = "inv Tan(a/b) ="    
        Text(3,9) = "90 - β ="
        
    Text(4,1) = "Winkel Beta"
        Text(4,2) = "180 - α - γ ="
        Text(4,3) = "90 - α ="
        Text(4,4) = ""        
        
    Text(5,1) = "Winkel Gamma"
        Text(5,2) = "180 - α - β ="
        Text(5,3) = ""
        Text(5,4) = ""
        
        

End Sub
 
Upvote 0

manios

Active Member
Licensed User
Also, auf meinem Nexus S geht keine Tastatur auf, egal was und wo ich drücke. Ohne Eingabemöglichkeit war ich etwas ratlos.
 
Upvote 0

klaus

Expert
Licensed User
Hallo Frank,
Ich denke Du solltes zuerst mal das Programm das Du gepostet hast selbst testen. Dann kurz beschreiben was wie gemacht werden muss um das Problem nachvollziehen zu können.
Du hast für die EditText Views INPUT_TYPE_NONE als InputType gesetzt was heisst KEINE Eingabe.
Wie erhoffst Du konkrete Hilfe zu bekommen mit einem Program das nicht einmal macht was Du sagst ?

Beste Grüsse.
 
Upvote 0

Watchkido1

Active Member
Licensed User
Danke Klaus

Hallo Frank,
Ich denke Du solltes zuerst mal das Programm das Du gepostet hast selbst testen. Dann kurz beschreiben was wie gemacht werden muss um das Problem nachvollziehen zu können.
Du hast für die EditText Views INPUT_TYPE_NONE als InputType gesetzt was heisst KEINE Eingabe.
Wie erhoffst Du konkrete Hilfe zu bekommen mit einem Program das nicht einmal macht was Du sagst ?

Beste Grüsse.

:sign0098:
Boa, Selber testen...
:sign0100:

I like you, Klaus

edtCalc(i).InputType = edtCalc(i).INPUT_TYPE_DECIMAL_NUMBERS

geht aber auch nicht
 
Upvote 0

Watchkido1

Active Member
Licensed User
ok

[QUOTEUnd Ich sage es geht !

Beste Grüsse.[/QUOTE]

Super Claus, Thank you very much.
That's it.

Frank
 
Upvote 0

ta1dr

Member
Licensed User
hello Frank
Ich interessiere mich für CNC (für hobby) :eek:
sorry my Deutsch I very very poor and thanks for google traslate :)
could you add screenshot ?
Ahmet
 
Upvote 0

Watchkido1

Active Member
Licensed User
hello Frank
Ich interessiere mich für CNC (für hobby) :eek:
sorry my Deutsch I very very poor and thanks for google traslate :)
could you add screenshot ?
Ahmet

Screenshot
 

Attachments

  • 1.png
    1.png
    23.8 KB · Views: 190
  • 2.png
    2.png
    22.2 KB · Views: 174
  • 3.png
    3.png
    27.9 KB · Views: 194
  • 4.png
    4.png
    21.8 KB · Views: 190
Upvote 0
Top