Click here to Skip to main content
15,902,112 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Cannot connect to a secure database using ADO Pin
Joshua Quick19-May-06 7:16
Joshua Quick19-May-06 7:16 
GeneralRe: Cannot connect to a secure database using ADO Pin
Quecumber25619-May-06 8:02
Quecumber25619-May-06 8:02 
QuestionShow() + Focus problem Pin
Phoen2518-May-06 9:28
Phoen2518-May-06 9:28 
QuestionCall VB program with a parm Pin
Sy Black18-May-06 8:44
Sy Black18-May-06 8:44 
AnswerRe: Call VB program with a parm Pin
Joshua Quick18-May-06 17:22
Joshua Quick18-May-06 17:22 
GeneralRe: Call VB program with a parm [modifed] Pin
Scott Serl19-May-06 11:13
Scott Serl19-May-06 11:13 
GeneralRe: Call VB program with a parm [modifed] Pin
Joshua Quick19-May-06 12:06
Joshua Quick19-May-06 12:06 
QuestionHow track and step out of recursive method Pin
erikkl200018-May-06 8:29
erikkl200018-May-06 8:29 
I have got a method that recursively loops through directories and pulls either Pictures or Plans out of there respective directory.. Each plan or picture may or may not have a description associated with it.. I finally got the method to where everything is in sync and not throwing any errors..

Here is what i need help with..

Where i keep calling this method while i am still in the method but i would like to do this with these changes..
1. Remove the parameters and somehow reset the true and false with in the method itself
2. What is the best way to keep track of the built objects while the method is called over and over.. i loose my values when recalling...

I guess what i am saying is that once i am in the method i need a way to recursively keep calling the method and be able to keep track of my built object and then i need a way to step out of the method after certain events have happened..

One of the reason that i am asking is becasuse i just flat out need some advice on this one..

PLEASE.... SOS


Next (s)
End If
FileHandler(False, True) <-----something different here..
End Sub

------------------------

Thanks..

erik






Private Sub FileHandler(Optional ByVal ForPlan As Boolean = True, Optional ByVal ForPic As Boolean = False)
Dim strPlans() As String = Directory.GetFiles(Server.MapPath(m_Path & "Plans"))
Dim strPics() As String = Directory.GetFiles(Server.MapPath(m_Path & "Pictures"), "s_A-F-C-C-*")
Dim gstrFiles() As String = {}
Dim strPlanDesc() As String = Directory.GetFiles(Server.MapPath(m_Path & "Plans/Temp/"))
Dim strPicDesc() As String = Directory.GetFiles(Server.MapPath(m_Path & "Pictures/Temp/"))
Dim gstrDescr() As String = {}
Dim oFiles As AFCCServices.Files = Nothing
Dim strDirecType As String = ""
Dim strExt As String = ""
Dim strHolder As String = ""
Dim iNum As Byte = 0

---I know this is not right but i am still trying to figure all of this out
Dim i As Int16 = CShort(strPics.Length)
Dim ii As Int16 = CShort(strPlans.Length)
Dim iii As Int16 = i + ii
Dim aServ(iii)As AFCCServices.Files
-----
Dim aFsPicDescr(strPicDesc.GetUpperBound(0)) As AFCCServices.Files
Dim aFsPlanDescr(strPlanDesc.GetUpperBound(0)) As AFCCServices.Files
If ForPlan = True Then
gstrFiles = strPlans
gstrDescr = strPlanDesc
End If
If ForPic = True Then
gstrFiles = strPics
gstrDescr = strPicDesc
End If
If gstrFiles.Length > 0 Then
For Each s As String In gstrFiles
oFiles = New AFCCServices.Files
oFiles.Name = Path.GetFileName(s)
If ForPlan = True Then oFiles.Type = Global.AFCCServices.FilesType.Plan
If ForPic = True Then oFiles.Type = Global.AFCCServices.FilesType.Picture

s = Path.GetFileName(s)
strExt = Path.GetExtension(s)
s = s.Replace(strExt, "")
If gstrDescr.GetUpperBound(0) > 0 Then
For Each ss As String In gstrDescr
strHolder = ss
strHolder = Path.GetFileName(strHolder)
strExt = Path.GetExtension(strHolder)
strHolder = strHolder.Replace(strExt, "")

If strHolder.Replace("p_AFCC_PlanRef_", "") = s.ToString Then

'Get the text from the text file
Try
If ForPlan = True Then strDirecType = "Plans"
If ForPic = True Then strDirecType = "Pictures"
' Create an instance of StreamReader to read from a file.
Using sr As StreamReader = New StreamReader(Server.MapPath(m_Path & strDirecType & "/Temp/" & Path.GetFileName(ss)))
Dim line As String
' Read and display the lines from the file until the end
' of the file is reached.
Do
line = sr.ReadLine()
oFiles.Description = oFiles.Description & (line)
Loop Until line Is Nothing
sr.Close()
End Using
Catch e As Exception
' Let the user know what went wrong.
End Try
End If
Next (ss)
End If
If ForPlan = True Then aFsPlanDescr(iNum) = oFiles
If ForPic = True Then aFsPicDescr(iNum) = oFiles
aServ(iNum) = aFsPlanDescr(iNum)
iNum = CByte(iNum + 1)
Next (s)
End If
FileHandler(False, True)
End Sub
QuestionWindows Service issue!!! Pin
alexvw18-May-06 7:48
alexvw18-May-06 7:48 
AnswerRe: Windows Service issue!!! Pin
Rizwan Bashir19-May-06 5:05
Rizwan Bashir19-May-06 5:05 
GeneralThanks... Pin
alexvw19-May-06 6:29
alexvw19-May-06 6:29 
Questionerror while running from a network machine Pin
Paps218-May-06 6:19
Paps218-May-06 6:19 
AnswerRe: error while running from a network machine Pin
Dave Bacher18-May-06 7:58
Dave Bacher18-May-06 7:58 
QuestionWhat is the Select Case syntax for Radio Buttons / textboxes in a GroupBox Control? Pin
Rashar18-May-06 5:55
Rashar18-May-06 5:55 
AnswerRe: What is the Select Case syntax for Radio Buttons / textboxes in a GroupBox Control? Pin
Raistlin21_4519-May-06 4:54
Raistlin21_4519-May-06 4:54 
QuestionWindows hook help Pin
Member 296885118-May-06 5:10
Member 296885118-May-06 5:10 
AnswerRe: Windows hook help Pin
MohammadAmiry18-May-06 5:19
MohammadAmiry18-May-06 5:19 
QuestionWebbrowser control help Pin
Member 296885118-May-06 5:06
Member 296885118-May-06 5:06 
QuestionMAPI Pin
cj433118-May-06 5:03
cj433118-May-06 5:03 
AnswerRe: MAPI Pin
Dave Bacher18-May-06 7:41
Dave Bacher18-May-06 7:41 
GeneralRe: MAPI Pin
cj433118-May-06 8:04
cj433118-May-06 8:04 
GeneralRe: MAPI Pin
cj433118-May-06 8:24
cj433118-May-06 8:24 
GeneralRe: MAPI Pin
cj433119-May-06 4:56
cj433119-May-06 4:56 
QuestionApplication.Undo Method Pin
slw1234@sbcglobal.net18-May-06 4:28
slw1234@sbcglobal.net18-May-06 4:28 
Questionproble in landscape and portrait images in asp.net 1.1 Pin
amaneet18-May-06 3:00
amaneet18-May-06 3:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.