Bonjour, j'ai une variable contenant un string option mais j'aimerai le convertir en string ...
Une idée svp?
let str_op mot = match mot with
| Some x -> x
| _ -> raise Not_found
let afficher_export () =
let dlg = GWindow.file_chooser_dialog
~title:"Exporter le projet"
~action:`SAVE
~parent:ui#window1
~destroy_with_parent:true () in
dlg#add_button_stock `CANCEL `CANCEL;
dlg#add_select_button_stock `SAVE `SAVE;
let res = if dlg#run () = `SAVE then dlg#filename else None in
dlg#destroy ();
let t1 = if (ui#vbox2#misc#visible) then 1 else 0 in
let t2 = if (ui#vbox3#misc#visible) then 1 else 0 in
let t3 = if (ui#vbox4#misc#visible) then 1 else 0 in
let t4 = if (ui#vbox5#misc#visible) then 1 else 0 in
let track_tab = [|t1;t2;t3;t4|] in
Camlc.export_c (str_op res) track_tab
Partager