Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Give an example using file_select_ex()

This thread is locked; no one can reply to it. rss feed Print
Give an example using file_select_ex()
raja peter
Member #7,835
October 2006

hi,

I tried using file_select_ex() fn. But did not work. Can anyone give me an example using this fn.

Should i use Dialog for this?

Thank You

luv,

raja

Evert
Member #794
November 2000
avatar

In what way didn't it work? Can you show some code that shows what you did?

raja peter
Member #7,835
October 2006

file_select_ex("Select Image","c:","GIF;JPG",480,100,50);

luv,

raja

miran
Member #2,407
June 2002

the manual said:

The user selection is returned by altering the path buffer, whose maximum capacity in bytes is specified by the size parameter. Note that it should have room for at least 80 characters (not bytes), so you should reserve 6x that amount, just to be sure.

You figure it out from here.

--
sig used to be here

TeamTerradactyl
Member #7,733
September 2006
avatar

raja: miran is correct with the snippit from the manual.

Does doing it like this change anything?

  char path[255];

  file_select_ex("Select Image",path,"GIF;JPG",480,100,50);

...the difference being 'path' is not hard-coded into your file_select_ex call as "c:", but rather as 'path' defined as an array of 'char'?

-TT

Vasco Freitas
Member #6,904
February 2006
avatar

TeamTerradactyl's idea is correct, but you should make "path" an array of 480.

Go to: