473,326 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Structures

1
Can anyone tell me how to save the values of structure to a file so that i can reaload them later?


Dim fxFixture as new Fixture
Dim fxFixture2 as new Fixture
fxFixture.Model = "ModelName"
fxFixture.SaveToFile("C:\test")
fxFixture2.LoadFromFile("C:\test")


Module Module1
Public Structure Fixture
Public Patch As Integer
Public Maker As String
Public Model As String
Public Mode As String
Public Channels As Integer
Public Fogger As Boolean
Public FanChannel As Integer
Public FogChannel As Integer
Public GoboWheel1 As GoboWheel
Public GoboWheel2 As GoboWheel
Public GoboWheel3 As GoboWheel
Public ColourWheel1 As ColourWheel
Public ColourWheel2 As ColourWheel
Public ColourWheel3 As ColourWheel
Public CMY As Boolean
Public RGB As Boolean
Public CyanChannel As Integer
Public MagentaChannel As Integer
Public YellowChannel As Integer
Public RedChannel As Integer
Public GreenChannel As Integer
Public BlueChannel As Integer
Public ChannelDescriptions As Collections.ObjectModel.Collection(Of String)
Public Pan8bit As Integer
Public Pan16bit As Integer
Public Tilt8bit As Integer
Public Tilt16bit As Integer
Public ResetChannel As Integer
Public ResetValue As Integer
Public ShutterChannel As Integer
Public ShutterOpenValue As Integer
Public ShutterClosedValue As Integer
Public StrobeChannel As Integer
Public StrobeLow As Integer
Public StrobeHigh As Integer
Public PulseChannel As Integer
Public PulseOpenSlow As Integer
Public PulseOpenFast As Integer
Public PulseClosedSlow As Integer
Public PulseClosedFast As Integer
Public IntensityChannel As Integer
Public LampChannel As Integer
Public LampOff As Integer
Public LampOn As Integer
Public IrisChannel As Integer
Public ZoomChannel As Integer
Public FocusChannel As Integer
Public FrostChannel As Integer
Public Frost2Channel As Integer
Public PrismChannel As Integer
Public PrismOn As Integer
Public PrismOff As Integer
Public PrismRotateChannel As Integer
Public PrismRotateClockwiseSlow As Integer
Public PrismRotateAntiClockwiseSlow As Integer
Public PrismRotateClockwiseFast As Integer
Public PrismRotateAntiClockwiseFast As Integer
Public Sub Start()
If Not LampChannel = 0 Then SetDMX(Patch - 1 + LampChannel, LampOn)
If Not Pan8bit = 0 Then SetDMX(Patch - 1 + Pan8bit, 128)
If Not Pan16bit = 0 Then SetDMX(Patch - 1 + Pan16bit, 128)
If Not Tilt8bit = 0 Then SetDMX(Patch - 1 + Tilt8bit, 128)
If Not Tilt16bit = 0 Then SetDMX(Patch - 1 + Tilt16bit, 128)
If Not IntensityChannel = 0 Then SetDMX(Patch - 1 + IntensityChannel, 0)
End Sub
Public Sub LoadFromFile(ByVal strFile As String)

End Sub
Public Sub SaveToFile(ByVal strFile As String)

End Sub
End Structure

Public Structure GoboWheel
Public GoboChannel As Integer
Public GoboCount As Integer
Public RotateChannel As Integer
Public RotateClockwiseSlow As Integer
Public RotateAntiClockwiseSlow As Integer
Public RotateClockwiseFast As Integer
Public RotateAntiClockwiseFast As Integer
Public Gobos As Collections.ObjectModel.Collection(Of Gobo)
End Structure
Public Structure Gobo
Public IndexValue As Integer
Public RotateValue As Integer
Public ShakeSlow As Integer
Public ShakeFast As Integer
Public Image As Image
End Structure
Public Structure ColourWheel
Public ColourChannel As Integer
Public ColourCount As Integer
Public Colours As Collections.ObjectModel.Collection(Of Colour)
Public RotateChannel As Integer
Public RotateClockwiseSlow As Integer
Public RotateAntiClockwiseSlow As Integer
Public RotateClockwiseFast As Integer
Public RotateAntiClockwiseFast As Integer
Public RandomSlow As Integer
Public RandomFast As Integer
End Structure
Public Structure Colour
Public ScrollingValue As Integer
Public SteppedValue
Public Red As Integer
Public Green As Integer
Public Blue As Integer
End Structure
Public Sub SetDMX(ByVal intPatchNumber As Integer, ByVal intValue As Integer)

End Sub
End Module
Dec 30 '06 #1
1 1139
Killer42
8,435 Expert 8TB
This is VB.Net, right? If it was VB6 I'd say to open your file in binary mode, and then you just Put the "structure variable". To read it, open in binary mode and Get into the same structure. As for .Net, I have no idea what the equivalent would be.
Dec 31 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: kazack | last post by:
Hi all it's me again with another question as I got further in my book. The chapter I am in covers structres, abstract data and classes. I only read through to the end of the coverage on...
33
by: Peter Seaman | last post by:
I understand that structures are value types and arrays and classes are reference types. But what about arrays as members of structures i.e. as in C struct x { int n; int a; }
6
by: Ken Allen | last post by:
OK, I admit that I have been programming since before C++ was invented, and I have developed more than my share of assembly language systems, and even contributed to operating system and compiler...
7
by: John Dann | last post by:
I'm trying to read some binary data from a file created by another program. I know the binary file format but can't change or control the format. The binary data is organised such that it should...
14
by: pmclinn | last post by:
I've noticed that many programmers use classes to store data about such things like: Class Customers .....Phone ....ID ....Address End Class....
2
by: thomasfarrow | last post by:
At work, our development team has a development standards document that insists Structures should never be used. I'm looking to change this standard but need a suitable argument in order to make...
11
by: efrat | last post by:
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure...
44
by: svata | last post by:
Hello, I wonder how to resize such array of structures using realloc()? #include <stdio.h> #include <stdlib.h> #define FIRST 7 typedef struct { char *name;
4
by: cleanrabbit | last post by:
Hello! I hate having to do this, because im almost certain there is someone in the world that has come across this problem and i just havent found their solution yet, so i do appologise if this...
8
by: Bob Altman | last post by:
Hi all, I have a structure that includes a constructor. I want to add a bunch of these structures to an STL map (whose index is an int). If I define the map like this: map<int,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.