variables enclosed in " "

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

variables enclosed in " "

Post by dok » Thu Apr 29, 2004 4:46 pm

I'm not sure if this is a bug or working as it should, but...

Code: Select all

/declare test string local
/varset test "/echo test"
/echo ${test}
/docommand ${test}
returns:

Code: Select all

[MQ2] "/echo test"
DoCommand - Couldn't parse '"/echo test"'
when passing a var with " " to a Sub, the problem doesn't seem to duplicate, but does bring up another possible problem as shown below:

Code: Select all

Sub Main 
    /declare test string local
    /varset test "/echo test"

    /call Test "/echo test" ${test} "${test}"
/return 

Sub Test(string var1,string var2,string var3)
    /echo var1 - ${var1}
    | var1 - /echo test

    /echo var2 - ${var2}
    | var2 - /echo test

    /echo var3 - ${var3}
    | var3 - /echo
/return
notice that var3, even though its being passed in quotes, has quotes in the actual variable name, therefore cancelling eachother out I believe.

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Thu Apr 29, 2004 4:52 pm

heres another interesting thing I've observed:

Code: Select all

/declare test1 string local /echo test
/declare test2 string local "/echo test"
/echo ${test1}
| /echo test
/echo "${test1}"
| "/echo test"
/echo ${test2}
| "/echo test"
/echo "${test2}"
| ""/echo test""
I realize quotes aren't needed with many things with the new system, and I can accept that, but just checking if this activity is what its supposed to be.
Last edited by dok on Thu Apr 29, 2004 4:54 pm, edited 1 time in total.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Apr 29, 2004 4:53 pm

/varset and /declare dont require quotes anymore because spaces arent going to hurt anything

/call requires quotes to split parameters that may have spaces

Working as intended :)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Thu Apr 29, 2004 4:57 pm

how about with things like String.Find[], String.Equal[], etc. would the propper way to do it have quotes?

/declare test string local test
/if (${test.Find["t"]}) /do...

or would the right way:
/if (${test.Find[t]}) /do...

or does it not matter for these?

Micro
a lesser mummy
a lesser mummy
Posts: 40
Joined: Fri Mar 12, 2004 5:56 pm

Post by Micro » Thu Apr 29, 2004 5:01 pm

certain IDE's such as whiper studio ignore quoted text for you, so that quoted text is not interepreted to be one of the reserved words.

for example:

With quotes in IDE
/varset test "/echo testing"

Without quotes
/varset test /echo testing

I can of course live without it, but it would be nice to be able to quote strings.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Apr 29, 2004 5:07 pm

how about with things like String.Find[], String.Equal[], etc. would the propper way to do it have quotes?
Inside indexing, you can use quotes or you can leave them out. There are times when you need quotes, like if you are accessing an ini section that has a comma in it. The quotes inside [] will be stripped.

Again, quotes inside MQ2Data indexes can use quotes if you wish. /varset and /declare do not strip quotes.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Apr 29, 2004 7:03 pm

It works great as is, learn to love it! :D