473,545 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
+ 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 1126
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_bu tton 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("messa ge 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
14817
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 scsi disks installed on the db box. Sqlserver is set to use max 1,4 GB RAM, and the sqlserver does not seem to be using it all.
8
5455
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
8
477
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 for this condition. What can I do to get access to return an error on my query? Thanks
0
1272
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 getting several errors and not sure why or how to solve them does anyone have any help? How do I access the other file? ServerSocket.cs *This is...
7
1769
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 the double post but I just didn't have any other option other than re-posting the same question in this newsgroup. Consider the following code in...
0
5533
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
11
26541
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 and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my...
3
1935
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 kinds of errors... just to give you a number of errors it is 888 :) All these errors aren't syntax errors in code behind files. I see all these in...
0
3157
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 fine. Now we decided to move from mainframe IMS-DB2 to Windows 2003 server-DB2 UDB for LUW 9.5.
2
2324
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 in the edit_subject.php page. I dont know whats wrong with the query i;v had. <?php require_once("includes/connection.php"); ?> <?php...
0
7475
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7409
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7664
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7921
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7771
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
1900
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 we have to send another system
1
1023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
720
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.