September 25, 2020, 02:29:53 pm

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


"Unknown Type" error

Started by Egil, August 23, 2016, 04:08:40 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Egil

August 23, 2016, 04:08:40 am Last Edit: August 23, 2016, 04:10:58 am by Egil
I've run into a strange problem. When experimenting with tooltips code, CB does not recognize an UDT. Get a "Unknown Type" error as soon as this line is inserted:
Code Select
DEF pic1,pic2,pic3,pic4:MYRGN

Copied the definitions into Grahams "Skeleton Win" code, and the same error occoured.
What am I doing wrong?

Egil

Code Select

' Creative Basic Skeleton window by GWS

'autodefine "OFF"

' define rectangle structures
TYPE MYRGN
DEF Left:INT
DEF Top:INT
DEF Right:INT
DEF Bottom:INT
ENDTYPE
DEF pic1,pic2,pic3,pic4:MYRGN


def w:window
def wstyle,run:int

wstyle = @minbox

' open a window ..
window w,0,0,600,400,wstyle,0,"Creative Basic",messages

run = 1

WAITUNTIL run = 0
CLOSEWINDOW w
END


SUB messages
select @class

CASE @idcreate
centerwindow w

CASE @idclosewindow
run = 0

CASE @idcontrol

select @controlID
case 1
run = 0
endselect
endselect
RETURN


Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

Hey Egil
Works fine on both versions of CBasic I have (1.01 an 1.153 according to about box) that I have on my computer.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

GWS

Egil,

That's strange - no problem here.

I copied your code into a new source file, and it ran with no error messages in Version 1.0

Try a brand new source file and copy your posted code into it - it should run OK.

best wishes,  :)

Graham

Tomorrow may be too late ..

Egil

Thanks guys!

I have no idea what have happened, but I was not able to get rid of the error message in neither v1.00 or v1.01.
But when doing as Graham suggested, the code is ok in both versions.

Have not tried with version 1.153 because then I will loose the bitmap  button possibility.

What I try to do, is to use some of the ideas from an old EB program (http://www.ionicwind.com/forums/index.php?topic=1387.msg13022#msg13022)
to code bitmapbuttons with tooltips. But since I think that getting tooltips automaticly somehow disturbs the window, I'll make a version where tooltips are controlled by the right mousebutton.

This was something my "young assistants"tried in our workshop saturday, but was not able to achieve. But when searching the forum for "tooltips" last night,
I found the mentioned EB code. And since that idea in great parts resemles the methods I first tried for bitmapbuttons, I thought I should give it a shot...
If the result are useful, I'll post the code here.


Egil
Support Amateur Radio  -  Have a ham  for dinner!