Hi, I want to convert several Functions in VB .NET to one.
For that i need to make a late Dim but I can't get it to work.
I always get compile errors...
It is a simple search and return position in a file.
If anyone knows how to fix it it would be great.
Here's the code NOT working(but gives you the idea of what i want):
node_pizza and node_drinks are structures
Thanks
For that i need to make a late Dim but I can't get it to work.
I always get compile errors...
It is a simple search and return position in a file.
If anyone knows how to fix it it would be great.
Here's the code NOT working(but gives you the idea of what i want):
Code:
Public Function Get_ (ByVal nome As String, ByVal type As String)
Dim posi As Short
Select Case type
Case "pizzas"
Dim node As node_pizza
file = 1
Case "drinks"
Dim node As node_drinks
file = 2
End Select
FileGet(file, node, 1)
posi = node.next
FileGet(file, node, posi)
While (posi<> 1 AndAlso String.Compare(Trim(node.name), name) <> 0)
posi = node.next
FileGet(file, node,posi)
End While
Return posi
End Function
node_pizza and node_drinks are structures
Thanks