Path: utzoo!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!bronze!silver!oecheruo From: oecheruo@silver.ucs.indiana.edu (Chima Echeruo) Newsgroups: comp.lang.pascal Subject: TP type cast/conversion woes. Summary: How do you type cast variables like 'C' Keywords: type conversion Message-ID: Date: 12 Mar 91 17:09:49 GMT Sender: news@bronze.ucs.indiana.edu (USENET News System) Organization: Indiana University Lines: 70 I am working on a small windowing system for use in some educational applications. To handle the mouse I am using a freeware mouse TPU. My problem is that all the mouse routines take words while most of my own routine uses integers. For simple things like comparing an integer variable (say a window co-ord) with a word (say the mouse x-co-ord) the TP compiler produces incorrect code. I have looked throughout the manuals and online help and I cannot find a convertion function or even a built in type conversion. Why can't I compare a word and an integer to see which is greater or smaller. If they have to be converted to some common type, why won't TP do the conversion at compile time - like any decent computer language. Then, If I have to convert a word value to an integer how do I do that? there is an Int function but it works only on real numbers. =========================================================================== PS. On a different problem. As I said earlier I am working on a graphics windowing unit. Well I have almost NIL experience in graphics programming and would like some tips about how windows are implemented. I am most concerned about the sort of data structures that one would use to allow random access to any window. Right now, I use a simple fixed array but I cannot tell the order in which the windows were created since they new windows can be added anywhere in the array. secondly, how can one implement overlapping windows given the fact that the BGI graphics only understands one current window. I have avoided virtual windows that allow updating even when they are partially hidden. How do window systems like WIN 3 , GEM, Mac and TGL handle the huge amount of background bitmaps that have to be stored whenever a dialog box pops over the screen? In general does one have to start from scratch to write one's on graphics primitives such as lines and circles so as to be able to control clipping and the rest? I would be very happy to get information on these problems. thanks a lot. Chima Echeruo PPS. I use a 286, EGA and some extended RAM (384 KB). -- ------------------------------------------------------------------------------- ----- Chima Oke Echeruo ----- oecheruo@silver.ucs.indiana.edu ++++++ oecheruo@amber.ucs.indiana.edu -------------------------------------------------------------------------------