Skip to content

Instantly share code, notes, and snippets.

View mattcan's full-sized avatar

Matthew Cantelon mattcan

View GitHub Profile
@mattcan
mattcan / SplitColumn.vb
Last active October 13, 2015 14:37
Splits text in one column into two
Sub SplitColumn( _
ByVal LastRow As Long, _
ByVal DataCol As String, _
ByVal FirstPartCol As String, _
ByVal SecondPartCol As String, _
ByVal DelimCharacter As String _
)
Dim data_col As String, col_one As String, col_two As String, delimiter As String
data_col = DataCol
@mattcan
mattcan / count-to-ten.b
Created May 17, 2012 14:41
A program that counts to ten, outputting each value along the way
++++++++++ set loop counter to ten
[
>>>>+++ increase 5th cell by 3
<<<<- decrease loop counter
]
>>>>++ increase 5th cell by 2 to make the 'Space' ASCII code
<<<<++++++++++ reuse 1st cell as loop counter increase to ten
[
>+++++ increase 2nd cell by 5
>+++++ increase 3rd cell by 5
@mattcan
mattcan / commandcolumn_visibility.vb
Created January 17, 2012 21:44
DevExpress ASPxGridView CommandColumn Visibility
Private Sub theGrid_DataBound(ByVal sender as Object, ByVal e as System.EventArgs) Handles theGrid.DataBound
' Create a GridView object and cast the GridView object we're working on to it
Dim gv As ASPxGridView = TryCast(sender, ASPxGridView)
' Loop through the visible columns (as they are set in the ASP or somewhere else in your code)
For i As Integer = 0 To gv.VisibleColumns.Count
' Match the type of the current column to the GridViewCommandColumn type and
' then hide the column and break out of the loop
If TypeOf (gv.VisibleColumns(i)) Is GridViewCommandColumn Then
@mattcan
mattcan / FlipName.bas
Last active September 29, 2015 10:08
Flip "Lastname, Firstname" to "Firstname Lastname"
'''
' Note that Split always returns a 0-indexed array
'''
Option Explicit
Function flip_name(comma_sep_name As String)
Dim name_parts() As String
name_parts = Split(comma_sep_name, ",")