Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 23rd, 2003, 03:22 PM
TwProgrammer TwProgrammer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 6 TwProgrammer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post .NET to VB6.0 help!

Hey, im changing from Visual Basic.NET to Visual Basic 6.0, so i can make Win32 programs, cause VB.NET really made me sick because the user has to have .NET Framework instaled. Anyway now i bought VB 6.0 and i am trying to create a file, and write data to it. ive figured this out myself if .NET,,,it looks something like this (i am writing from my mind not copy + paste so i might have some spelling mistakes)
Quote:
'Firstly in the top of the code window:
Imports System
Imports System.IO
then in the button click command

'This is the StreamWriter way...

Dim strDestination as String
Dim SW as StreamWriter
SaveFileDialog1.ShowDialog
strDestination = SaveFileDialog1.FileName
SW = File.CreateText (strDestination)
SW.WriteLine ("This is what I want to write")
Sw.WriteLine ("Another example ")
SW.WriteLine (TextBox1.Text)
Sw.Close

'This is the comma separated database!

'FileOpen (FileNumber, Destination, OpenMode)
FileOpen (1, strDestination, OpenMode.OutPut)

'WriteLine (FileNumber, What to write)

WriteLine (1, "Hey this is record number 1")
WriteLine (1, "And this is record number 2")
WriteLine (1, "And this is record number 3")
FileClose (1)

'This is to put the records into variables by the Input Command

'Input (FileNumber, Saved To)

Dim arrTheInputs () as String
Dim IntCounter as String

FileOpen (1, strDestination, OpenMode.Input)
Do Until EOF (1)
ReDim Preserve arrTheInputs (intCounter)
Input (1, arrTheInputs (intCounter))
intCounter = intCounter + 1
Loop
FileClose (1)

'Since we know there is only 3 records.....

MsgBox (arrTheInputs (0))
MsgBox (arrTheInputs (1))
MsgBox (arrTheInputs (2))

End Sub

And thats it a huge code but pretty good...i want to know how to do something like this in VB6.0..i tried a command FileOpen...but its not there
can someone please help me,,i really need the help

Reply With Quote
  #2  
Old October 23rd, 2003, 03:31 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 36 m 16 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
You can either use the Open function or create an FSO (File Scripting Object)
Search this forum for some examples on each or look in the msdn library.

Reply With Quote
  #3  
Old October 23rd, 2003, 04:41 PM
TwProgrammer TwProgrammer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 6 TwProgrammer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
open function?

Reply With Quote
  #4  
Old October 23rd, 2003, 06:07 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,976 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 17 h 59 m 48 sec
Reputation Power: 802

Reply With Quote
  #5  
Old October 24th, 2003, 09:43 AM
dwise1_aol's Avatar
dwise1_aol dwise1_aol is online now
Contributing User
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 3,867 dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)dwise1_aol User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 2 h 54 m 19 sec
Reputation Power: 480
TwProgrammer, I commiserate with you because I'm in the same situation. None of our computers at work have .NET installed, so VB6 is the obvious choice. Yet .NET is all that is being taught now. While many of the concepts and the basic language syntax should be transferable, much of the language has changed considerably, as you have found with file I/O. Even trying to find out how to exit the program has proven to be an adventure.

On the plus side, .NET is supposed to have true object-oriented programming. But that does not even come close to balancing out the negative side of having to run .NET.


Doug G:
Thanks for the link. I bookmarked it immedately.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > .NET to VB6.0 help!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT