|
-
Sep 14th, 2012, 04:35 AM
#1
Thread Starter
Lively Member
vb 2010 unbalanced stack
Hi,
Im getting an error if i try to read the file with 'GetVar' when I click on opentoolstripmenu item.
How to I fix this?
this is my error:
Code:
A call to PInvoke function 'Map Editor!Map_Editor.SaveMap::GetPrivateProfileString' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
this is the code:
Code:
Private Sub OpenToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OpenToolStripMenuItem.Click
'LoadMap(InputBox("Please enter the path you want to open.", "Load Map", "\Maps\map1.map"))
Call PutVar("Test.ini", "TEST", "what", "hell5o")
MsgBox(GetVar(Windows.Forms.Application.StartupPath & "/test.ini", "TEST", "what"))
End Sub
this is the sub:
Code:
' Text API
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyname As String, ByVal lpString As String, ByVal lpfilename As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyname As String, ByVal lpdefault As String, ByVal lpreturnedstring As String, ByVal nsize As Long, ByVal lpfilename As String) As Long
Public Function GetVar(File As String, Header As String, Var As String) As String
Dim sSpaces As String ' Max string length
Dim szReturn As String ' Return default value if not found
szReturn = vbNullString
sSpaces = Space$(5000)
Call GetPrivateProfileString((Header), Var, szReturn, sSpaces, Len(sSpaces), File)
GetVar = RTrim$(sSpaces)
GetVar = Left$(GetVar, Len(GetVar) - 1)
End Function
' writes a variable to a text file
Public Sub PutVar(File As String, Header As String, Var As String, Value As String)
Call WritePrivateProfileString((Header), Var, Value, Windows.Forms.Application.StartupPath & "/" & File)
End Sub
-
Sep 14th, 2012, 04:55 AM
#2
Re: vb 2010 unbalanced stack
You look like you're trying to write VB6 code in VB.NET. I suggest that you forget VB6 and start using VB.NET "properly". Your specific issue in this case is the fact that you're using API declarations intended for VB6. API functions almost always use 32-bit numbers, which was type Long in VB6 but is type Integer in VB.NET.
-
Sep 14th, 2012, 05:00 AM
#3
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by jmcilhinney
You look like you're trying to write VB6 code in VB.NET. I suggest that you forget VB6 and start using VB.NET "properly". Your specific issue in this case is the fact that you're using API declarations intended for VB6. API functions almost always use 32-bit numbers, which was type Long in VB6 but is type Integer in VB.NET.
How can I make something like this in vb 2010?
with the streamwriters I can't make something clear as I can with this functions in vb6 because I can arrange my files with headers.
my files will look like this:
Code:
[MAP]
name=testmap
x=20
y=20
[1]
default=true
[2]
default=true
[3]
default=true
-
Sep 14th, 2012, 08:28 AM
#4
Re: vb 2010 unbalanced stack
You're using a ridiculously outdated method of storing settings. This is from the documentation for the WritePrivateProfileString function:
This function is provided only for compatibility with 16-bit versions of Windows. Applications should store initialization information in the registry.
Even using the registry has been outdated for several years now, so using something designed for 16-bit Windows is positively archaic.
If you must retain that file structure then use StreamReaders and StreamWriters. Read the whole lot in, process it, then write the whole lot out. I'd sooner use XML or simply My.Settings though.
-
Sep 14th, 2012, 09:08 AM
#5
Re: vb 2010 unbalanced stack
What kind of information do you intend to store ? Its it configuration settings ? Data records ?
Before suggesting an modern alternative, I'd like to know the nature of the data.
-
Sep 16th, 2012, 11:08 AM
#6
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by Niya
What kind of information do you intend to store ? Its it configuration settings ? Data records ?
Before suggesting an modern alternative, I'd like to know the nature of the data.
i want to store map information (for my 2D-game) in the files.
-
Sep 16th, 2012, 11:26 AM
#7
Re: vb 2010 unbalanced stack
Ah....ok, so does the data you intend to save come from objects ? Or an array ? How do you store the information in memory ?
-
Sep 16th, 2012, 12:37 PM
#8
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
With structures;
Public const max_layers = 4
Public const max_x = 200
Public const max_y = 200
Public tile(max_layers, max_x, max_y) as tilerec
Public structure tilerec
Public x as integer
Public y as integer
Public data as integer
Public name as string
End structure
The data Should be saved for each tile
so you'll have loads of information in the file.
Do you understand?
-
Sep 16th, 2012, 02:18 PM
#9
Re: vb 2010 unbalanced stack
Well my friend the solution is far more simple than you realize:-
vbnet Code:
Public Class MapInfo Private _colTiles As New Collections.ObjectModel.Collection(Of tilerec) Public Property Tiles() As Collections.ObjectModel.Collection(Of tilerec) Get Return _colTiles End Get Set(ByVal value As Collections.ObjectModel.Collection(Of tilerec)) _colTiles = value End Set End Property End Class
You can create a class like the above and use XML serialization to save and load:-
vbnet Code:
' Public Function LoadMapInfo(ByVal fileName As String) As MapInfo Dim ser As New XmlSerializer(GetType(MapInfo)) Dim fs As New FileStream(fileName, FileMode.Open) Dim ret As MapInfo ret = ser.Deserialize(fs) fs.Close() fs.Dispose() Return ret End Function Public Sub SaveMapInfo(ByVal map As MapInfo, ByVal fileName As String) Dim ser As New XmlSerializer(GetType(MapInfo)) Dim fs As New FileStream(fileName, FileMode.Create) ser.Serialize(fs, map) fs.Close() fs.Dispose() End Sub
The above functions can load and save the class to a file and load it back. Here is an example of their use:-
vbnet Code:
' Dim mi As New MapInfo mi.Tiles.Add(New tilerec With {.data = 12, .name = "Unknown", .x = 11, .y = 0}) mi.Tiles.Add(New tilerec With {.data = 11, .name = "Bing", .x = 12, .y = 4}) mi.Tiles.Add(New tilerec With {.data = 122, .name = "True", .x = 40, .y = 155}) mi.Tiles.Add(New tilerec With {.data = 3000, .name = "GRRR...!!", .x = 30, .y = 122}) SaveMapInfo(mi, "c:\MI.TXT") Dim mi2 As MapInfo = LoadMapInfo("C:\MI.TXT")
The saved data would look like this:-
xml Code:
<?xml version="1.0"?> <MapInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Tiles> <tilerec> <x>11</x> <y>0</y> <data>12</data> <name>Unknown</name> </tilerec> <tilerec> <x>12</x> <y>4</y> <data>11</data> <name>Bing</name> </tilerec> <tilerec> <x>40</x> <y>155</y> <data>122</data> <name>True</name> </tilerec> <tilerec> <x>30</x> <y>122</y> <data>3000</data> <name>GRRR...!!</name> </tilerec> </Tiles> </MapInfo>
However, games generally don't save their map data in a text format like Xml. A binary version of the same data would be far smaller in size and much faster in IO operations. You should consider that, its not absolutely necessary, its just more efficient. It should only take a mild alteration to the above code to make it serialize as a binary file instead of Xml.
Last edited by Niya; Sep 16th, 2012 at 02:25 PM.
-
Sep 16th, 2012, 03:07 PM
#10
Re: vb 2010 unbalanced stack
 Originally Posted by Niya
Well my friend the solution is far more simple than you realize:-
vbnet Code:
Public Class MapInfo
Private _colTiles As New Collections.ObjectModel.Collection(Of tilerec)
Public Property Tiles() As Collections.ObjectModel.Collection(Of tilerec)
Get
Return _colTiles
End Get
Set(ByVal value As Collections.ObjectModel.Collection(Of tilerec))
_colTiles = value
End Set
End Property
End Class
You can create a class like the above and use XML serialization to save and load:-
vbnet Code:
'
Public Function LoadMapInfo(ByVal fileName As String) As MapInfo
Dim ser As New XmlSerializer(GetType(MapInfo))
Dim fs As New FileStream(fileName, FileMode.Open)
Dim ret As MapInfo
ret = ser.Deserialize(fs)
fs.Close()
fs.Dispose()
Return ret
End Function
Public Sub SaveMapInfo(ByVal map As MapInfo, ByVal fileName As String)
Dim ser As New XmlSerializer(GetType(MapInfo))
Dim fs As New FileStream(fileName, FileMode.Create)
ser.Serialize(fs, map)
fs.Close()
fs.Dispose()
End Sub
The above functions can load and save the class to a file and load it back. Here is an example of their use:-
vbnet Code:
'
Dim mi As New MapInfo
mi.Tiles.Add(New tilerec With {.data = 12, .name = "Unknown", .x = 11, .y = 0})
mi.Tiles.Add(New tilerec With {.data = 11, .name = "Bing", .x = 12, .y = 4})
mi.Tiles.Add(New tilerec With {.data = 122, .name = "True", .x = 40, .y = 155})
mi.Tiles.Add(New tilerec With {.data = 3000, .name = "GRRR...!!", .x = 30, .y = 122})
SaveMapInfo(mi, "c:\MI.TXT")
Dim mi2 As MapInfo = LoadMapInfo("C:\MI.TXT")
The saved data would look like this:-
xml Code:
<?xml version="1.0"?>
<MapInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Tiles>
<tilerec>
<x>11</x>
<y>0</y>
<data>12</data>
<name>Unknown</name>
</tilerec>
<tilerec>
<x>12</x>
<y>4</y>
<data>11</data>
<name>Bing</name>
</tilerec>
<tilerec>
<x>40</x>
<y>155</y>
<data>122</data>
<name>True</name>
</tilerec>
<tilerec>
<x>30</x>
<y>122</y>
<data>3000</data>
<name>GRRR...!!</name>
</tilerec>
</Tiles>
</MapInfo>
However, games generally don't save their map data in a text format like Xml. A binary version of the same data would be far smaller in size and much faster in IO operations. You should consider that, its not absolutely necessary, its just more efficient. It should only take a mild alteration to the above code to make it serialize as a binary file instead of Xml.
Tiles should be a readonly property
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 16th, 2012, 03:21 PM
#11
Re: vb 2010 unbalanced stack
The XmlSerializer doesn't save read only properties. It only saves public read/write properties. The BinaryFormatter can though. It serializes private fields unlike the XmlSerializer.
-
Sep 17th, 2012, 11:41 AM
#12
Re: vb 2010 unbalanced stack
If you really have to use INI files (which is archaic and outdated when there is XML, binary serialization, and the settings file to store information (which is technically an XML file anyway)), then use a managed library that already handles the work for you.
I highly suggest you use Niya's code; it's simple, efficient, and does exactly what you need.
-
Sep 17th, 2012, 12:42 PM
#13
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
I will get an error and an implicit conversion
-
Sep 17th, 2012, 12:46 PM
#14
Re: vb 2010 unbalanced stack
1/ where is the TileRec structure? it's a scope error
2/ try: directcast(ser.deserialize(fs), MapInfo)
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 17th, 2012, 12:47 PM
#15
Re: vb 2010 unbalanced stack
1/ where is the TileRec structure? it's a scope error
2/ try: directcast(ser.deserialize(fs), MapInfo)
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 17th, 2012, 01:09 PM
#16
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by .paul.
1/ where is the TileRec structure? it's a scope error
2/ try: directcast(ser.deserialize(fs), MapInfo)
my tilerec structure is in the 'module structures' so I can access it from everywhere.
Code:
Private Sub picMap_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles picMap.MouseMove
Dim X As Integer = CInt(Math.Floor(e.X / 32))
Dim Y As Integer = CInt(Math.Floor(e.Y / 32))
If X < 0 Or Y < 0 Then Exit Sub
Select Case GetEditMode()
Case EditMode.Paint
If e.Button = Windows.Forms.MouseButtons.Left Then
With Tile(GetLayer, X, Y)
.TileSet = CInt(Me.nudTileset.Value)
.X = Mouse.tX
.Y = Mouse.tY
.Draw = True
End With
End If
If e.Button = Windows.Forms.MouseButtons.Right Then
With Tile(GetLayer, X, Y)
.TileSet = 0
.X = 0
.Y = 0
.Draw = False
End With
End If
Case EditMode.Data
End Select
End Sub
If I put the TileRec structure in the MapInfo class Ill get other errors because the TileRec does not exist
-
Sep 17th, 2012, 03:06 PM
#17
Re: vb 2010 unbalanced stack
The error you're getting about the type being exposed is a scope error as paul suggests. My guess is that you declared the TileRec structure as Friend and MapInfo as Public which would cause that error. Changing TileRec to a Public declaration would fix that problem.
Paul already told you how to fix the implicit conversion error.
EDIT
Actually, I just remembered that modules default to Friend access in VB.Net which means that anything declared in it cannot be exposed outside the assembly. Declare your module as Public.
Last edited by Niya; Sep 17th, 2012 at 03:10 PM.
-
Sep 17th, 2012, 03:45 PM
#18
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by Niya
The error you're getting about the type being exposed is a scope error as paul suggests. My guess is that you declared the TileRec structure as Friend and MapInfo as Public which would cause that error. Changing TileRec to a Public declaration would fix that problem.
Paul already told you how to fix the implicit conversion error.
EDIT
Actually, I just remembered that modules default to Friend access in VB.Net which means that anything declared in it cannot be exposed outside the assembly. Declare your module as Public.
I'm sorry I didnt really get it.
this is my ClassMapinfo and my module structures. What do I need to change in the Module structures -> TileRec so it will work?
Code:
Imports System.IO
Imports System.Xml.Serialization
Public Class MapInfo
Private _colTiles As New Collections.ObjectModel.Collection(Of TileRec)
Public Property Tiles() As Collections.ObjectModel.Collection(Of TileRec)
Get
Return _colTiles
End Get
Set(ByVal value As Collections.ObjectModel.Collection(Of TileRec))
_colTiles = value
End Set
End Property
Public Function LoadMapInfo(ByVal fileName As String) As MapInfo
Dim ser As New XmlSerializer(GetType(MapInfo))
Dim fs As New FileStream(fileName, FileMode.Open)
Dim ret As MapInfo
ret = DirectCast(ser.Deserialize(fs), MapInfo)
fs.Close()
fs.Dispose()
Return ret
End Function
Public Sub SaveMapInfo(ByVal map As MapInfo, ByVal fileName As String)
Dim ser As New XmlSerializer(GetType(MapInfo))
Dim fs As New FileStream(fileName, FileMode.Create)
ser.Serialize(fs, map)
fs.Close()
fs.Dispose()
End Sub
End Class
Code:
Module Structures
Public MapEditor As MapEditorOptions
Public IsRunning As Boolean = False
Public Tile(MAX_LAYERS, 0 To 200, 0 To 200) As TileRec
Public Map As MapRec
Public Mouse As MouseRec
Public View As ViewRec
Public Structure ViewRec
Public Ground As Boolean
Public Mask As Boolean
Public Mask2 As Boolean
Public Fringe As Boolean
Public Fringe2 As Boolean
Public Data As Boolean
End Structure
Public Structure MouseRec
'Mouse Down
Public tX As Integer
Public tY As Integer
'Mouse Hover
Public thX As Integer
Public thY As Integer
'Mouse Up
Public tuX As Integer
Public tuY As Integer
End Structure
Public Structure MapRec
Public X As Integer
Public Y As Integer
End Structure
Public Structure TileRec
Public X As Integer
Public Y As Integer
Public TileSet As Integer
Public Draw As Boolean
Public Data As TileType
End Structure
Public Structure MapEditorOptions
Public Map_Grid As Boolean
Public Tile_Grid As Boolean
End Structure
End Module
edit:
ah I need to change 'Module Structures' to 'Public Module Structures'
-
Sep 17th, 2012, 05:13 PM
#19
Re: vb 2010 unbalanced stack
 Originally Posted by jimpie
