- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get a warning message when I pass a hexadecimal number to a QWIN function:
call setlinestyle(#FFFF)
I tried the alternative syntax (Z'FFFF') but get the same warning:
D:sfpintel9ds_phiaxisparm.for(108) : Warning: The data type of the actual argument does not match the definition. [Z'FFFF']
call setlinestyle(Z'FFFF')
----------------------------^
call setlinestyle(Z'FFFF')
----------------------------^
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue is mentioned in the 9.0 release notes - the compiler used to be quiet about a mismatch between the argument type and what was declared in the interface, but now it properly complains. This does pose a problem for hex constants as you can't specify the integer "kind" and values such as #FFFF are out of range for the INT function.
Two options I can suggest:
1. Declare a PARAMETER constant of the correct kind, such as:
INTEGER(2), PARAMETER : Z_FFFF = Z'FFFF'
and use that in the call.
2. Use the TRANSFER intrinsic such as:
call setlinestyle(TRANSFER(Z'FFFF',0_2))
We recognize that this causes problems for some users and are thinking about ways to mitigate it.
Two options I can suggest:
1. Declare a PARAMETER constant of the correct kind, such as:
INTEGER(2), PARAMETER : Z_FFFF = Z'FFFF'
and use that in the call.
2. Use the TRANSFER intrinsic such as:
call setlinestyle(TRANSFER(Z'FFFF',0_2))
We recognize that this causes problems for some users and are thinking about ways to mitigate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No problem, I'll do that. However, I'm not sure what you mean by "values such as #FFFF are out of range for the INT function" - this is two bytes, just what integer*2 requires? How is defining it via a parameter any different?
Incidentally I get a similar warning when I pass an expression as the argument, as in:
call setlinestyle(14+12*(i-1))
(not sure of the exact expression as I'm at home now - will check at work Thursday)
Adrian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The argument to setlinestyle is INTEGER(2). The value #FFFF is INTEGER(4), and would overflow if converted to the signed INTEGER(2) datatype.
Similarly, your expression is INTEGER(4), which does not match the INTEGER(2) type of the argument.
Similarly, your expression is INTEGER(4), which does not match the INTEGER(2) type of the argument.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page