getting a bit stuck here
got some code that allows a user to input numbers to a 3x3 array. but next on the tutorial sheet i have to then ask the user for a number to search for and then search the array for that number and come back with its location in the array
now i have the code that fils the array, but i dont know how to write the function, or what i should be passing to the function. i dont know how to get a location out of the other end either! :( -
-
Private Sub cmdT5d_Click()
-
-
Dim intCol As Integer
-
Dim intRow As Integer
-
Dim intMyArray(3, 3) As Integer
-
Dim intFindNum As Integer
-
Dim intNumSearch As Integer
-
-
-
-
-
-
For intRow = 1 To 3
-
For intCol = 1 To 3
-
-
intMyArray(intRow, intCol) = InputBox("please enter numbers into the array", "Numerical Input Box", 1)
-
-
Next intCol
-
Next intRow
-
-
FindNum = InputBox("please select a number to search for","number search",1)
-
-
-
NumSearch = Lsearch(intMyArray(), intFindNum)
-
-
txtT5e.text = NumSearch
-
-
End Sub
-
for the search function then is this correct? -
Private Function Lsearch(intMyArray() As Integer, intFindNum As Integer) As Integer
-
thats as far as i got :(
3 1418
Your search function declaration looks pretty good to me. The code in there will just need to do a couple of nested loops like the ones that filled the array, and test whether each entry matches the search value.
cheers dude,
erm would i need to pass intCol and intRow through or would it already know about those?
Hi,
Declare the array at the Form-Level..(Top of Form's Code Window)
So that, When you write the Search Code in another Command_Click, the array is still there..
If you declare in command_Click, the array goes out of scope...
Regards
Veena
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Kevin Lyons |
last post by:
Hello,
I am trying to get my select options (courses) passed correctly from
the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html
I am having difficulty getting the...
|
by: jr |
last post by:
Sorry for this very dumb question, but I've clearly got a long way to go!
Can someone please help me pass an array into a function. Here's a starting
point.
void TheMainFunc()
{
// Body of...
|
by: kalinga1234 |
last post by:
there is a problem regarding passing array of characters to another
function(without using structures,pointer etc,).can anybody help me to
solve the problem.
|
by: deko |
last post by:
I need to create a basic one-dimensional array of strings, but I don't know
how many strings I'm going to have until the code is finished looping.
pseudo code:
Dim astrMyArray()
Do While Not...
|
by: John Pass |
last post by:
Hi,
In the attached example, I do understand that the references are not changed
if an array is passed by Val. What I do not understand is the result of line
99 (If one can find this by line...
|
by: Mark Drummond |
last post by:
Hi all. I've been using Perl for many years now, but I am a "use it and
learn it as you need it" type. I having some trouble passing a list to
the "search" subroutine from Net::LDAP.
I am trying...
|
by: assgar |
last post by:
Hi
I am stuck on a problem.
I use 3 scripts(form, function and process).
Development on win2003 server. Final server will be linux
Apache,Mysql and PHP is being used.
The form displays...
|
by: kencana |
last post by:
hi All,
I got problem in passing data (more than one) from soap client to the soap server. but if i only passing one data at a time, it works successfully..
The following is the error message i...
|
by: =?Utf-8?B?YmVyaWNr?= |
last post by:
New to this, I used to pass an array like this
function BytesToString(byref myarray() as byte, somethingelse as long) as long
and
m = BytesToString(fooBar(), bluenose)
This would send...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
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
|
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...
| |