August 06, 2020, 07:40:59 am

## 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

0 Members and 1 Guest are viewing this topic.

#### Andy

##### October 20, 2018, 06:32:52 am
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

##### October 20, 2018, 07:50:19 am #1
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

##### October 20, 2018, 07:51:58 am #2
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", 0xFFFFFF9Cprint int(@minushundred)`

#### Andy

##### October 21, 2018, 01:44:57 am #3
Larry,

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

Code Select
`CB_ERR , -1 , COMBOBOX , MESSAGECB_ERRSPACE , -2 , COMBOBOX , MESSAGECBEN_FIRST , -800 , COMBOBOX , NOTIFICATIONCBEN_LAST , -830 , COMBOBOX , NOTIFICATIONCBN_ERRSPACE , -1 , COMBOBOX , NOTIFICATIONDDOC_BADFILE , -2 , PAGE , OTHERDDOC_ERR_OPEN_INPUT , -3 , PAGE , OTHERDDOC_ERROR_OPEN_OUTPUT , -2 , PAGE , OTHERDDOC_ERROR_OPEN_STUB , -1 , PAGE , OTHERDDOC_FILEEXISTS , -3 , PAGE , OTHERDDOC_INPUT_NOT_FOUND , -5 , PAGE , OTHERDDOC_NOHANDLES , -1 , PAGE , OTHERDDOC_OUTPUT_EXISTS , -4 , PAGE , OTHERDTN_FIRST , -760 , DATE , NOTIFICATIONDTN_LAST , -799 , DATE , NOTIFICATIONFM_BLANK_ICON , -1 , FILEMANAGER , OTHERFM_DEFAULT_SELHEIGHT , -1 , FILEMANAGER , OTHERGCL_CBCLSEXTRA , -20 , CLASS , MESSAGEGCL_CBWNDEXTRA , -18 , CLASS , MESSAGEGCL_HBRBACKGROUND , -10 , CLASS , MESSAGEGCL_HCURSOR , -12 , CLASS , MESSAGEGCL_HICON , -14 , CLASS , MESSAGEGCL_HICONSM , -34 , CLASS , MESSAGEGCL_HMODULE , -16 , CLASS , MESSAGEGCL_MENUNAME , -8 , CLASS , MESSAGEGCL_STYLE , -26 , CLASS , MESSAGEGCL_WNDPROC , -24 , CLASS , MESSAGEGWL_EXSTYLE , -20 , WINDOW , MESSAGEGWL_HINSTANCE , -6 , WINDOW , MESSAGEGWL_HWNDPARENT , -8 , WINDOW , MESSAGEGWL_ID , -12 , WINDOW , MESSAGEGWL_STYLE , -16 , WINDOW , MESSAGEGWL_USERDATA , -21 , WINDOW , MESSAGEGWL_WNDPROC , -4 , WINDOW , MESSAGEGWLP_HINSTANCE , -6 , WINDOW , MESSAGEGWLP_HWNDPARENT , -8 , WINDOW , MESSAGEGWLP_ID , -12 , WINDOW , MESSAGEGWLP_USERDATA , -21 , WINDOW , MESSAGEGWLP_WNDPROC , -4 , WINDOW , MESSAGEHDN_FIRST , -300 , HEADER , NOTIFICATIONHDN_LAST , -399 , HEADER , NOTIFICATIONHTERROR , -2 , HITTEST , OTHERHWND_MESSAGE , -3 , WINDOW , OTHERHWND_NOTOPMOST , -2 , WINDOW , OTHERHWND_TOPMOST , -1 , WINDOW , OTHERINVALID_FILE_ATTRIBUTES , -1 , INTERNET , OTHERIPN_FIRST , -860 , INTERNET , OTHERIPN_LAST , -879 , INTERNET , OTHERLB_ERR , -1 , LISTBOX , MESSAGELB_ERRSPACE , -2 , LISTBOX , MESSAGELBN_ERRSPACE , -2 , LISTBOX , NOTIFICATIONLVN_FIRST , -100 , LISTVIEW , NOTIFICATIONLVN_LAST , -199 , LISTVIEW , NOTIFICATIONLVSCW_AUTOSIZE , -1 , LISTVIEW , STYLELVSCW_AUTOSIZE_USEHEADER , -2 , LISTVIEW , STYLEMCN_FIRST , -750 , CALENDAR , NOTIFICATIONMCN_LAST , -759 , CALENDAR , NOTIFICATIONPGN_FIRST , -900 , PAGER , NOTIFICATIONPGN_LAST , -950 , PAGER , NOTIFICATIONPSN_FIRST , -200 , PROPERTY , NOTIFICATIONPSN_LAST , -299 , PROPERTY , NOTIFICATIONSTD_ERROR_HANDLE , -12 , TOOLBAR , MESSAGESTD_INPUT_HANDLE , -10 , TOOLBAR , MESSAGESTD_OUTPUT_HANDLE , -11 , TOOLBAR , MESSAGETBN_FIRST , -700 , TOOLBAR , NOTIFICATIONTBN_LAST , -720 , TOOLBAR , NOTIFICATIONTCN_FIRST , -550 , TABCONTROL , NOTIFICATIONTCN_LAST , -580 , TABCONTROL , NOTIFICATIONTTN_FIRST , -520 , TOOLTIP , NOTIFICATIONTTN_GETDISPINFO , -520 , TOOLTIP , NOTIFICATIONTTN_LAST , -549 , TOOLTIP , NOTIFICATIONTTN_LINKCLICK , -523 , TOOLTIP , NOTIFICATIONTTN_NEEDTEXT , -520 , TOOLTIP , NOTIFICATIONTTN_POP , -522 , TOOLTIP , NOTIFICATIONTTN_SHOW , -521 , TOOLTIP , NOTIFICATIONTVI_FIRST , -65535 , TREEVIEW , MESSAGETVI_LAST , -65534 , TREEVIEW , MESSAGETVI_ROOT , -65536 , TREEVIEW , MESSAGETVI_SORT , -65533 , TREEVIEW , MESSAGETVN_BEGINDRAG , -407 , TREEVIEW , NOTIFICATIONTVN_BEGINLABELEDIT , -410 , TREEVIEW , NOTIFICATIONTVN_BEGINRDRAG , -408 , TREEVIEW , NOTIFICATIONTVN_DELETEITEM , -409 , TREEVIEW , NOTIFICATIONTVN_ENDLABELEDIT , -411 , TREEVIEW , NOTIFICATIONTVN_FIRST , -400 , TREEVIEW , NOTIFICATIONTVN_GETDISPINFO , -403 , TREEVIEW , NOTIFICATIONTVN_GETINFOTIP , -413 , TREEVIEW , NOTIFICATIONTVN_ITEMEXPANDED , -406 , TREEVIEW , NOTIFICATIONTVN_ITEMEXPANDING , -405 , TREEVIEW , NOTIFICATIONTVN_KEYDOWN , -412 , TREEVIEW , NOTIFICATIONTVN_SELCHANGED , -402 , TREEVIEW , NOTIFICATIONTVN_SELCHANGING , -401 , TREEVIEW , NOTIFICATIONTVN_SETDISPINFO , -404 , TREEVIEW , NOTIFICATIONTVN_SINGLEEXPAND , -415 , TREEVIEW , NOTIFICATIONUDN_FIRST , -721 , UPDOWN , NOTIFICATIONUDN_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

##### October 21, 2018, 02:01:14 am #4
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.

Andy.

BTW:

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

##### October 21, 2018, 12:42:44 pm #6
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.