building a menu ?

Discuss and share scripts and script files...
Post Reply
yusef88
Posts: 1126
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

building a menu ?

Post by yusef88 »

hi , my problem is the menu will only return the first extension
if I choose video menu. the echo will return mp4
any suggestion to fix this please?

Code: Select all

  $menu = <<<MENU
   Video;*.mp4;*.avi
   Audio;*.mp3;*.wav
   MENU;
  $s = popupmenu("$menu");if !($s) { end 1==1; };
  echo $s

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: building a menu ?

Post by PeterH »

In the expression Video;*.mp4;*.avi ";" is the separator "sep_item", so:
Video = caption
*.mp4 = data
*.avi = icon

You didn't mean it this way, I think.
Win11 Pro 223H2 Gerrman

yusef88
Posts: 1126
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: building a menu ?

Post by yusef88 »

PeterH wrote:In the expression Video;*.mp4;*.avi ";" is the separator "sep_item", so:
Video = caption
*.mp4 = data
*.avi = icon

You didn't mean it this way, I think.
you are right. I guess quoting "*.mp4;*.avi" will make it work
thanks

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: building a menu ?

Post by highend »

Then you get a quoted string...

The better way (as Peter already indicated) is:

Code: Select all

  $menu = <<<MENU
   Video|*.mp4;*.avi
   Audio|*.mp3;*.wav
   MENU;
  $s = popupmenu($menu, 7:="|");
  if !($s) { end true; };
  echo $s;
or you use a different separator for the extensions in the first place...
One of my scripts helped you out? Please donate via Paypal

yusef88
Posts: 1126
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: building a menu ?

Post by yusef88 »

dear highend
Do you know how wonderful you are? :biggrin: Thank you :tup:

Post Reply