- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to improve my code by adding checking for integer overflow.
I now find I get an integer overflow error with the RGB function.
I must be doing something silly.
David
I now find I get an integer overflow error with the RGB function.
I must be doing something silly.
David
integer*4 c integer*2 i1,i2,i3 c=RGB(255,0,0) ! this is OK i1=255 i2=0 i3=0 c=RGB(int1(i1),int1(i2),int1(i3)) ! this gives and error
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A simple write statement shows that int1(255)=-1.
I don't see explicit documenation of RGB() called ffom Fortran.
Would it be easier to use RGBTOINTEGER which explicity has integer*4 arguments and check bitwise that the higher bits are not set?
I don't see explicit documenation of RGB() called ffom Fortran.
Would it be easier to use RGBTOINTEGER which explicity has integer*4 arguments and check bitwise that the higher bits are not set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I had forgotten that int1 would be -127 to 128.
When I try RGBtoInteger it won't compile, I don't see why.
I get the message 'Unresolved external symbol _rgbtointeger
David
When I try RGBtoInteger it won't compile, I don't see why.
I get the message 'Unresolved external symbol _rgbtointeger
David
use dfwin use dflib integer*4 i1,i2,i3,c c=RGB(255,0,0) ! this is OK i1=255 i2=0 i3=0 c=RGBTOINTEGER(i1,i2,i3) ! this wouldn't compile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The message you quote looks like an error message from the linker. Your code compiled and linked OK for me in a fresh "standard graphics" project. Perhaps you are not accessing the right library?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I thought using -
'Use dflib' would use the correct library.
How can I check this. Normally it works OK.
David
'Use dflib' would use the correct library.
How can I check this. Normally it works OK.
David
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