PDA

View Full Version : very basic question



scorpion
- 23rd November 2004, 16:40
if i have 2 arrays arrayone[7] and arraytwo[7]
can I copy them all together:

arraytwo = arrayone

or do i have to do each part seperatly?

mister_e
- 23rd November 2004, 17:26
never test it but i really think you must copy item by item in a simple loop.

for a=0 to 6
arraytwo[a]=arrayone[a]
next

regards

scorpion
- 23rd November 2004, 17:36
thanks

scorpion
- 23rd November 2004, 17:44
can i do any manipulation with a whole array?

if arrayone <> 0 then goto dealwithit

?

mister_e
- 23rd November 2004, 17:46
i don't think we can do anything with an whole array. only with separate items... loop again

regards

scorpion
- 23rd November 2004, 22:28
this might be a daily occurance... i think i might need my own forum for my questions.... scorpion's stupid subject of the day.

anyways
is it possible to do floating point math ie. #### / 10.24
or should i shift the #s over divide and then move back?

Dwayne
- 23rd November 2004, 23:25
Hello Scorpion

S>>is it possible to do floating point math ie. #### / 10.24
or should i shift the #s over divide and then move back?<<

yes, you can do Floats.

Dwayne

Ingvar
- 24th November 2004, 10:25
Hi Scorpion,

You can do floats, it's described on Melabs page. However, there's a different way, calculations with fractions. This is done with the "*/" or "**" operators. Tracey Allen has done a good job of describing theese(and a lot more) on his site http://www.emesys.com/BS2math1.htm .

The "*/" operator does an "invisible" division by 256.
The "**" operator does an "invisible" division by 65536.

Lets say you want to calculate Y=X/10.24 ......

X VAR WORD
Y VAR WORD

Y = X */ 25

This would be the same as doing X*25/256 on your calculator. 25/256 is equal to 1/10.24.

/Ingvar