?
Solved

Save a small integer array as part of a udt

Posted on 2014-01-18
5
Medium Priority
?
158 Views
Last Modified: 2014-01-19
How to include this array into the udt below
mMarkedNumber(1 To 10)  As Integer
can this be done if yes how ?

Public Type SavedKenoGameGame
tmpbetMode As Integer
tmpSpotMarked As String * 2
tmpLabelCredit As Currency
tmpRuns As Long
tmpLost As Currency
tmpWon As Currency
tmpWonLostPerRun As Currency
tmpBiggestWin As Currency
tmpTotalBet As Currency

End Type

can this be done if yes how ?
0
Comment
Question by:isnoend2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 2000 total points
ID: 39791805
What is the problem?
'===Module===
Public Type SavedKenoGameGame
tmpbetMode As Integer
tmpSpotMarked As String * 2
tmpLabelCredit As Currency
tmpRuns As Long
tmpLost As Currency
tmpWon As Currency
tmpWonLostPerRun As Currency
tmpBiggestWin As Currency
tmpTotalBet As Currency
mMarkedNumber(1 To 10) As Integer
End Type

Open in new window


'===Form===
Dim z As SavedKenoGameGame

Private Sub Form_Load()
   For i = 1 To 10
      z.mMarkedNumber(i) = i * 100
   Next i
End Sub

Private Sub Command1_Click()
   MsgBox z.mMarkedNumber(3)
End Sub

Open in new window

0
 

Author Closing Comment

by:isnoend2001
ID: 39791833
Thanks
no problem now
0
 

Author Comment

by:isnoend2001
ID: 39791844
how do i save the array ?
this does not work:
Dim CleoGame As SavedKenoGame
   With CleoGame
    .tmpbetMode = mBetMode
    .tmpSpotMarked = Val(lblMarked)
    .tmpLabelCredit = lblCredit.Caption
    .tmpRuns = Val(gridCardStats.TextMatrix(2, 1))
    .tmpLost = CCur(gridCardStats.TextMatrix(5, 1))
    .tmpWon = CCur(gridCardStats.TextMatrix(4, 1))
    .tmpWonLostPerRun = CCur(gridCardStats.TextMatrix(7, 1))
    .tmpBiggestWin = CCur(gridCardStats.TextMatrix(3, 1))
    .tmpTotalBet = CCur(lblBet)
    .tmpWonLost = CCur(gridCardStats.TextMatrix(6, 1))
    .mMarkedNumber = mMarkedNumber
End With
0
 
LVL 28

Expert Comment

by:Ark
ID: 39791846
.tmpWonLost = CCur(gridCardStats.TextMatrix(6, 1))
For i=1 To 10
 .mMarkedNumber(i) = mMarkedNumber(i)
Next i
0
 

Author Comment

by:isnoend2001
ID: 39792057
thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question