Page 1 of 1

Feature Request: String concatenation or globbing capability

Posted: Sun Jan 19, 2003 3:06 am
by GoatFoot
$p0 = "a gibbering coder implodes for 7,261,988 points of damage"

I wish to extract the mob's name - "a gibbering coder".

$left(17,"$p0") returns a gibbering coder

/varset l0 $left(17,"$p0") sets l0 to "a" because of the embedded white spaces.

This works.

Code: Select all

sub event_pyschotic
	/varset l0 2
	:loop_find_critter_name
		/varadd l0 1
	/if $arg($l0,"$p0")!=for /goto :loop_find_critter_name
	/varsub l0 1
	/for l1 1 to $l0
		/varset a(1,$l1) $arg($l1,"$p0")
	/next l1
	/varset l2 "$a(1,1) $a(1,2) $a(1,3) $a(1,4) $a(1,5)"
	/echo $l2
	/for l2 1 to 5
		/varset a(1,$l2) ""
	/next l2
/return
The above is ugly.

For the record, this appears to consistently blow up

Code: Select all

/for l1 1 to l0
    /varset l2 "$l2 $a(1,$l1)"
/next l1
Blows up on local and global vars. MQ does not like to assign a var to itself. :)

Posted: Sun Jan 19, 2003 4:44 am
by Valerian
GoatFoot wrote:/varset l0 $left(17,"$p0") sets l0 to "a" because of the embedded white spaces.
too tired to decipher your other code snippets... wouldn't:

/varset l0 "$left(17,"$p0")"

work, or does it get muddled on the nested quotations?

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:41 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:43 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:44 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:46 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:47 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:48 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:49 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:50 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:52 pm
by xyilla

Re: Feature Request: String concatenation or globbing capability

Posted: Wed Jan 14, 2026 2:54 pm
by xyilla