Solved

Save a small integer array as part of a udt

Posted on 2014-01-18
5
152 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
  • 3
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
Ark earned 500 total points
Comment Utility
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
Comment Utility
Thanks
no problem now
0
 

Author Comment

by:isnoend2001
Comment Utility
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 27

Expert Comment

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

Author Comment

by:isnoend2001
Comment Utility
thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now