Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: plcnut on June 03, 2013, 01:59:40 PM

Title: REFWRITE feature request
Post by: plcnut on June 03, 2013, 01:59:40 PM
I am learning to implementing REFWRITE in my current project, and have found the "Reference type" to be very clunky.
ie: go to System Configuration, click on Memory Configuration, scroll down list to find desired data type, check number, cancel the System Settings, Type number into box...

What I ended up doing: Take the structure name, and assign a symbolic constant to the same name. That way if you use the structure name without the index, you get the data type number.

The feature request would be: could you make this automatic? (when I create a structure you automatically make a symbolic constant with the same name as the structure).
Title: Re: REFWRITE feature request
Post by: BobO on June 04, 2013, 02:08:18 PM
Mixed emotions. As you are apparently preconditioned to do, you are again plumbing the depths of fringe Do-more features...I mean, REFWRITE, really?? ;) I woulda thought that virtually nobody would ever use that.

That's actually not a bad idea though, although it really shouldn't be named the same for reasons that won't be completely clear now, but will someday. Lemme think about it.
Title: Re: REFWRITE feature request
Post by: plcnut on June 04, 2013, 02:18:40 PM
Bobo,
Offer me deeper levels of indexes for MATH Results and I would never touch REFWRITE again! That is the only thing I need it for. I'm trying to shorten code...
Title: Re: REFWRITE feature request
Post by: BobO on June 04, 2013, 02:50:39 PM
Can't do it...that's why we added REF() and REFWRITE...to specifically support those doing stuff like this. You're doing great...but since it is nearly always you exploring the boundaries of Do-more, it has become good sport here at Host to make light of that fact. ;)
Title: Re: REFWRITE feature request
Post by: plcnut on June 04, 2013, 03:14:09 PM
Oh well... I'm sure looking forward to the next release to see what else you've come up with ;)
One of these days I'll get out there to visit you guys and you'll find out just how much of a nut I am! ;D
Title: Re: REFWRITE feature request
Post by: plcnut on June 04, 2013, 06:01:25 PM
Would it really be all that deep to allow the Result of MATH to be a math expression in itself? That is all that I'm doing when I stack two MATH's on top of each other; the first calculating the result field for the second. (or maybe I should just keep doing what I've been doing...)
Title: Re: REFWRITE feature request
Post by: BobO on June 04, 2013, 06:11:09 PM
That's a little ambiguous. I'm going to need more to really understand what you are needing.

I suspect it comes down to you wanting multiple assignments within a single math box. I'm sure that we could create a math function that would assign a value to a variable and in turn leave the value of that variable on the stack. I would caution you, however, that you are likely trying to do too much at one time.

One of the favorite tricks of C programmers from yesteryear was to cram as much code into side-effects and inline assignments as possible. It's cool. It's efficient. It's also virtually unreadable and unsupportable...especially 5 or 10 or even 20 years later. Ask me how I know... :-\
Title: Re: REFWRITE feature request
Post by: plcnut on June 04, 2013, 09:07:20 PM
I'll take your word for it. I can keep doing what I have been, as well as integrating the REFWRITE wherever it can be used to simplify.
Thanks again! This is a grand little controller ;D