Posts: 720
Threads: 46
Joined: Oct 2001
Quote:Having the subroutine be able to determine the array's properties makes the subroutine more self-contained and possibly more adaptive to being used generically.
True, for something like a general sort or whatever...
Posts: 3,368
Threads: 195
Joined: Jan 2003
pass the reference not the number.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 704
Threads: 0
Joined: Dec 2002
And what does *that* have to do with anything?
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 3,343
Threads: 83
Joined: Mar 2003
What happens if your array is dimmed dynamically or randomly? (Don't ask me when this would happen)
Posts: 3,343
Threads: 83
Joined: Mar 2003
What happens if your array is dimmed dynamically or randomly? What about momoguru? Why do you need to know the number of indexes? (Give me help!)
Posts: 1,166
Threads: 62
Joined: Apr 2003
For the number of indices (yes, that's the REAL plural word for it) you can just make it more dynamic. Say you have a screen buffer, but you make the lib so it can be different lengths. Then you have a buffer filling routine that loops through the array and puts the color numbers. You use UBOUND to get to the end of the array without recoding each buffer size.
Oh and, it is possible to get PUT color values. From Nexus13:
' Determine color value
' ---------------------
IF colour < 128 THEN
c = colour * 257 'Calc fill value if attribute < 128
ELSE
c = colour * 257 - 65536 'Calc fill value if attribute > 127
END IF
' Fill page using color
' ---------------------
max = UBOUND(array, 1) 'Determine maximum words to set
FOR i = 6 TO max 'Set all words starting at element 6
array(i) = c 'Store calculated fill value
NEXT
am an asshole. Get used to it.
Posts: 3,368
Threads: 195
Joined: Jan 2003
You wouldn't understand...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 704
Threads: 0
Joined: Dec 2002
As far as I know, LBOUND and UBOUND still work with them.
Quote:What happens if your array is dimmed dynamically or randomly? What about momoguru? Why do you need to know the number of indexes? (Give me help!)
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Posts: 3,368
Threads: 195
Joined: Jan 2003
you can still keep track with random/dynamic arrays.
I'd only use those things if it would otherwise be real complicated to track down teh length.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,343
Threads: 83
Joined: Mar 2003
Glad to see it could possibly be some use to someone. I'll call it "Oracle's Function"