vb4me:)
10-09-2001, 02:49 AM
I need help with variables, particularly setting them. Can someone explain how to do this?
Variablesvb4me:) 10-09-2001, 02:49 AM I need help with variables, particularly setting them. Can someone explain how to do this? BillSoo 10-09-2001, 02:50 AM dim x as integer x = 5 What kind of help do you need? "I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder St_Hay 10-09-2001, 02:53 AM but when you declare variables make sure you declare them right..... Not like dim x as double x = "You and me" make sure you get the right type while declaring variables... vb4me:) 10-09-2001, 02:54 AM Basically, I want to learn the basics of variables. If you know anywhere where it teaches you about variables, that'll be good too. ChiefRedBull 10-09-2001, 03:04 AM A variable is a palce where you can store a piece of data, be it a number, a string, a boolean or a user defined type. A number would be 1,2,3,4,5,6, etc... A string would be "hello", "im a string", "6", "7986", etc.. Booleans are either TRUE or FALSE. You declare variables like this: <pre><font color=red>Dim varName as varType </pre></font color=red> varName can be almost anything you want, although its best to use certain prefixes like <pre><font color=red>iInteger sString bBoolean </pre></font color=red> You can set variables very easily. <pre><font color=red>iInteger = 56 sString = "this is the string" bBoolean = False </pre></font color=red> Once you've set the variable, whenever you make a reference to it, you will really be referenceing the value of it. For exmaple. <pre><font color=red>Dim sText as String sText = "This is a string" MsgBox sText </pre></font color=red> Good luck Chief "How are we to learn, if those that know will not teach... ?" - Me. Squirm 10-09-2001, 08:18 AM Variables form the very base of any language I can think of (except ASM), including VB. Without them the project has no functionally whatsoever. They are the most basic part of coding that is available, more basic than syntax. vb4me:) 10-10-2001, 04:33 AM Thanks a lot. As I expected, variables were very simple, but, of course, I can never learn if I'm not taught can I? Thanks again. |
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum