To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Part 10 of the Visual Basic .NET 2010 Express Tutorial Complete!
How to Use the Visual Studio Code Analysis Tool FxCop
Article :: Interview with Andrei Alexandrescu (Part 3 of 3)
Introducing Visual Studio LightSwitch
Visual Studio LightSwitch Beta 1 is Available



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Display Modes
Old Nov 24th, 2009, 12:00 AM   #1
badwl24
New Member
 
Join Date: Nov 09
Posts: 5
badwl24 is an unknown quantity at this point (<10)
Resolved [RESOLVED] help need for creating interface

Hello everybody....

I am very new to VB6 and more over belongs to Mechanical department...
can any one solve my problem?
Code:
Sub getMatrix()

    Dim newFile As String
    Dim i As Integer, j As Integer
    
    fHndl = 1
    
    Form1.ofd.Filter = "Text file (*.txt)|*.txt"
    Form1.ofd.ShowSave
    newFile = Form1.ofd.FileName
       
    Open newFile For Output As fHndl
    
    'Write #1, "File = " & swModel.GetPathName
    
    Write #fHndl, "Components Used:::"
    Write #fHndl, ""
    For i = 1 To cnt
        Write #fHndl, " ->" & strPart(i)
    Next i
    
    For i = 1 To cnt - 1
        For j = i + 1 To cnt
            Form2.Label1.Caption = strPart(i) & " - " & strPart(j)
            Form2.Show
        Next j
    Next i

    Close #fHndl
    
    Shell "notepad.exe " & newFile, vbNormalFocus

End Sub

Sub writeMatrix()

    Write #fHndl, "     +x : " & Form2.Text1
    Write #fHndl, "     +y : " & Form2.Text2
    Write #fHndl, "     +z : " & Form2.Text3
    Write #fHndl, "     -x : " & Form2.Text4
    Write #fHndl, "     -y : " & Form2.Text5
    Write #fHndl, "     -z : " & Form2.Text6
    
    Unload Form2

End Sub
Here strPart will get some part names from CAD file e.g.- part1, part2, part3, etc..... from that part names I have to form pairs(i am sure about what it called) like {part1, part2}, {part1,part3}, {part2,part3}.....etc.....
and for those pairs generated i have to give(input) six different integer vaalues in the form2..........i couldnt find the mistake in this code.........

pls anyone rectify the problem


with regards
BORAD
NITW

Last edited by si_the_geek; Nov 24th, 2009 at 04:24 AM. Reason: added code tags
badwl24 is offline   Reply With Quote
Old Nov 24th, 2009, 07:45 AM   #2
LaVolpe
VBaholic & Loving It
 
LaVolpe's Avatar
 
Join Date: Oct 07
Location: GetWindowRect()
Posts: 7,895
LaVolpe is a name known to all (1000+)LaVolpe is a name known to all (1000+)LaVolpe is a name known to all (1000+)LaVolpe is a name known to all (1000+)LaVolpe is a name known to all (1000+)LaVolpe is a name known to all (1000+)LaVolpe is a name known to all (1000+)LaVolpe is a name known to all (1000+)LaVolpe is a name known to all (1000+)
Re: help need for creating interface

I don't think we understand the problem, please be very specific: what is not happening and what should happen. You are not reading the file in the sample code you provided.

Let us know how strPart is declared and if ReDim'd please show us that line too.
__________________
Insomnia is just a byproduct of, "It can't be done"
Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum. Read the HitchHiker's Guide to Getting Help on the Forums.

{Memory Leak FAQ} {GDI+ Classes/Samples} {Unicode Open/Save Dialog} {Icon Organizer/Extractor} {VBA Control Arrays}
{XP/Vista Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}
LaVolpe is offline   Reply With Quote
Old Nov 25th, 2009, 05:26 AM   #3
akhileshbc
Engineering Student
 
akhileshbc's Avatar
 
Join Date: Jun 08
Location: Trivandrum, Kerala, India
Posts: 4,563
akhileshbc is a jewel in the rough (200+)akhileshbc is a jewel in the rough (200+)akhileshbc is a jewel in the rough (200+)
Re: help need for creating interface

