Solved

Save a small integer array as part of a udt

Posted on 2014-01-18
5
154 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 28

Accepted Solution

by:
Ark earned 500 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

840 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