Re: Error in message_box()

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi Joshua,
if you look inside the MSGBOX.E file you will notice that msgbox_id variable
only gets initialised if you are running on a Windows platform. So the
problem is either you're fault for not following the manual, or (which is
really my position) RDS's fault for assuming the msgbox_id will always have
a valid value in it when message_box() is called.

BTW, here is another really good example of why allowing assignments at
declaration time makes life easier for programmers.

An extract from the current file....

 --------------
 integer msgbox_id, get_active_id

 if platform() = WIN32 then
    lib = open_dll("user32.dll")
    msgbox_id = define_c_func(lib, "MessageBoxA", {C_POINTER, C_POINTER,
         C_POINTER, C_INT}, C_INT)
    if msgbox_id = -1 then
       puts(2, "couldn't find MessageBoxA\n")
       abort(1)
    end if
 . . .


It would have been nice to have this ...

 integer msgbox_id = -1, ...

and then a test in the actual message_box() routine like ...

 if msgbox_id < 0 then
   ....

And if we can't get initializations done at declaration time then how about
...

 if not initialized(msgbox_id) then
   ....

---------
Derek
----- Original Message -----
From: "joshua goldberg" <futures8 at bellsouth.net>
To: "EUforum" <EUforum at topica.com>
Sent: Tuesday, February 19, 2002 4:58 AM
Subject: Error in message_box()


>
> Got an error in using message_box that I can't figure out;
>
>             msgbox.e:89 in function message_box()
>             variable msgbox_id has not been assigned a value.
>
> I installed Euphoria version 2.3 two days ago.  Not sure
> that has anything to do with the error.
>
> If anyone can shed some light on the problem,  I'd appreciate it.
>
> Thanks.
>
> Jim
>
>
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu