Page 1 of 1 1
Topic Options
#118901 - 2004-05-02 04:10 AM array syncronization
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
I have 2 types of data that needs to be syncronized in access. The pieces of data are Name and Prefix. They are used in building different paths in a single loop.
I first tried to do this with an array useing a formula to differentiate the types of data. But I could not find a way to reference 2 index numbers from the array or get a array member count.
I tried next to use 2 different arrays. When doing this if I use a For each statement will not allow me to reference index 'x' in both my first and second array in the same for loop.
At this point I am stumped on where to go useing kixtart. suggestions?

Top
#118902 - 2004-05-02 04:58 AM Re: array syncronization
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I would be happy to help, but I do not understand what you are attempting to acomplish. Can you give an example or psuedo code?

Have you seen: Hash() Library UDF's Will this help?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#118903 - 2004-05-02 05:38 AM Re: array syncronization
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
You might want to try using Ubound().

Code:

for $j = 0 to Ubound($array1)
? $array1[$j]
? $array2[$j]
next



_________________________
Eric

Top
#118904 - 2004-05-02 05:41 AM Re: array syncronization
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
This is a semi simplified version of what I am doing, but it should represent the problem I am having. I am actually juggling about 20 variable in the 'production' version. They are not arrays though(just simple variables).

Code:

$Name = "name1, name2, name3,name4"
$Prefix = "pre1, pre2, pre3, pre4"
$arrName = split($Name,",")
For Each $Element in $Name
Path = $arrPrefixElement $arrNameElement
If Not Esist (Path)
create Path
Next


Top
#118905 - 2004-05-02 05:49 AM Re: array syncronization
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
something like this?
Code:

$Names = "name1", "name2", "name3"
$preFixes = "pre1", "pre2" , "pre3"
for $j = 0 to ubound($Names)
if not exist($preFixes[$j] + $Names[$j])
create path
endif
next



Edited by maciep (2004-05-02 06:15 AM)
_________________________
Eric

Top
#118906 - 2004-05-02 06:12 AM Re: array syncronization
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
sounds right.... ubound was my missing element.. now to try to implement this and see what it does
Top
#118907 - 2004-05-02 06:49 AM Re: array syncronization
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
Yip, looks like this is what I wanted.... now just to make sure I have all elements in the right place at the right time.

Thanks for all the help

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 879 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.056 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org