Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Temp dumps like in Newton

Author
Message
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 9th Jun 2006 21:56 Edited at: 9th Jun 2006 21:57
Well, I decided to give out another piece of code,and I know most of my code is pointless. But this is a way of returning multiple variables from a function and dumping them into a temporary space in an array. Basicly, you setup a dump area with SetupTmp(id of space). That sets the 9 values of the space to 0 and it sets up the array so you can actually use these. Then you can fill them up by using this this:

tmp(id).val[1-9] = [float]value

here is the code:



Yeah,thats about it. Sorta boring but somewhat helpful if you want to return multiple values in a specified dump for a function.

all ben needs is his band,his guitar,and his computer
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 10th Jun 2006 22:00
You could make the array two dimentional, so you dont have to have the val1, val2 stuff, just tmp(id,val)=blah

Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 10th Jun 2006 22:23
Yes, that is a good idea. I've never really used two dimensional arrays before, but I'll definately start practicing with them. So,then you could return an infinite number of values! Wonderful, I'll post updated stuff that can use integer and string values.

all ben needs is his band,his guitar,and his computer

Login to post a reply

Server time is: 2024-11-23 04:00:12
Your offset time is: 2024-11-23 04:00:12