Dll Compatiblity Error And Functions In Fenix


Geuben

Member
Joined
Sep 5, 2006
Messages
180
am i right in thinking functions don't work in fenix?

CODE

FUNCTION title();
PRIVATE;
x = 0;
BEGIN
WHILE (x < 10)
x +=1
FRAME;
END
RETURN 1;
END


so that when its run, the program waits for this function to return its value before continuing. (n.b. the function above, is the not what im trying to do, just an example).

i found a .dll that will freeze all other processes, so effectively make a process into a function, but when i try:

IMPORT "Plus84.dll";

i get a "the library is not compatible" error, i get this when i try and import any dll file.

What im trying to do is call a menu process, that will show a menu and allow selection of an option, that bit all works, but i want the menu process to return the selected value (1-6) depending on the option chosen. When the menu process is running i want to freeze the other processes (on screen cursor) so using the keys to move in the menu, doesn't move the cursor.

at the moment, i have

the cursor process

CODE
PROCESS cursor()
PRIVATE;
i;
j;
unit_selected = false;
move_return;
BEGIN
graph = 201;
LOOP
x = grid[grid_x][grid_y].coord_x;
y = grid[grid_x][grid_y].coord_y;

//-----------------cursor movment control----------------------
//-------------------------------------------------------------
IF ((grid_y<12) AND ((key(_down)) OR (key(_s)))) grid_y+=1;
//IF (unit_selected == true) pathfind(grid_x,grid_y); END
WHILE (key(_down) OR key(_s)) FRAME; END
END
IF ((grid_y>1) AND ((key(_up)) OR (key(_w)))) grid_y-=1;
//IF (unit_selected == true) pathfind(grid_x,grid_y); END
WHILE (key(_up) OR key(_w)) FRAME; END
END
IF ((grid_x>1) AND ((key(_left)) OR (key(_a)))) grid_x-=1;
//IF (unit_selected == true) pathfind(grid_x,grid_y); END
WHILE (key(_left) OR (key(_a))) FRAME; END
END
IF ((grid_x<16) AND ((key(_right)) OR (key(_d)))) grid_x+=1;
//IF (unit_selected == true) pathfind(grid_x,grid_y); END
WHILE (key(_right) OR (key(_d))) FRAME; END
END

//-----------------button presses-control----------------------
//-------------------------------------------------------------

//------------------------selection button---------------------
IF (key(_control))
WHILE (key(_control))FRAME; END
//-1.check if the square the cursor is on has a unit on it-----
IF(check_square_clear(grid_x,grid_y) == 0)
//-------yes.--check if unit is currently selected-------------
i = get_unit_id(grid_x,grid_y);
IF(units[get_unit_id(grid_x,grid_y)].selected == true)
//------check if unit is friendly-----------------
IF(units.team == player)
//-------------------------check if unit can move -------------
IF(units.turn_over == false)
//-------------------yes.---show action menu (FIRE,SUPPLY,WAIT)
// action_menu(i);
ELSE
//-------------------no.----show turn menu (SAVE, OPTIONS, END, QUIT)
// turn_menu();
END
//-----------no.----select unit -------------------------------
ELSE
select_unit(i);
END
//-------no.--select unit-(show move area)---------------------
ELSE
FOR(j=0;j<max_units;j+=1)
deselect_unit(j); //deselect all units
END
select_unit(i);
END
ELSE
IF (turn_menu() == 4) end_turn(player); END
FRAME;
//---do nothing---
END

END


the bit im interested in

CODE
IF (turn_menu() == 4) end_turn(player); END


this calls the turn menu process

CODE
FUNCTION turn_menu()
BEGIN
menu_file = load_fpg("menus.fpg");
signal(father,s_freeze);
file = menu_file;
graph = 7;
y = 15;
x = 295;
menu_cursor(2,0,0,0,0,0,0);

LOOP
IF (key(_alt))
signal(son,s_kill);
signal(father,s_wakeup);
RETURN 0;
END
IF (menu_choice == 5)
EXIT("BYE",0);
END
IF (menu_choice <> 0 AND menu_choice <> 5)
signal(son,s_kill);
signal(father,s_wakeup);
RETURN (menu_choice);
END
FRAME;
END
END



currently, when the turn_menu is called, the menu shows and allows u to move through the options, but if i select the option so menu_choice = 4, the menu goes away but the end_turn process isnt called, if i press control again then the end_turn process is called.

any ideas?
 
Nevermind guys, solved it now.

I made another process to collect the menu_choice, it didnt have a frame statement in it, so is executed instantly.

Thanks anyway.
 
Back
Top