Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

BitwiseXORStringBytesMBS(s as string, v as Integer) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Basic MBS Util Plugin 2.8 Yes Yes Yes Yes No
Function: Bitwise XOR with a string's bytes.
Example:
dim a as string = "Hello"
dim b as string = BitwiseXORStringBytesMBS(a,1) // encode
dim c as string = BitwiseXORStringBytesMBS(b,1) // decode
MsgBox b
MsgBox c
Notes:
Memory usage is around lenb(s)*2.
Returns nil on low memory.
v should be in range of 0 to 255.
If you use this function two times on a string, you get the original back.
Any encoding information is lost.

Feedback, Comments & Corrections

Color2IntegerMBS(colorValue as Color) as UInt32
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Basic MBS Util Plugin Yes Yes Yes No No
Function: Returns the RGB value of the color as an integer.
Example:
dim c as color
dim i as UInt32

c=rgb(255,255,255)
i=Color2IntegerMBS(c)

MsgBox hex(i) // FFFFFF

c=rgb(&h12,&H34,&h56)
i=Color2IntegerMBS(c)

MsgBox hex(i) // 123456
Notes:
Same as:
i=c.red*65536+c.green*256+c.blue

Feedback, Comments & Corrections

Integer2ColorMBS(intValue as UInt32) as Color
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Basic MBS Util Plugin Yes Yes Yes No No
Function: Returns the integer as if it is a color.
Example:
dim c as color
dim i as UInt32
c=Integer2ColorMBS(i)
Notes:
Same as:
c=rgb(i\65536 mod 256, i\256 mod 256, i mod 256)

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Util Plugin.




Links
MBS FileMaker Plugins