HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Map does compile but doesn't run

12-07-2009, 08:48 AM#1
Anachron
Hey. I have made a window system, however, it does compile, but when you test it, it goes back to wc3 main screen. I have tried a lot, I hope you have more luck with it.

CW.v.1.01.w3x

Thanks in advance.
Attached Files
File type: w3xCW.v.1.01.w3x (24.6 KB)
12-07-2009, 11:55 AM#2
fX_
only problem is in library TrackAble:
"//! runtextmacro getVar("getHandle", "Handle", "texttag")"
should be:
"//! runtextmacro getVar("getHandle", "Handle", "trackable")"
12-07-2009, 11:57 AM#3
Anachron
So it works when you change it? Can't test right now.
12-07-2009, 12:42 PM#4
Rising_Dusk
It would be a return bug otherwise, so I would presume that is the problem.
12-07-2009, 12:47 PM#5
Anachron
How comes it compiles? I mean textmacros will replace the call with the actual text, so why won't that text be syntax-checked?
12-07-2009, 01:27 PM#6
DioD
you attempt to return trackable as texttag with handle array...

because both trackable and texttag are handles this compile well.
12-07-2009, 01:37 PM#7
Anachron
I thought we have returntypsafety?
W/e, thanks a lot.
12-07-2009, 01:44 PM#8
Rising_Dusk
Quote:
Originally Posted by Anachron
How comes it compiles?
The same reason the following still compiles.
Collapse JASS:
function H2I takes handle h returns integer
    return h
    return i
endfunction
Blizzard still lets that compile, they just don't let the map run if it's there. Your illegal typecast of a texttag to a trackable is similar.
Quote:
Originally Posted by Anachron
I thought we have returntypsafety?
Don't give Blizzard too much credit.
12-07-2009, 01:54 PM#9
Anachron
Well, I guess I automaticly thought that we have typesafety, but that's only in bigger programming languages, such as PHP and so on.

Except for the H2I-Bug, is there any reasonable situation why it could be useful?
12-10-2009, 01:03 AM#10
weaaddar
typecasting was pretty useful when you needed to get a destructable back from that event that returned widget, but now you can use gettriggerdestructable...

The only reason to typecast is to use an old map without a super duper amount of effort to fix it.
12-10-2009, 07:43 AM#11
Anachron
I see. But since the old map does have crappy scripts then, its a waste of time, isn't it?
12-10-2009, 08:44 AM#12
DioD
remake\rewrite code will take more time then just fixing it.