473,473 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HELP - vb 6 error - not sure why it errors

1 New Member
i have got a copy of vb6 and i have installed on my laptop, to start with everything works until i close visual basic and then when i open it again it does not allow the code to run, when i press run it comes up with "compile error" and says "su or function not defined". it highlights the commands. i tried a simple code :

Dim Name As String
Name = LineIn ("What is your name?")
Display (Name)

it has the other stuff around it like "end sub" but this is not he problem it highlights "LineIn" or if i leave out the "LineIn" part it highlights the "Display"

i am not sure why it does this but any help and i would be very thankful.

thanks
Oct 6 '06 #1
1 1124
Seith
16 New Member
Ummm well you're code and idea is totally wrong, for that you'd need:

Expand|Select|Wrap|Line Numbers
  1. Private Sub FormName_activate()
  2. Dim Name As String
  3. Name = InputBox("What is your name?")
  4. Print Name
  5. End Sub
Private Sub THING_ACTION() - This would be like "command_button click" or "text_field mouseover"

Dim Name As String - This is right, you set your variable as String (Text) Integer (Number, No Decimal) Single (Decimal Number) and some other stuff, those are the main ones though

Variable = Action - Variable is set in DIM and action (for this example) is an input box prompt. If you want to define a title, you can put InputBox("message for what they put in","title they see")

Print Variable - This will PRINT the words put in the prompt into the form, an alternitive is to put a text field and put txtName = Variable and it'll replace the variable, or put a label and write lblName = "Welcome, " & Variable & "! Hope you like your stay!" this will give you: Welcome, Seith! Hope you like your stay!

Then you end the Sub.


NOTE: For using PRINT and INPUTBOX you must use Form_Activate and NOT Form_Load becuase it will not Print on Form_Load

If you need more help, seeing as you appear to be a beginner, feel free to ask me questions by MSN on my account: gfxnode (aht) hotmail.com

(aht) = @
So I don't get spam from forum-spiders :)
Oct 7 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Thue Tuxen Sørensen | last post by:
Hi everybody ! I´m maintaining a large intranet (approx 10000 concurrent users) running on one IIS box and one DB box with sqlserver 2000. Currently there is 2,5 GB Ram, 1 1400 mhz cpu and 2...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
8
by: frank | last post by:
Below is some code for doing and insert into one of my tables. The inserts do not work because a duplicate key exists, which I want to happen. The problem is, I cannot get access to return an error...
0
by: Tressa | last post by:
Sorry to be such a novice about this but..... I have a windows service. It contains two separate files. Both have the same namespace name. I need to pass "bDisplay" into the other file. I am...
7
by: rn5a | last post by:
This is the second time I am asking this question in this newsgroup since I haven't got a solution or response from anyone in my previous post & I need to resolve this issue desperately. Sorry for...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
3
by: Learner | last post by:
Hello, I recently converted a VS 2003 application to VS 2005. When I compile it in VS 2005 every thing gets compiled with no errors. But when I try publishing the website I get all different...
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
2
by: benicio | last post by:
The subject update failed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = 6' at line 5. This is...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.