Working on a wysiwyg vbcode editor
which is better the standard vbcodes
or code from my wysiwyg editorVB Code:
Sub doComments() 'make all comments green Dim i As Long Dim j As Long Dim strCode As String With mRTB strCode = .Text
VB Code:
[COLOR=#0000FF]Private[/COLOR] [COLOR=#0000FF]Function[/COLOR] AdvancePointer(Buffer() [COLOR=#0000FF]As[/COLOR] [COLOR=#0000FF]Byte[/COLOR], ptr [COLOR=#0000FF]As[/COLOR] [COLOR=#0000FF]Long[/COLOR]) [COLOR=#0000FF]As[/COLOR] [COLOR=#0000FF]Long[/COLOR] [COLOR=#7A0000]'returns a pointer to the block terminator[/COLOR] [COLOR=#0000FF]Dim[/COLOR] nBytes [COLOR=#0000FF]As[/COLOR] [COLOR=#0000FF]Byte[/COLOR] [COLOR=#0000FF]Dim[/COLOR] p [COLOR=#0000FF]As[/COLOR] [COLOR=#0000FF]Long[/COLOR] p = ptr [COLOR=#7A0000]'1st byte is number of bytes in data block[/COLOR] nBytes = Buffer(p) [COLOR=#0000FF]While[/COLOR] nBytes > 0 [COLOR=#7A0000]'point to next block[/COLOR] p = p + nBytes + 1 nBytes = Buffer(p) [COLOR=#7A0000]'Debug.Print Hex(p), nBytes[/COLOR] [COLOR=#0000FF]Wend[/COLOR] AdvancePointer = p [COLOR=#0000FF]End[/COLOR] [COLOR=#0000FF]Function[/COLOR]




Reply With Quote