Mac OS 9 Lives
Mac OS 9 Discussion => Development & Programming => Topic started by: OS923 on December 02, 2019, 08:27:50 AM
-
I wrote a contextual menu extension to reindent parameter lists.
Before:
Bool Read(n1 x,
n1 y,
n1 z)
{
if (!Read("\pInput (many)",
m_save,
k))
{
Return_false("\pError (-110)",
k);
}
/* Test(a,
b); */
Test(a,
b);
// Test(a,
// b);
Test(a,
b);
Test(A(x,
y),
B(z,
w));
return True;
}
After:
Bool Read(n1 x,
n1 y,
n1 z)
{
if (!Read("\pInput (many)",
m_save,
k))
{
Return_false("\pError (-110)",
k);
}
/* Test(a,
b); */
Test(a,
b);
// Test(a,
// b);
Test(a,
b);
Test(A(x,
y),
B(z,
w));
return True;
}
At this moment it contains 512 K of zeroes.
I'll try to make a smaller version.
-
See the smaller version in the attachment.
-
Zero downloads? That’s one of my best softwares ever.
-
Sadly, our greatest achievements are often completely useless for end users.
-
What are parameter lists used for? What are the benefits of reindenting them?
Depending on the answers to these 2 questions, it may get a lot more downloads. :)
EDIT: Typo fix.
-
A parameter list is a part of a function prototype or a function call in a programming language. (This forum is about programming, remember?) We like to place the parameters neatly in one column, one parameter per line. This costs effort typing many spaces, so it’s helpful when this is done automatically.
-
I see, a parameter list, as in, the list of arguments to be passed onto a method within code in a text file of your choosing. For general code text identation. I see, my bad for not looking at the "Before" and "After" boxes carefully.
Yeah, that's cool, although I would personally not split my parameters with one per line... But still, that's a nice little CM. Does the ".sitx" also include the source?
-
No, no source.
-
There’s a bug where it doesn’t save the new text because the length is the same. There’s a small chance that this happens. This is already fixed for the next version.