|
-
Nov 8th, 2017, 10:34 AM
#1
Thread Starter
Don't Panic!
[RESOLVED] VB.Net > ASP - What I thought should work, isn`t
Hi
I need a pointer in the right direction or I think I just wont bother messing with .net.... sigh
Code:
Response.Write("<p>jeito 1</p>")
'assume that the order of the elements is generated properly
'so that there is a 'tree' of elements to build
Dim dOrder As New Stack
Dim objOpenOrder(2000) As clsHtmlElement
Dim aParents(2000) As String
Dim lngWhichNivel As Long
Dim lngOpenOrder As Long
Dim lngOpenCtrl As Long
Dim lngCtrl As Long
Dim sRes As New StringBuilder
lngOpenOrder = 0
lngWhichNivel = 1
cForm.setTheNivel(lngWhichNivel)
objOpenOrder(lngOpenOrder) = cForm
aParents(lngOpenOrder) = ""
lngOpenOrder += 1
lngWhichNivel = 2
cDiv.setTheNivel(lngWhichNivel)
cDiv.setParentHtmlId(cForm.getTheID())
objOpenOrder(lngOpenOrder) = cDiv
lngOpenOrder += 1
lngWhichNivel = 3
cLbl.setTheNivel(lngWhichNivel)
cLbl.setParentHtmlId(cDiv.getTheID())
objOpenOrder(lngOpenOrder) = cLbl
lngOpenOrder += 1
cDiv2.setParentHtmlId(cDiv.getTheID())
cDiv2.setTheNivel(lngWhichNivel)
objOpenOrder(lngOpenOrder) = cDiv2
If lngOpenOrder > 0 Then
lngCtrl = 0
Response.Write(objOpenOrder(lngCtrl).htmlStart())
dOrder.Push(lngCtrl)
For lngCtrl = 1 To lngOpenOrder
If objOpenOrder(lngCtrl).getTheNivel() < objOpenOrder(dOrder.Peek()).getTheNivel() Then
Do While objOpenOrder(lngCtrl).getTheNivel() < objOpenOrder(dOrder.Peek()).getTheNivel()
lngOpenCtrl = dOrder.Pop()
Response.Write(objOpenOrder(lngOpenCtrl).htmlEnd())
Loop
Else
If objOpenOrder(lngCtrl).getTheNivel() = objOpenOrder(dOrder.Peek()).getTheNivel() Then
lngOpenCtrl = dOrder.Pop()
Response.Write(objOpenOrder(lngOpenCtrl).htmlEnd())
End If
End If
If lngCtrl <= lngOpenOrder Then
Response.Write(objOpenOrder(lngCtrl).htmlStart())
dOrder.Push(lngCtrl)
End If
Next
End If
'should be one open class minimum
'any open classes...
lngOpenCtrl = dOrder.Pop()
Response.Write(objOpenOrder(lngOpenCtrl).htmlEnd())
If (lngOpenCtrl > 0) Then
Do Until objOpenOrder(lngOpenCtrl).getTheNivel() <= 1
lngOpenCtrl = dOrder.Pop()
Response.Write(objOpenOrder(lngOpenCtrl).htmlEnd())
Loop
End If
This is a first attempt at using vb.net coming from an MS Access/VBA background with a little experience in VB6. Currently using Java/JSP at work.
I managed to create the base class and use new classes extending that.
But I am trying to hold objects of the classes in an array and I thought if I declared the array of the base class I could use any object based off of it. Apparently not as when running with a debug, and using the immediates window it is returning some weird stuff or using the methods of the base instead of the class. So I have obviously got it all wrong...
So.... what to do?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|