You are on page 1of 4

pic combo

In depth information about pic combo can be discovered at main website. cmdClose TmrLoop picView Prefixes can also be really valuable to you when you are producing out code. str = String lng = Long int = Integer sng = Single bln = Boolean var = Variant Poor Example: dim things as string things=inputbox("You should enter your name") Great example: dim strName as String strName = inputbox("Please enter your name") Element 1B. Making your code readable part 2. You have presently learned how prefixes can assist making coding more rapidly and simpler. Now allows shift on to feedback and indenting! One particular of the worst issues around is finding code that is not indented and or no white room.

Bad Instance sub ProcessNumber(ByRef intNumber as integer) if intnumber= 3 then else if intNumber = four then finish if conclude if Finish Sub Very good Illustration: sub ProcessNumber(ByRef intNumber as integer) If intnumber= three then Else If intNumber = four then End If Finish If Conclude Sub When do you indent? You also tab when when you get started to code in an event or subroutine. Then for each if assertion, loop, you also indent. Remarks: Visual Standard responses begin with ' and can go wherever that you want They are helpful in detailing your code to oneself and other individuals. I actually wish VB had multi line feedback like in C++ but it is not way too bad. White Space:

Leaving white room helps make your code less difficult to study and can make it appear cleaner Part two: The Code The enjoyable things commences now. The extremely very first line in all your varieties and modules must be Choice Specific What does Option Explicit do? Effectively it forces you to declare all your variables with normally would make them all the variant type. Illustration so you can not do: for i= to 100 up coming i You have to first have i declared Dim i as byte for i= to one hundred following i Variables What are Variables? They maintain info that could adjust when you operate your software Byte = retains quantities from to 255 String = retains people or letters such as "Hi there Entire world! and quantities way too 123456789" Integer= numbers no decimals from -32,768 to 32,767 Extended = figures no decimals from -2,147,483,647 to 2,147,483,647 One = Can keep decimal numbers 32bit Boolean = holds either Correct or Fake Constants What are constants? They maintain info that does not modify. An instance of a continual would be non-public const Pi = 3.fourteen

Personal/General public/Worldwide What does Non-public suggest? Private implies it can only be accessed in the current form, module, or course. What does Community and World-wide indicate? Community signifies it can be accessed from any form, module, or course Static If you make a variable static it will preserve its worth the subsequent time the sub is operate. IF Then statements One line if then statement If issue=Accurate then blnSomething=real Multi Line if then statement If problem=real Then 'Your code goes listed here Stop If Sophisticated IF then else statements If issue=Real Then Else 'Condition=untrue Tips I like to use Debug.print or use a msgbox assertion to see what&#146s likely on in my code. SmartCheck - excellent instrument for debugging a compiled exe.