In a routine I want to save the current foreground and background color but can't seem to get the background color?
In the code below I can see the &H88 but not the &H99 in the returned value.
Also the Help example uses uinteger instead of ulong
Return Value
Returns a 32-bit value containing the current foreground color in the Low Word and the current background color in the High Word. (In hi/truecolor modes, only the foreground color is returned, taking up the whole 32 bits.)
The old color values can be retrieved at the same time as setting new ones.
screenres 640,480,32
color rgb(0,0,0),rgb(255,255,255):cls
sub colorPrint(text as string,fg as ulong,bg as ulong)
dim as ulong oldColor
oldColor = color(fg,bg)
print text
color oldColor
end sub
colorPrint("hello world",rgb(255,0,0),rgb(0,255,0))
print "hello world"
sleep
Thank you for your patience and tolerance.
The FBIDE help I used is out of date and I also forgot about FBWiki which didn't show up when I did a google search for "freebasic color command".