Using ListRequest

A forum dedicated to George scripting questions
Post Reply
User avatar
Broughtvulture
Posts: 31
Joined: 09 Jul 2015, 00:58

Using ListRequest

Post by Broughtvulture »

Here is the code I'm using, If you'd like to try it out yourself:
//----------------------------
PARAM none

ShowList()
//tv_ReqList list
//Displays a list in which the user can choose an option.
//There are two buttons, CANCEL(return -1) & OK (Returns non-negative value)
//Use "|" to create another option in list
//Use "/" to create a sub-option in list
FUNCTION ShowList()
LOCAL Menu
Menu = "Opt 1/Sub1Opt 1/Sub2Opt 1|Opt 1/Sub1Opt 2|Opt 2/Sub1Opt 1|Opt 2/Sub2Opt 1 "
tv_ListRequest Menu
parse result MenuSelection

IF (MenuSelection == "0 Opt 1/Sub1Opt 1/Sub2Opt1")
tv_warn "Does it work?"
END

tv_warn "You have chosen "MenuSelection
END

//----------------------------

How do I use ListRequest's value? String value doesn't seem to work and it always gives me an error, I'm not sure what I'm doing wrong.
I hope the code above helps prove my point.

Here is the Documentation I originally used:
http://wiki.tvpaint.com/index.php?title=Tv_ListRequest" onclick="window.open(this.href);return false;

TVPaint Animation 11 Pro (11.0.3-64 bits)
Windows 7 64-bit
FX 8350 8 Core - 16 GB RAM
TVPaint Professional 11.0.8 64-bit

BNV
User avatar
Broughtvulture
Posts: 31
Joined: 09 Jul 2015, 00:58

Re: Using ListRequest

Post by Broughtvulture »

Never mind, I just realized you have to PARSE RESULT more than one variable. Learned something new today. =)
Windows 7 64-bit
FX 8350 8 Core - 16 GB RAM
TVPaint Professional 11.0.8 64-bit

BNV
Post Reply