; Hex Example ; ----------- ; Hex$ converts an integer to its hexadecimal (base 16) text form, ; always 8 digits - the same notation as $ literals in source code. Print "Hex$(10) = "+Hex$(10)+" (A is 10 in hex)" Print "Hex$(255) = "+Hex$(255) Print "Hex$(4096) = "+Hex$(4096) Print "Hex$(65535) = "+Hex$(65535) Print "Hex$(-1) = "+Hex$(-1)+" (all 32 bits set)" Print "" ; Hex is the natural way to read packed colour values: $RRGGBB orange=$FF8000 Print "The colour literal $FF8000 is "+orange+" in decimal" Print "Hex$ makes it readable again: "+Hex$(orange) Print "" Print "Press any key to close the example" WaitKey End