Question How do you include code in a post? (1 Viewer)

sneuberg

AWF VIP
Local time
Yesterday, 19:40
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?
 

James Deckert

Continuing to Learn
Local time
Yesterday, 21:40
Joined
Oct 6, 2005
Messages
189
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
 

sneuberg

AWF VIP
Local time
Yesterday, 19:40
Joined
Oct 17, 2014
Messages
3,506
Well that's simple. Thanks
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 12:40
Joined
Jan 20, 2009
Messages
12,851
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.)
 

Minty

AWF VIP
Local time
Today, 03:40
Joined
Jul 26, 2013
Messages
10,368
Mods - It would be very handy if the Code tag # was available on the quick reply entry?
 

Users who are viewing this thread

Top Bottom