Line 95: 16737843 And 255 returns 51, 51 \ 1 returns 51, remainder 0įurther details of the binary And are provided in figure 5.' omitted (&HFF00), the assigned value is -256 ' leading &H is the prefix radix (base) for hexadecimal R = (ColDec And &HFF) \ 256 ^ 0 ' &HFF hexadecimal = 255 decimal Includes test routineįunction xlfDec2RGB(ByVal ColDec As Long) As String The ColorConstants Auto List drop down is shown in figure 4.įig 4: VBA ColorConstants - VBA Auto List drop down with 8 itemsĬode 3 prints a list of the ColorConstants numerical values to the immediate window (figure 5).Ĭode 5: Function xlfDec2RGB converts color decimal to RGB comma separated values. The 8 colours listed in section 1.1 have name equivalents listed as members of the VBA ColorConstants class in the decimal colour system. Ten of the ColorIndex colours are duplicate pairs: Offset(i - 1, j - 1).Font.ColorIndex = 1 Offset(i - 1, j - 1).Font.ColorIndex = 2 The same caveats as for broadcast traffic still apply, but this allows uninterested hosts to quickly identify your packets, and it allows network managers to set up specific forwarding rules for your protocol.Code 2: Sub ColIndx2WSarraS procedure prints ColorIndex to WS array (7 rows by 8 columns)Ĭonst TLC As String = "B2" ' top left cell My other suggestion would be to use multicast, if that makes sense for your application. Selecting an interface explicitly is better, but needs to be done carefully. In general, using 255.255.255.255 is a bad idea, as there are several setups where the interface with the default route is exactly the wrong choice. In both cases, these should be mapped to the network layer broadcast address (which would be FF:FF:FF:FF:FF:FF for Ethernet). The subnet broadcast address is used to select a specific interface. In practice, there are almost no routers forwarding broadcasts, and a lot of stacks simply send one copy of the packet to the interface where the default route points to. In principle, 255.255.255.255 is the "global" broadcast address, which means that the IP stack is supposed to send the packet to all network interfaces, and routers that are configured to forward broadcasts are supposed to send them on. If your network is 192.168.0.0/16, then your network address will be 192.168.0.0 and your broadcast address will be 192.168.255.255.Ģ55.255.255.255 is a special broadcast address, which means "this network": it lets you send a broadcast packet to the network you're connected to, without actually caring about its address in this, is similar to 127.0.0.1, which is a virtual address meaning "local host". If your network is 192.168.1.0/24, then your network address will be 192.168.1.0 and your broadcast address will be 192.168.1.255. A broadcast address is always relative to a given network, there is no broadcast per se when you have a network, you can compute its broadcast address by replacing all the host bits with 1s simply put, the broadcast address is the highest numbered address you can have on the network, while the network address is the lowest one (with all host bits set to 0s) this is why you can't use either of them as actual host addresses: they are reserved for this use.