|
I found out the reason for the error..;
the error appeared because the of this
Dim parentStack(5) As String now i have changed to
Dim parentStack(10) As String because there may be generations more than 5...
Thank David for all your support and help...
Vijay
|
|
|
|
|
You beat me to it!
I'd just set it to 5 as being reasonable and meant to mention it before as a possible problem.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
|
I'd do something like this
outputLine = parentStack(generation - 1).Trim()
outputLine = outputLine & Space( 40 - outputLine.Length()) & name.Trim()
outputLine = outputLine & Space( 80 - outputLine.Length()) & desF.Trim()
outputLine = outputLine & Space(120 - outputLine.Length()) & desAF.Trim()
etc....
sw.WriteLine(outputLine)
Where you need to change the 80, 120 to suit your spacing.
The secret is to build the output line a bit at a time then write it out.
This way of doing it is inefficient because the outputLine variable is constantly being recreated (because strings are immutable).
If that proves a problem because of performance, take a look at StringBuilder in the help system or any VB.Net book.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
The code I used based on your suggestion...
Code:
parentStack(generation) = name
If (generation > 0) Then
outputLine = parentStack(generation - 1).Trim()
outputLine = outputLine & Space(40 - outputLine.Length()) & name.Trim()
outputLine = outputLine & Space(80 - outputLine.Length()) & desF
sw.WriteLine(outputLine & desAF & desA & desAA & ecn & dnf & baloon)
'sw.WriteLine(parentStack(generation - 1) & name) 'ORIGINAL LINE
Else
'Do you need to do this for lines that have no parent?
outputLine = parentStack(generation).Trim()
outputLine = outputLine & Space(40 - outputLine.Length()) & name.Trim()
outputLine = outputLine & Space(80 - outputLine.Length()) & desF
sw.WriteLine(outputLine & desAF & desA & desAA & ecn & dnf & baloon)
End If
Works fine now.
Thanks a lot
modified on Monday, May 4, 2009 7:43 AM
|
|
|
|
|
Hello every one,
I have a VB 2005 express application. I was changing the interface in IDE (VB 2005 Express By Microsoft). On compiling it gave an error
"The operation could not be completed. Not enough storage is available to complete this operation."
This error was shown on Msgbox(OK Only), on click of "Ok" it opened Save file dialog. I did not saved it. After trying 1-2 more times and googling a bit i decided to close (Without saving) and open the application again.
When i opened the application, the form i was working in is shown blank. I opened the .designer.vb file and resx file. Bot have data in it.
Any idea what has gone wrong and how can i get the thing up back again.
Regards
Nishkarsh
|
|
|
|
|
You could try closing the designer tab for the form, then reopening it, this sometimes works, although not if closing and opening the solution did not cure the problem.
Otherwise, it is a case of going through the .designer.vb code line by line, and fixing any problems manually.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
i have a html file in webserver and when client tries to invoke html thru url...
i need to display(message box) the screenresolution of client using vbscript....Pls help me out..
|
|
|
|
|
Why VBScript and not Java Script? Using Java Script you can use
screen.width
and
screen.height
VBScript will only work in IE.
|
|
|
|
|
Thanks for ur response ......
but im using only vbscript..pls let me know....
|
|
|
|
|
But why? Is the script running in a browser? If so then Java Script will run in any browser, VB Script will only run in Microsoft browsers.
Sorry but I don't how to do it in VB Script.
|
|
|
|
|
Im now doing final year of my studies and im required to come up with a project. pls help me to come up with a project and help me with some ideas that i can develop into a project in vb. Thanks
|
|
|
|
|
To start, what things are YOU interested in? Because writing a program that doens't interest you at all, beats up morale
Motivation is the key to software development.
|
|
|
|
|
It's your project, not our's. If you can't even come up with an idea what to do, drop the whole thing immediately.
|
|
|
|
|
What i want to develop is an industrial manpower management system. A system that should effectively manage the manpower of an industry to improve the performance ( production, manafacturing and all tasks involved in managing manpower) of that industry. Thanks
|
|
|
|
|
I have developed a vb6.0 application with ms access.
Now I want to sell it for trial version.
I want to generate a license key & also i want license agreement.
I want source code for this.
Please any body help me.
thanks in advance
Harika
|
|
|
|
|
vedaharika wrote: I have developed a vb6.0 application with ms access.
Why ? Are you a masochist ?
vedaharika wrote: I want source code for this.
Did you write the other source yourself ? you'll have a hard time, what with VB6 being obsolete, unsupported, and rubbish. Why didn't you use a real language ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
If you wrote an entire application in MS Access you're either dumb or genious. Can't determine which one you are though. License agreements should be written by yourself, and mostly include do's or dont's with your program. You should also consider (when really bringing your Access program on the market) using Copyright.
License keys can be made at random, it just needs a specific 'algorithm'. E.g Number-Numer-Letter-Letter. Then write a program that can generate that sort of keys. Please note that license keys can easily be cracked, when not using internet verification.
Hope this helps you out a bit,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
I have a vague recollection of something called Activelock for VB6.
Have google for for that
|
|
|
|
|
Hi,
I have that activelock for vb6.0
I am not getting how to use it with our application.
please help me in this
|
|
|
|
|
I'm sure activelock website has examples, look at those.
it's a long, long time since I used vb6 and I'm in rush to go back there.
|
|
|
|
|
I'm trying to get a simple e-mail routine to work from my VB.net app. The message appears to be sent (msgbox in SendCompleted event handler), but I never receive the message. I use Yahoo Mail Plus.
Here are the Yahoo settings from Yahoo's help file:
Outgoing Mail (SMTP) Server: plus.smtp.mail.yahoo.com (Use SSL, port: 465, use authentication)
Account Name/Login Name: Your Yahoo! Mail ID (your email address without the "@yahoo.com")
Email Address: Your Yahoo! Mail address (e.g., user@yahoo.com)
Password: Your Yahoo! Mail password
And here is my VB code:
Dim sndr As New SmtpClient("plus.smtp.mail.yahoo.com", 465)
In the form's Load event:
AddHandler sndr.SendCompleted, AddressOf sndr_SendCompleted
The sub that handles the "Send" button's click event:
Private Sub tb_Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_Send.Click
Dim mail As New MailMessage(cmb_From.SelectedItem.ToString, txt_To.Text, txt_Subject.Text, txt_Body.Text)
sndr.UseDefaultCredentials = False
sndr.Credentials = New NetworkCredential(my username, my password)
sndr.EnableSsl = True
sndr.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
Me.Text = "Sending..."
Me.WindowState = FormWindowState.Minimized
Dim zz As Object = "DONE"
sndr.SendAsync(mail, zz)
End Sub
And lastly the SendCompleted event handler:
Private Sub sndr_SendCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) 'Handles sndr.SendCompleted
MsgBox("Message Sent")
Me.Close()
End Sub
Anyone see what I'm doing wrong? I'm not getting any error messages. I don't understand the "User Token" object in the SendAsync method. Perhaps the problem is there? I had no clue what I'm supposed to do with the thing.
Thanks
AB
|
|
|
|
|
Hi,
I don't see anything wrong.
Don't worry about the token in SendAsync, its only purpose is it gets returned to you in the SendCompleted handler through one of the EventArgs properties for your convenience.
Maybe your firewall is blocking port 465?
BTW: I use my provider's mail server, not the Yahoo one. Disadvantage is it only works at home, advantage is the code is simpler, I don't need credentials at the mail level.
|
|
|
|
|
I use Yahoo's web mail interface, so it may be an issue at Yahoo. I'll set up a G-Mail acct tomorrow and see what happens there. If I find out there is something specific to Yahoo I'll post it up here.
Thanks
AB
|
|
|
|
|
Got it to work with Gmail but not with Yahoo. Quizzing Yahoo for help, but they're generally not that helpful with this kind of stuff. With Gmail it was timing out, so I just upped the .Timeout property to 200000 and it works okay. Different problem with Yahoo though. The err msg pops up before the timeout occurs.
|
|
|
|