December 05, 2019, 02:59:30 pm

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


SETID values

Started by Andy, October 20, 2018, 06:32:52 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

I was just wondering about SETID values.

You can have hex values, decimal values, but NOT decimal values that are minus - the compiler throws up an error when you do that.

So how would we express a setid who's value is  a minus value?

Example:

SETID "MyWidgit",-100

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

I've never run into a negative flag value and that's what SETID was intended for(or at least that's  my understanding)
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

jalih

Quote from: Andy on October 20, 2018, 06:32:52 am
So how would we express a setid who's value is  a minus value?

Example:

SETID "MyWidgit",-100


@ constant is an unsigned integer but something like this should work:
Code Select

setid "minushundred", 0xFFFFFF9C
print int(@minushundred)

Andy

Larry,

Using my constants search program I've found a few minus values:

Code Select

CB_ERR , -1 , COMBOBOX , MESSAGE
CB_ERRSPACE , -2 , COMBOBOX , MESSAGE
CBEN_FIRST , -800 , COMBOBOX , NOTIFICATION
CBEN_LAST , -830 , COMBOBOX , NOTIFICATION
CBN_ERRSPACE , -1 , COMBOBOX , NOTIFICATION
DDOC_BADFILE , -2 , PAGE , OTHER
DDOC_ERR_OPEN_INPUT , -3 , PAGE , OTHER
DDOC_ERROR_OPEN_OUTPUT , -2 , PAGE , OTHER
DDOC_ERROR_OPEN_STUB , -1 , PAGE , OTHER
DDOC_FILEEXISTS , -3 , PAGE , OTHER
DDOC_INPUT_NOT_FOUND , -5 , PAGE , OTHER
DDOC_NOHANDLES , -1 , PAGE , OTHER
DDOC_OUTPUT_EXISTS , -4 , PAGE , OTHER
DTN_FIRST , -760 , DATE , NOTIFICATION
DTN_LAST , -799 , DATE , NOTIFICATION
FM_BLANK_ICON , -1 , FILEMANAGER , OTHER
FM_DEFAULT_SELHEIGHT , -1 , FILEMANAGER , OTHER
GCL_CBCLSEXTRA , -20 , CLASS , MESSAGE
GCL_CBWNDEXTRA , -18 , CLASS , MESSAGE
GCL_HBRBACKGROUND , -10 , CLASS , MESSAGE
GCL_HCURSOR , -12 , CLASS , MESSAGE
GCL_HICON , -14 , CLASS , MESSAGE
GCL_HICONSM , -34 , CLASS , MESSAGE
GCL_HMODULE , -16 , CLASS , MESSAGE
GCL_MENUNAME , -8 , CLASS , MESSAGE
GCL_STYLE , -26 , CLASS , MESSAGE
GCL_WNDPROC , -24 , CLASS , MESSAGE
GWL_EXSTYLE , -20 , WINDOW , MESSAGE
GWL_HINSTANCE , -6 , WINDOW , MESSAGE
GWL_HWNDPARENT , -8 , WINDOW , MESSAGE
GWL_ID , -12 , WINDOW , MESSAGE
GWL_STYLE , -16 , WINDOW , MESSAGE
GWL_USERDATA , -21 , WINDOW , MESSAGE
GWL_WNDPROC , -4 , WINDOW , MESSAGE
GWLP_HINSTANCE , -6 , WINDOW , MESSAGE
GWLP_HWNDPARENT , -8 , WINDOW , MESSAGE
GWLP_ID , -12 , WINDOW , MESSAGE
GWLP_USERDATA , -21 , WINDOW , MESSAGE
GWLP_WNDPROC , -4 , WINDOW , MESSAGE
HDN_FIRST , -300 , HEADER , NOTIFICATION
HDN_LAST , -399 , HEADER , NOTIFICATION
HTERROR , -2 , HITTEST , OTHER
HWND_MESSAGE , -3 , WINDOW , OTHER
HWND_NOTOPMOST , -2 , WINDOW , OTHER
HWND_TOPMOST , -1 , WINDOW , OTHER
INVALID_FILE_ATTRIBUTES , -1 , INTERNET , OTHER
IPN_FIRST , -860 , INTERNET , OTHER
IPN_LAST , -879 , INTERNET , OTHER
LB_ERR , -1 , LISTBOX , MESSAGE
LB_ERRSPACE , -2 , LISTBOX , MESSAGE
LBN_ERRSPACE , -2 , LISTBOX , NOTIFICATION
LVN_FIRST , -100 , LISTVIEW , NOTIFICATION
LVN_LAST , -199 , LISTVIEW , NOTIFICATION
LVSCW_AUTOSIZE , -1 , LISTVIEW , STYLE
LVSCW_AUTOSIZE_USEHEADER , -2 , LISTVIEW , STYLE
MCN_FIRST , -750 , CALENDAR , NOTIFICATION
MCN_LAST , -759 , CALENDAR , NOTIFICATION
PGN_FIRST , -900 , PAGER , NOTIFICATION
PGN_LAST , -950 , PAGER , NOTIFICATION
PSN_FIRST , -200 , PROPERTY , NOTIFICATION
PSN_LAST , -299 , PROPERTY , NOTIFICATION
STD_ERROR_HANDLE , -12 , TOOLBAR , MESSAGE
STD_INPUT_HANDLE , -10 , TOOLBAR , MESSAGE
STD_OUTPUT_HANDLE , -11 , TOOLBAR , MESSAGE
TBN_FIRST , -700 , TOOLBAR , NOTIFICATION
TBN_LAST , -720 , TOOLBAR , NOTIFICATION
TCN_FIRST , -550 , TABCONTROL , NOTIFICATION
TCN_LAST , -580 , TABCONTROL , NOTIFICATION
TTN_FIRST , -520 , TOOLTIP , NOTIFICATION
TTN_GETDISPINFO , -520 , TOOLTIP , NOTIFICATION
TTN_LAST , -549 , TOOLTIP , NOTIFICATION
TTN_LINKCLICK , -523 , TOOLTIP , NOTIFICATION
TTN_NEEDTEXT , -520 , TOOLTIP , NOTIFICATION
TTN_POP , -522 , TOOLTIP , NOTIFICATION
TTN_SHOW , -521 , TOOLTIP , NOTIFICATION
TVI_FIRST , -65535 , TREEVIEW , MESSAGE
TVI_LAST , -65534 , TREEVIEW , MESSAGE
TVI_ROOT , -65536 , TREEVIEW , MESSAGE
TVI_SORT , -65533 , TREEVIEW , MESSAGE
TVN_BEGINDRAG , -407 , TREEVIEW , NOTIFICATION
TVN_BEGINLABELEDIT , -410 , TREEVIEW , NOTIFICATION
TVN_BEGINRDRAG , -408 , TREEVIEW , NOTIFICATION
TVN_DELETEITEM , -409 , TREEVIEW , NOTIFICATION
TVN_ENDLABELEDIT , -411 , TREEVIEW , NOTIFICATION
TVN_FIRST , -400 , TREEVIEW , NOTIFICATION
TVN_GETDISPINFO , -403 , TREEVIEW , NOTIFICATION
TVN_GETINFOTIP , -413 , TREEVIEW , NOTIFICATION
TVN_ITEMEXPANDED , -406 , TREEVIEW , NOTIFICATION
TVN_ITEMEXPANDING , -405 , TREEVIEW , NOTIFICATION
TVN_KEYDOWN , -412 , TREEVIEW , NOTIFICATION
TVN_SELCHANGED , -402 , TREEVIEW , NOTIFICATION
TVN_SELCHANGING , -401 , TREEVIEW , NOTIFICATION
TVN_SETDISPINFO , -404 , TREEVIEW , NOTIFICATION
TVN_SINGLEEXPAND , -415 , TREEVIEW , NOTIFICATION
UDN_FIRST , -721 , UPDOWN , NOTIFICATION
UDN_LAST , -740 , UPDOWN , NOTIFICATION


Jalih,

FFFFFF9C does work, but 9C is not 100 decimal, so where did you get the 9C value from?

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

jalih

Quote from: Andy on October 21, 2018, 01:44:57 am
FFFFFF9C does work, but 9C is not 100 decimal, so where did you get the 9C value from?


it comes directly from binary and how computer stores negative numbers.

You might consider ditching using @ constants and use const instead. It seems to be able to handle negative numbers directly.

Andy

October 21, 2018, 02:23:14 am #5 Last Edit: October 21, 2018, 02:29:08 am by Andy
Jalih,

Yes, CONST does handle minus values correctly, I was simply using the constants search program to produce a list of SETID's for a control type and found when I had minus values and pasted the SETID's into a program the compiler didn't like it.

Was just wondering if there was a way around it, or just to simply to leave it as it is.

Thanks for your help.

Andy.

BTW:

If you haven't downloaded the constants search program yet, here is the link:
https://www.ionicwind.com/forums/index.php?topic=6221.msg45736#new

And I will release version 4.2 nearer Christmas time with more constants and functions added.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

billhsln

Try this, results are interesting:

QuoteOPENCONSOLE

DEF i:INT
DEF u:UINT
DEF i64:INT64
DEF u64:UINT64

i = 0xFFFFFF9C
u = 0xFFFFFF9C
i64 = 0xFFFFFF9C
u64 = 0xFFFFFF9C

print i, u, i64, u64

PRINT "Done"
INPUT i
CLOSECONSOLE
END


The -100 I expected, but the int64 and uint64 has differing results.

Bill
When all else fails, get a bigger hammer.