Quote:
I don't think we understand the problem, please be very specific: what is not happening and what should happen.
Me too...

Small suggestions about your code...
Code:
Sub getMatrix()

    Dim newFile As String
    Dim i As Integer, j As Integer
    
    fHndl = FreeFile    '~~~~~> Look Here
    
    Form1.ofd.Filter = "Text file (*.txt)|*.txt"
    Form1.ofd.ShowSave
    newFile = Form1.ofd.FileName
       
     Open newFile For Output As fHndl   '~~~~~> Here, you are writing data to the file. Not inputting into the program. I think, you are using 'getMatrix' to read data from the file. ???
    
    'Write #1, "File = " & swModel.GetPathName
    
    Write #fHndl, "Components Used:::"
    Write #fHndl, ""
    For i = 1 To cnt
        Write #fHndl, " ->" & strPart(i)
    Next i
    
    For i = 1 To cnt - 1
        For j = i + 1 To cnt
            Form2.Label1.Caption = strPart(i) & " - " & strPart(j)
            Form2.Show     '~~~~~> This will load the Form2 for each iteration of the loop. Is it necessary. Why don't you display the form after the loop
        Next j
    Next i

    Close #fHndl
    
    Shell "notepad.exe " & newFile, vbNormalFocus

End Sub
__________________

If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (from the pull down menu - Thread Tools)

..::~^~ Akhilesh.B.Chandran ~^~::..

My system: AMD Athlon X2 5200+, ASUS Motherboard, 2 GB RAM, 400 GB HDD, Nvidia 8600 GT 512MB, 19.5" TFT(Wide), Creative 5.1 Home Theater

Social Group: VBForums - Developers from India

Last edited by akhileshbc; Nov 25th, 2009 at 05:30 AM.
akhileshbc is offline   Reply With Quote
Old Nov 25th, 2009, 01:09 PM   #4
badwl24
New Member
 
Join Date: Nov 09
Posts: 5
badwl24 is an unknown quantity at this point (<10)
Re: help need for creating interface

thanks for your reply...

I got the answer.... i can do now....... thanks once again....... and hope like this future too get help......



with regards
Borad
badwl24 is offline   Reply With Quote
Old Nov 25th, 2009, 09:29 PM   #5
akhileshbc
Engineering Student
 
akhileshbc's Avatar
 
Join Date: Jun 08
Location: Trivandrum, Kerala, India
Posts: 4,563
akhileshbc is a jewel in the rough (200+)akhileshbc is a jewel in the rough (200+)akhileshbc is a jewel in the rough (200+)
Re: help need for creating interface

Quote:
I got the answer.... i can do now.......
Glad to hear that..

If your problem is solved, please mark the thread as Resolved
__________________

If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (from the pull down menu - Thread Tools)

..::~^~ Akhilesh.B.Chandran ~^~::..

My system: AMD Athlon X2 5200+, ASUS Motherboard, 2 GB RAM, 400 GB HDD, Nvidia 8600 GT 512MB, 19.5" TFT(Wide), Creative 5.1 Home Theater

Social Group: VBForums - Developers from India
akhileshbc is offline   Reply With Quote
Old Dec 5th, 2009, 12:51 PM   #6
AsmIscool
Hyperactive Member
 
Join Date: Jun 07
Posts: 266
AsmIscool is on a distinguished road (20+)
Re: [RESOLVED] help need for creating interface

For future reference I cannot see where you have declared cnt. This may be due to my poor eyesight and being a silly old goat but it is a very bad programming practice that will cause you many headaches and probably worse hair loss than I have. You should always use OPTION EXPLICIT in your projects. It will make your life much happier.
__________________
Slower than a crippled Vista
More buggy than a fresh XP install
Look! Down the road, some 50 miles behind the drunken snail.
It's Ubuntu!
AsmIscool is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


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


All times are GMT -5. The time now is 05:40 AM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.