Reply to Re: Strings in Dink
If you don't have an account, just leave the password field blank.
This really looks like you've only read my short answer <_<
And, sure, it's possible. The input is not too difficult, but still not what I'd consider "everyday DinkC scripting". Output in the middle of a string is nearly impossible for the reasons you mentioned. There's no straightforward way to determine the length of the string.
Well, there is:
int &string = 76763;
int &length = 0;
int &crap = &string;
loop:
if (&crap > 0)
{
&length++;
&crap = &crap / 26;
goto loop;
}
say("&length",1);
With the example string, this would result in
76763 > 0 -->
&length = 1; &crap = 2952;
2952 > 0 -->
&length = 2; &crap = 113;
113 > 0 -->
&length = 3; &crap = 4;
4 > 0 -->
&length = 4; &crap = 0;
0 <= 0 -->
say("4",1);
And, sure, it's possible. The input is not too difficult, but still not what I'd consider "everyday DinkC scripting". Output in the middle of a string is nearly impossible for the reasons you mentioned. There's no straightforward way to determine the length of the string.
Well, there is:
int &string = 76763;
int &length = 0;
int &crap = &string;
loop:
if (&crap > 0)
{
&length++;
&crap = &crap / 26;
goto loop;
}
say("&length",1);
With the example string, this would result in
76763 > 0 -->
&length = 1; &crap = 2952;
2952 > 0 -->
&length = 2; &crap = 113;
113 > 0 -->
&length = 3; &crap = 4;
4 > 0 -->
&length = 4; &crap = 0;
0 <= 0 -->
say("4",1);







