Group:  Microsoft Access ยป microsoft.public.access.modulesdaovba
Thread: series 1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1

Geek News

series 1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1
HARSHAWARDHAN. S .SHASTRI 12/28/2008 1:01:01 PM

I am looking for code which can generate following series.

1
2
3
4
5
4
3
2
1
2
3
4
5
4
3
2
1
Pl help.

H S Shastri
Re: series 1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1
"Linq Adams via AccessMonster.com" <u28780[ at ]uwe> 12/28/2008 4:42:55 PM
What's the end purpose here?

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200812/1

Re: series 1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1
Marshall Barton <marshbarton[ at ]wowway.com> 12/29/2008 9:35:12 PM
HARSHAWARDHAN. S .SHASTRI wrote:

[Quoted Text]
>
> I am looking for code which can generate following series.
>
>1
>2
>3
>4
>5
>4
>3
>2
>1
>2
>3
>4
>5
>4
>3
>2
>1


Strange!?

Debug.Print 1
For k = 0 To 99
Debug.Print 2 + (k Mod 8) _
- (2 * ((k Mod 8) \ 4) * (((2 * k) Mod 8) \ 2 + 1))
Next k

--
Marsh
MVP [MS Access]
Re: series 1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1
"Linq Adams via AccessMonster.com" <u28780[ at ]uwe> 12/29/2008 10:43:37 PM
Strange!? indeed!

I can't imagine a real-world application, hence my question!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

Re: series 1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1
Marshall Barton <marshbarton[ at ]wowway.com> 12/30/2008 12:49:14 AM
Linq Adams via AccessMonster.com wrote:

[Quoted Text]
>Strange!? indeed!
>
>I can't imagine a real-world application, hence my question!


Maybe it's an translated, integer version of a sine wave
;-)

--
Marsh
MVP [MS Access]
Re: series 1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1
Adrian C <email[ at ]here.invalid> 12/30/2008 11:28:52 AM
HARSHAWARDHAN. S .SHASTRI wrote:
[Quoted Text]
> I am looking for code which can generate following series.

vstep = 1
vout = 1
For k = 1 To 99
For j = 1 To 4
Debug.Print vout
vout = vout + vstep
Next
vstep = vstep * -1
Next

or ....

Dim a As Variant
a = Array(1, 2, 3, 4, 5, 4, 3, 2)
For k = 1 To 99
For i = 0 To 7
Debug.Print a(i)
Next
Next


--
Adrian C

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net