Mid function

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

GeoffreyF67
a lesser mummy
a lesser mummy
Posts: 70
Joined: Tue Nov 04, 2003 6:07 pm

Mid function

Post by GeoffreyF67 » Thu Apr 22, 2004 2:16 pm

Ok. I am obviously missing something but I have no idea what it is...I read the help and am not clear how to use the mid function. Here's my test code:

Code: Select all

sub main
  /declare p1 global
  /declare p0 global

  /varset p0 "test"

  /echo @p0

  /varset p1 ${string[p0].Mid[1,2]}

  /echo @p1
/return

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 22, 2004 2:37 pm

Your problem is that you're not using the String TLO correctly.

You can just do this for your test:

/echo ${String[test].Mid[1,2]}
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0