Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 24th, 2008, 8:34 AM   #1
kewlgeye
Programmer
 
Join Date: Jan 2008
Posts: 39
Rep Power: 0 kewlgeye is on a distinguished road
Question What is wrong with this Output Statement

I am trying to output a number that is entered into a textbox called adminsundaycpaTextBox.Text. This number is supposed to be entered into a text file called Sundaypm.Text

I had absolutely no idea how to use visual basic 1 month ago, and now I am trying to learn. So here is my code. for the output statement.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click




' Open the file for output.
FileOpen(1, "Sundaypm.txt", OpenMode.Output)
' Close before reopening in another mode.


' Calculate Checkpoint A situation.


adminsundaycpaTextBox.Text = adminsundaycpaTextBox.Text

Write(1)
FileClose(1)
Me.Close()
End Sub


There was not much help online, because most was for older versions of visual basic. I learned this much using the index feature in visual basic. Thank you for your replys.
kewlgeye is offline   Reply With Quote
Old Jan 24th, 2008, 8:50 AM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,722
Rep Power: 5 Sane is on a distinguished road
Re: What is wrong with this Output Statement

adminsundaycpaTextBox.Text = adminsundaycpaTextBox.Text

That piece of code there does absolutely zip. Nadda. You are telling it to reassign its value to itself. In other words, x = x.

You don't seem to be using the right code for writing files. At least according to this thread. You might want to use the second example ("An example of writing a file").

Edit: Oh, you're using a newer version of VB that doesn't support this? Hmph.
Try Write(adminsundaycpaTextBox.Text).
Sane is offline   Reply With Quote
Old Jan 25th, 2008, 10:46 PM   #3
kewlgeye
Programmer
 
Join Date: Jan 2008
Posts: 39
Rep Power: 0 kewlgeye is on a distinguished road
Question Re: What is wrong with this Output Statement

Edit: Oh, you're using a newer version of VB that doesn't support this? Hmph.
Try Write(adminsundaycpaTextBox.Text).[/quote]


I figured it out, but now I am having a trouble reading from the file and storing the result in a variable so that I can compare it to another. Any ideas on how to read one number from a file and store it into a variable?

Thank you for your reply, I am using a different computer otherwise I would share the solution code that I used.
kewlgeye is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Wrong with this If Statement? Please Help. kewlgeye Visual Basic 3 Jan 20th, 2008 11:14 PM
Change the name of output file jazz C 4 Jun 28th, 2006 2:54 AM
What is wrong with this code? c0ldshadow Visual Basic .NET 5 Dec 5th, 2005 5:37 PM
It's giving me "Press any key to continue" and no other output.. Insomniac C 15 Jun 5th, 2005 7:07 AM
Can someone help me with my output hopeolicious C++ 0 Feb 28th, 2005 4:47 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:06 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC