VERY strange problem? HELP!

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

I have been working on a program when somthing very strange happened.
The server generates a number using "n=time()*100+rand(99)",
then starting a client program using 'n' as a parameter.
After getting strange results, I modified both to display n.
I ran it a few times and got:

# from server 488 567 (501) 467 
# from client 488 567 (500) 467

As you can see, at on point the server displayed '501'
and the client displayed '500'.
I tried to create the problem in another program, but got another
strange error:

[ex.err]
...\New Windows App.exw:11 in procedure w_onOpen() 
type_check failure, n is 486 
    self = 3
    event = 4
    params = {}
    o = 6

...

...\New Windows App.exw:
    f = 42'*'
    n = 486
[end]

In types.e:
constant True = (1=1)

global type int( integer i )
    return True
end type
so 'n' is an integer, and 486 is a perfectly leagal value for an integer.
Also, int() always returns True, so an invalid value woulgd cause
an error on 'i'. And the program also displayed a few other numbers just fine.

The example programs are below, put them in thsame place and
run New Windows App.exw
Can somine explain what is happenning here?!?!?!?!

[New Windows App.exw]
include win32lib.ew
without warning


int f,n
constant w=createEx( Window, "", 0, Default, Default, 600, 400, 0, 0 )


procedure w_onOpen (integer self, integer event, sequence params)--params is ()
for o=1 to 10 do
	n=time()*100+rand(99)
	?n
	f=shellExecuteEx(0,
		"exw.exe",
		sprintf("%s %d",{"p2",n}),
		"",--reverse(ms1),
		SW_SHOWNORMAL,
		0)
end for
end procedure
setHandler( w, w32HClick, routine_id("w_onOpen"))
WinMain(w,Normal)
[end]

[p2.exw]
include win32lib.ew

seq a
a=command_line()
puts(1,a[3])
a[1]=wait_key()
[end]

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

Search



Quick Links

User menu

Not signed in.

Misc Menu