Question How do you include code in a post?

sneuberg

AWF VIP
Local time
Yesterday, 18:43
Joined
Oct 17, 2014
Messages
3,506
I've seen posts with code in a box with scroll bars. This looks much better than posted code using the HTML editor that I'm currently using. How do they do that?
 
I haven't done it before, but I see a pound sign on the toolbar above which says, wrap
Code:
 tags around selected text, so i'll try it below and see what it does.


[CODE]Function CreateInvoice(OrderID As Long, Amt As Currency, InvoiceID As Long) As Boolean
    Dim rsw As New RecordsetWrapper
    If rsw.OpenRecordset("Invoices") Then
        With rsw.Recordset
            If Not rsw.AddNew Then Exit Function
            ![Order ID] = OrderID
            ![Amount Due] = Amt
            If rsw.Update Then
                .Bookmark = .LastModified
                InvoiceID = ![Invoice ID]
                CreateInvoice = True
            End If
        End With
    End If
End Function


Function IsInvoiced(OrderID As Long) As Boolean
    IsInvoiced = DCountWrapper("[Invoice ID]", "Invoices", "[Order ID]=" & OrderID) > 0
End Function


Function PrintInvoice(OrderID As Long) As Boolean
    DoCmd.OpenReport "Invoice", acViewPreview, , "[Order ID]=" & OrderID, acDialog
End Function


Function SetStatus(OrderID As Long, Status As CustomerOrderStatusEnum) As Boolean
    Dim rsw As New RecordsetWrapper
    If rsw.OpenRecordset("Orders", "[Order ID] = " & OrderID) Then
        With rsw.Recordset
            If Not .EOF Then
                .Edit
                ![Status ID] = Status
                SetStatus = rsw.Update
            End If
        End With
    End If
End Function


Function Delete(OrderID As Long) As Boolean
    Dim rsw As New RecordsetWrapper
    If rsw.OpenRecordset("Orders", "[Order ID] = " & OrderID) Then
        Delete = rsw.Delete
    End If
End Function
 
Well that's simple. Thanks
 
The # sign button simple wraps the selected text between code tags. Much like the quote tags you must have noticed by now. I think most regular users start just typing them in after a while.

[ code] some code
[ /code]

(Leave out the spaces which I included so they wouldn't be treated as code tags.)
 
Mods - It would be very handy if the Code tag # was available on the quick reply entry?
 

Users who are viewing this thread

Back
Top Bottom