Syntax: Syntax Error Refers To An Error in The Syntax of A Sequence
Syntax: Syntax Error Refers To An Error in The Syntax of A Sequence
Syntax: Syntax Error Refers To An Error in The Syntax of A Sequence
write code.
If there is syntax error the source code cannot compile. Example of Syntax Error : a)Illegal variable name e.g. As String) b)A == 7 Dim 6name AS String instead of (Dim name
Run-Time Errors: Run-time errors are those that appear only after
you compile and run your code. These involve code that may appear to be correct in that it has no syntax errors, but that will not execute.
Logical Errors: Logic errors are those that appear once the
application is in use. They are most often unwanted or unexpected results in response to user actions. Logical error are hardest to find.
Code is not the machine code thats why it is not directly understood by the
machine (Processor). To convert the P-code into machine code there is Visual basic runtime module. The runtime module file name is : VBRUNxxx.DLL or MSVBVMxx.DLL (VB 5 and higher)
Advantage of P-Code:
1. Easy to generate executables files. 2. Less overhead required in case there is change in language.
Disadvantage of P-Code:
1. Only suitable for small programs 2. Slow execution of program.
Advantages:
1.Faster execution of programs 2.Suitable for large applications
Disadvantage:
1.Difficult to change compiler 2.More time required to create the executable files.
2. Run Mode: when the application is executing and the user can interact
with the application.
Controls- The toolbar consists of collection of buttons called controls that represent object that we place on our form.
Container Control: that can hold other controls within it e.g. Frame,
picture box ( it holds a picture) or form.
ActiveX Control: ActiveX is the name given to controls that you can
create. These controls have extension .OCX and you can add them to
your project.
Grid: the grid is the dot pattern that comprise the form windows
background. The default size of each cell in the grid is 120*120 twips.
Property
Minbutton & maxbutton Control Menu BorderStyle
Value
True / False
Description
True/ False 0-None, 1-Fixed Single, 2-Sizable etc. T/F Icon file T/F Image
If False, 3 buttons (min, max, close) get disabled Controls the border and resize of form. If value is 0 & 1, form cannot be resized. Whether form is active or not Describes the icon graphic image Form can move or not Form background picture.
1. Not loaded: Form lives on disk (HDD) and does not take any
resource.
3. Loaded and shown : form is shown and user can interact with it.
Four methods available for forms. 1. Load : to load the form in memory. E.g. load <formname> (load
form1).
2. Unload : to unload the form from memory and it also hides the form.
E.g. unload <formname> (unload form2)
3. Hide: to hide the form. E.g. <formname>.hide. 4. Show: shows the form and also loads the form in memory (if
unloaded). Syntax: <formname>.show[mode]
Value of Mode
1. 0 Modeless(default) : A modeless form allow the user to interact with other part of applications. 2. 1 Modal: Modal form take control over the application and does not allow user to interact with other parts of application.
On Click on Show Form2 : Form 2 should be opened in Modal state and Form1 should be visible.
Property
Default
Value
T/F
Description
Button responds to an Enter Keypress even if another control has the focus. Button responds to an ESC key press even if another control has the focus.
Cancel
T/F
Enabled
Visible
T/F
T/F
Tooltiptext Style
Text 0 and 1
Holds the text to display as tool tip To add back color or picture
Property
Caption
Value
Text
Description
Alignment of caption. Default value is left Causes to expand horizontally and adjust to the size of its contents Become effective only Autosize is True. Then text is wrapped and expanded vertically
BorderStyle
Text Box: can be used to get input from user or to display the text. Features of Text Box.
1. You can insert and select text.
2. You can scroll the text if it doesnt fit in visible area. 3. Exchange text with other applications through the clipboard.
Property
Text
Value
Text
Description
Specify text to be displayed
Maximum no of characters allowed. To allows mutiple lilnes in text box 0-none, 1- horizontal, 2-vertical, 3-both Specify any character in this property , then in place of text that character is displayed. Returns the selected text from text box Returns or sets the position of first character Returns or sets the length of the selected text
CheckBox: used for offering a small set of choices from which user can
choose one or more options.
Property
Caption
Value
Text
Description
Option Button: used to offer small set of options, unlike check boxes, they always work as part of group, selecting one option button immediately clears all other in group.
Property
Caption
Value
text
Description
Display the text
Value Alignment
True for option button is selected False for option button not selected Position of radio button either left or right to caption
Frame Control: is used to group various controls. It is an container control. It does not carry out any job / action itself, id does not respond to any events by itself.
Property
Caption
Value
text
Description
Display the text
BorderStyle Apperance
0 or 1 Flat or 3d effect
Private Sub Command1_Click() Dim amt As Integer If Check1.Value = 1 Then amt = amt + 300 End If If Check2.Value = 1 Then amt = amt + 250 End If If Check3.Value = 1 Then amt = amt + 50 End If If Option1.Value = True Then MsgBox ("your cash bill amount is "+ Str(amt)) Else MsgBox ("your credit bill amount is " + Str(amt)) End If End Sub
ListBox: list of choices appear to user. Choices are presented in one or more columns. Scroll bars appeared automatically if required.
Property
Multiselect
Value
0,1,2
Description
Whether multiple values can be selected or not. Cannot be changed at runtime. 0 means no multiple selection 1 means multiple selection through the click of mouse or spacebar 2 extended multiple selection. You can use shift or ctrl key plus mouse click to select items
True / False
Multiple text
At design time you can add multple values from here and use ctrl+enter to go to new line
ComboBox Control: Similar to ListBox but takes less space on Screen. It is an expandable listbox which can grow when user want to select item.
Property
Value
Description
Style
0 (Default) , 1, 2
0 Drop Down Combo : user can select from the list and type a new one 1 Simple Combo: includes text box and list that doesnt drop down. To navigate through list use arrow keys. 2 DropDown list: drop down list is available user can select but cannot enter text.
Scroll Bar: is a long stripe with an indicator that lets the user select a value between the two ends of controls. Two types: 1. Horizontal scroll bar 2. Vertical scroll bar
Property
Min
Value
Number
Description
Scrollbar minimum value. Min value can be 0 Scrollbar maximum value. Max value can be 32767 Returns the current value of scroll bar
Number
Number Number
Change in value if user clicks on area other than indicator and arrow keys Change in value if user clicks at the arrow keys.
Image Control Box: Used to display the graphics. Formats that can be displayed ( .bmp, .dip, .jpeg, .gif, .cur etc) Important : image control responds to Click Events and can be used as a subsitute for command buttons, as item in toolbar.
Property
Picture
Value
Location of picture T/F
Description
Use this property to set the picture
Stretch
Determines whether image is resized to Image Control Box. IF True image is resized to the size of ImageControl Box. If False the Image control box is resized to the size of image.
Picture Box: used to display graphics, act as container for other controls and to display output from graphics methods or text using print method.