Many Access Violation

In this category you can exchange your programming questions and solutions.
Post Reply
Manolo
Posts: 16
Joined: Fri Jun 15, 2007 4:57 pm

Many Access Violation

Post: # 746Post Manolo
Sat Jul 23, 2011 9:35 pm

I got many errors With this code: Access Violation & Runtime Error.

Run it and put some characters in the fields and click on check

(I used `goto Label` to exit from SUB, because EXIT SUB don`t seems to work)

----------------------------------------------------------------
Object Mainform as form
  Caption = "Form"
  Width = 200
  Height = 300
  Center
Object Edit_1 as edit
    Top = 40
    Left = 20
    Width = 100
End Object
Object Edit_2 as Edit
    Top = 80
    Left = 20
    Width = 100
End Object
Object Edit_3 as Edit
    Top = 120
    Left = 20
    Width = 100
End Object
Object Edit_4 as Edit
    Top = 160
    Left = 20
    Width = 100
End Object
Object CheckButton as Button
    Top = 200
    Left = 30
    Caption = "Check"
    OnClick = CheckEmptyFields
END Object    
ShowModal
End Object
`--------------------------------------------------------
SUB CheckEmptyFields

   IF Edit_1.Text = "" THEN
      ShowMessage "Empty Field #1"
      GOTO ExitFromThisSub
   END IF
   
   IF Edit_2.Text = "" THEN
      ShowMessage "Empty Field #2"
      GOTO ExitFromThisSub
   END IF
   
   IF Edit_3.Text = "" THEN
      ShowMessage "Empty Field #3"
      GOTO ExitFromThisSub
   END IF
   
   IF Edit_4.Text = "" THEN
      ShowMessage "Empty Field #"            
   END IF
ExitFromThisSub:   
END SUB

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

Many Access Violation

Post: # 747Post Marco
Sun Jul 24, 2011 7:01 pm

think you find a bug, remove the labels or mark them. Use exit sub,small capitals it seems not to work with uppercase characters.
I will track down the bug and fix it.

best regards

Post Reply