ah I need to change 'Module Structures' to 'Public Module Structures'
Yep.......
-
Sep 18th, 2012, 09:51 AM
#20
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by jimpie
I'm sorry I didnt really get it.
this is my ClassMapinfo and my module structures. What do I need to change in the Module structures -> TileRec so it will work?
Code:
Imports System.IO
Imports System.Xml.Serialization
Public Class MapInfo
Private _colTiles As New Collections.ObjectModel.Collection(Of TileRec)
Public Property Tiles() As Collections.ObjectModel.Collection(Of TileRec)
Get
Return _colTiles
End Get
Set(ByVal value As Collections.ObjectModel.Collection(Of TileRec))
_colTiles = value
End Set
End Property
Public Function LoadMapInfo(ByVal fileName As String) As MapInfo
Dim ser As New XmlSerializer(GetType(MapInfo))
Dim fs As New FileStream(fileName, FileMode.Open)
Dim ret As MapInfo
ret = DirectCast(ser.Deserialize(fs), MapInfo)
fs.Close()
fs.Dispose()
Return ret
End Function
Public Sub SaveMapInfo(ByVal map As MapInfo, ByVal fileName As String)
Dim ser As New XmlSerializer(GetType(MapInfo))
Dim fs As New FileStream(fileName, FileMode.Create)
ser.Serialize(fs, map)
fs.Close()
fs.Dispose()
End Sub
End Class
Code:
Module Structures
Public MapEditor As MapEditorOptions
Public IsRunning As Boolean = False
Public Tile(MAX_LAYERS, 0 To 200, 0 To 200) As TileRec
Public Map As MapRec
Public Mouse As MouseRec
Public View As ViewRec
Public Structure ViewRec
Public Ground As Boolean
Public Mask As Boolean
Public Mask2 As Boolean
Public Fringe As Boolean
Public Fringe2 As Boolean
Public Data As Boolean
End Structure
Public Structure MouseRec
'Mouse Down
Public tX As Integer
Public tY As Integer
'Mouse Hover
Public thX As Integer
Public thY As Integer
'Mouse Up
Public tuX As Integer
Public tuY As Integer
End Structure
Public Structure MapRec
Public X As Integer
Public Y As Integer
End Structure
Public Structure TileRec
Public X As Integer
Public Y As Integer
Public TileSet As Integer
Public Draw As Boolean
Public Data As TileType
End Structure
Public Structure MapEditorOptions
Public Map_Grid As Boolean
Public Tile_Grid As Boolean
End Structure
End Module
edit:
ah I need to change 'Module Structures' to 'Public Module Structures'
The code can save the tilerec now, that's right.. But it can't save the data for each diffrent tile. All my tiles will have the same data now
Code:
For x = 0 To Map.X
For y = 0 To Map.Y
mi.Tiles.Add(New TileRec With {.X = 1, .Y = 1, .TileSet = 1, .Draw = True, .Data = 0})
Next
Next
it should specially save the Tile(Layer type, X of the map, Y of the map) variable. Now it just saves the same data for each layer type, X of the map and Y of the map.
Code:
For x = 0 To Map.X
For y = 0 To Map.Y
Tile(LAYER_GROUND, x, y).X = 1
Tile(LAYER_GROUND, x, y).Y = 1
Tile(LAYER_GROUND, x, y).Data = 1
Next
Next
-
Sep 18th, 2012, 11:32 AM
#21
Re: vb 2010 unbalanced stack
Ummm...I'm really confused now...could you simplify that explanation.
-
Sep 19th, 2012, 09:56 AM
#22
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by Niya
Ummm...I'm really confused now...could you simplify that explanation.
Each map has a MapRec (Map Structure). Each map also have tile's.
A tile is the coordinate of the map (example tile x=5, y=5). Each Tile hold its own information (the X IN the image it should draw, the Y IN the image it should draw, Data with information about the tile e.g. is it a walkable tile or not).
The tile information is hold in the TileRec structure.
Code:
Public Map as MapRec
public Tile(0 To MAX_LAYERS, 0 To MAX_X, 0 to MAX_Y)
public CONST MAX_LAYERS = 1 'the ammount of layers
public const MAX_X = 200 'the maximum size of the map (each map can have its own size with a maximum of x = 200)
public const MAX_Y = 200 'the maximum size of the map (each map can have its own size with a maximum of y = 200)
public CONST LAYER_GROUND = 0 'the first layer
public const LAYER_MASK = 1 'the second layer
Public Structure MapRec
Public X as integer 'The max X of the map
public Y as itneger 'The max Y of the map
public Name as string 'The name of the map
End Structure
public structure TileRec
Public X as integer
public Y as integer
public Data as Integer
end structure
The Map AND Tile information should be saved to a file. Something like this
Code:
public sub SaveMap(Byval FileName as string)
'first it should save the map data for when loading the map back
Map.X 'here it should write the Map.X to the file
Map.Y 'here it should write the Map.Y to the file
Map.Name 'here it should write the Map.Name to the file
'here it should save the tiledata (the tilerec)
For x = 0 To Map.X '0 to the max x of the map so it will save ALL tiles
For y = 0 To Map.Y '0 to the max y of the map so it will save ALL tiles
For L = 0 to Max_Layers '0 to the max layers to save each layer
tile(L, X, Y).X 'here it should write the variable X of tile(<layer>, <x>, <y>).X to the file
tile(L, X, Y).Y 'here it should write the variable Y of tile(<layer>, <x>, <y>).Y to the file
tile(L, X, Y).Data 'here it should write the variable Data of tile(<layer>, <x>, <y>).Data to the file
Next
Next
Next
end sub
public sub LoadMap(Byval FileName as string)
'first it should read the Map.X and the Map.Y to know the size so:
Map.X = Read... 'read the file for the Map.X
Map.Y = Read... 'read the file for the Map.Y
'now it should load all tile data and put all the data in the correct tile
for x = 0 to map.x
for y = 0 to map.y
for l = 0 to max_layers
tile(l, x, y).X = read.. 'read the X variable of tile(<layer>, <x>, <y>).X
tile(l, x, y).Y = read.. 'read the Y variable of tile(<layer>, <x>, <y>).Y
tile(l, x, y).Data = read.. 'read the Data variable of tile(<layer>, <x>, <y>).Data
next
next
next
end sub
Do you understand it now?
-
Sep 19th, 2012, 01:38 PM
#23
Re: vb 2010 unbalanced stack
Ok...so MapRec is meant to hold all the information about a map including the tiles that make it up ? If so then why isn't the TileRec array defined inside the MapRec structure ?
-
Sep 21st, 2012, 04:14 AM
#24
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by Niya
Ok...so MapRec is meant to hold all the information about a map including the tiles that make it up ? If so then why isn't the TileRec array defined inside the MapRec structure ?
because structures can't have initial sizes
Code:
Public Structure MapRec
Public X As Integer
Public Y As Integer
Public Tile(MAX_LAYERS, max_x, Max_y) As TileRec
End Structure
"Error 1 Arrays declared as structure members cannot be declared with an initial size."
-
Sep 21st, 2012, 12:56 PM
#25
Re: vb 2010 unbalanced stack
The solution is simple then...make it a class. As a matter of fact, I would have never made it a structure in the first place.
-
Sep 22nd, 2012, 03:23 AM
#26
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by Niya
The solution is simple then...make it a class. As a matter of fact, I would have never made it a structure in the first place.
Can you give me an example of a class?
-
Sep 22nd, 2012, 05:42 AM
#27
Re: vb 2010 unbalanced stack
here's a class:
vb.net Code:
Public Class MapRec
Public X As Integer
Public Y As Integer
Public Tile(MAX_LAYERS, max_x, Max_y) As TileRec
End Class
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 23rd, 2012, 05:11 AM
#28
Thread Starter
Lively Member
Re: vb 2010 unbalanced stack
 Originally Posted by .paul.
here's a class:
vb.net Code:
Public Class MapRec
Public X As Integer
Public Y As Integer
Public Tile(MAX_LAYERS, max_x, Max_y) As TileRec
End Class
and how will I save/load the class now?
-
Sep 23rd, 2012, 02:07 PM
#29
Re: vb 2010 unbalanced stack
Use the save function I gave you. Adapt it to use the the MapRec type.
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
|