Interestingly enough, I was able to export and import an array. This uses a text file to hold the array formatted in a multidimensional delimited manner. This will be cool to use!
SyntaxEditor Code Snippet
'Option explicit Off
Dim Matrix(5, 5, 5) As Double
Dim y As Integer
Dim x As Integer
Dim z As Integer
Dim user_y As String
Dim user_x As String
Dim user_z As String
Dim t As Integer
t = 0
y = 0
x = 0
z = 0
For x = 0 To 4
For y = 0 To 4
For z = 0 To 4
Matrix(x, y, z) = t.ToString
t = t + 1
Next
Next
Next
MessageBox.Show(Matrix.Rank & "=Rank & " & Matrix.Length & "=Length", "Dimensions")
Dim cycle As Integer
cycle = 0
While cycle <1
user_x = InputBox("Insert x-value", "Value Inquiry", "0")
user_y = InputBox("Insert y-value", "Value Inquiry", "0")
user_z = InputBox("Insert z-value", "Value Inquiry", "0")
MessageBox.Show(Matrix(Val(user_x), Val(user_y), Val(user_z)).ToString, "Value Inquiry Results")
Dim bool1 As Boolean
bool1 = InputRadioBox("Retry?", "Yes", "No", True, Title := "Program Cycle")
If bool1 = True
cycle = 0
Else
cycle = 1
End If
End While
Dim bool2 As Boolean
bool2 = InputRadioBox("Export Array?", "Yes", "No", True, Title := "Array Export")
''Export
Dim Temporary_x As String
Dim Temporary_y As String
Dim Collective As String
' Collective = "{"
' Temporary_y = ""
' Temporary_x = ""
If bool2 = True
Collective = ""
For z = 0 To Matrix.GetLength(2)-2
Temporary_y = ""
For y = 0 To Matrix.GetLength(1)-2
Temporary_x = ""
For x = 0 To Matrix.GetLength(0)-2
If x = 0
Temporary_x = Matrix(x,y,z).ToString
Else
Temporary_x = Temporary_x & ":" & Matrix(x,y,z).ToString
End If
Next
If y = 0
Temporary_y = Temporary_x
Else
Temporary_y = Temporary_y & "," & Temporary_x
End If
Next
If z = 0
Collective = Temporary_y
Else
Collective = Collective & ";" & Temporary_y
End If
Next
Else
End If
'WriteAllText("Libraries\Documents\Test_1.txt",Collective.ToString)
oWrite = System.IO.File.CreateText(ThisDoc.PathAndFileName(False) & ".txt")
oWrite.WriteLine(Collective.ToString)
oWrite.Close
MessageBox.Show(Collective, "Preliminary Proof of Concept")
Dim Collective2 As String
Collective2 = My.Computer.FileSystem.ReadAllText(ThisDoc.PathAndFileName(False) & ".txt")
''Import
Dimz = Collective2.Split(";").Count - 1
Dimy = Collective2.Split(";")(0).Split(",").Count - 1
Dimx = Collective2.Split(";")(0).Split(",")(0).Split(":").Count - 1
Dim Matrix2(Dimx+1,Dimy+1,Dimz+1) As String
For z = 0 To Dimz
For y = 0 To Dimy
For x = 0 To Dimx
Matrix2(x, y, z) = Collective2.Split(";")(z).Split(",")(y).Split(":")(x)
Next
Next
Next
MessageBox.Show(Matrix2.Rank & "=Rank & " & Matrix2.Length & "=Length", "Dimensions")
''Testing
cycle = 0
While cycle <1
user_x = InputBox("Insert x-value", "Value Inquiry", "0")
user_y = InputBox("Insert y-value", "Value Inquiry", "0")
user_z = InputBox("Insert z-value", "Value Inquiry", "0")
MessageBox.Show(Matrix2(Val(user_x), Val(user_y), Val(user_z)).ToString, "Value Inquiry Results")
Dim bool1 As Boolean
bool1 = InputRadioBox("Retry?", "Yes", "No", True, Title := "Program Cycle")
If bool1 = True
cycle = 0
Else
cycle = 1
End If
End While