From: | Harold Grovesteen |
Date: | 9 Sep 2000 at 15:42:38 |
Subject: | Re: AMIOPEN: Oh, BTW (nasty line of VP code) |
That's the second nasty hack (the other is that AVE SLEEP 1 replacement)
I've seen here that should not be used, but everyone will. There will
be more! Programers tend to be very pragmatic about using things that
work, and these hacks seem to be useful. So, what should be done? "BAN
THEM ALL TOGETHER!" the autocrats will say. That's kind of like the
American prohibition on alcohol in the early 1900's, they may be
forbidden but they will just go underground. All code is nothing more
than a nasty hack that fits some rules. If enough software uses the
"nasty hacks" they become standard anyway, de facto, rather than de
jure. The force of inertia demands they be supported whether anyone
likes it or not.
I recommend that instead of being ostriches with our heads in the sand,
these hacks be documented and accepted. Perhaps by convention, being
supplied as macros, tools, or separately includable software that can
readily isolate the hack and allow it to be changed over time as
needed. Perhaps software labling can identify software with such
"internal dependencies." My guess is that most software will have such
dependencies, particlarly as these hacks multiply. To ignore the
phenomenon creates problems. To accept the reality of the phenomenom
allows it to be realistically managed. Todays hack is tommorrows de
facto standard and the de jure standard the day after.
Harold Grovesteen
Jesse McClusky wrote:
>
> I discovered this a while ago, but only just now thought to share it.
> It's a single line of VP code that gives you a pointer to the current
> tool's full path name. It's totally undocumented internal stuff, so
> DO NOT USE THIS. There. That said, here it is: (:
>
> cpy [__thistool - 4] + $15, p0
>
> The result is a pointer in p0 that you could use like this:
>
> printf "This tool's name and full path is '%s'\n", p0
>
> Make sure you use two underscores (_) before "thistool".
> Remember: Don't use this in your code because IT MAY
> BREAK AT ANY TIME.
>
> 'nough said. (:
>
> Jesse
>
> Subscribe/Unsubscribe: open-request@amiga.com
> Amiga FAQ: http://www.amiga.com/faq.html
Subscribe/Unsubscribe: open-request@amiga.com
Amiga FAQ: http://www.amiga.com/faq.html