Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ types > QB64 types: do we have an equivalent QB64PE page?
#1
For some API work I'm doing, I found this page useful: 

Do we have an equivalent QB64PE page with this info?


C++ Variable Types

C Name
Description
Size
QB64 Type
Character or small integer.
1 byte
Short Integer(Word)
2 byte
Integer(Dword)
4 byte
Int32, Long integer or Long
4 byte
Long long (Qword)
8 byte
Boolean value true or false.
1 byte
Floating point number
4 byte
Double precision floating.
8 byte
Long double precision float
10 byte
2 or 4
void pointer(void *)
ANY


PS Useful trick for anyone who wants to copy a table with hyperlinks from a Web page to forum post markdown quickly - you can use Excel. A couple small macros and some formulas gets you a nice reusable template. Here's the macro and see the screenshot for how to set up the formulas. Thereafter all you have to do is paste your table into the sheet and voila! the final markdown is calculated in cells M2-M(endrow). Slap that inside
tags and done. (Note: if you need more than 4 columns, insert n columns, copy the formula columns over, and add the new columns to the final row mardown formula.) The ability to paste directly from rich text into the forums editor would eliminate all this nonsense but this beats manually typing in everything. 

Code: (Select All)
' /////////////////////////////////////////////////////////////////////////////
' FROM:

' vba - Extract URL From Excel Hyperlink Formula - Stack Overflow
' https://stackoverflow.com/questions/32230657/extract-url-from-excel-hyperlink-formula

' Excel VBA to extract Hyperlink from Hyperlink Formula - Super User
' https://superuser.com/questions/1313339/excel-vba-to-extract-hyperlink-from-hyperlink-formula

Public Function GetHyperLinkAddress(ByVal Target As Excel.Range) As String
    Dim RoutineName As String:: RoutineName = "GetHyperLinkAddress"
    Dim sFormula As String
    Dim sExpression As String
    Dim iStart As Long
    Dim iPos As Long
    Dim iEnd As Long
    Dim sURL As String
    Dim sSubAddress As String
    Dim sFind As String
   
    'Set Target = ActiveCell
    sURL = ""
    
    On Error Resume Next ' handle errors manually
   
    If Target.Hyperlinks.Count > 0 Then
        sURL = Target.Hyperlinks(1).Address
        sSubAddress = Target.Hyperlinks(1).SubAddress
        If Len(sSubAddress) > 0 Then
            sURL = sURL & "#" & sSubAddress
        End If
    ElseIf Target.HasFormula Then
        sFormula = Target.Formula
        sFind = "HYPERLINK("
        iPos = InStr(1, sFormula, sFind, vbTextCompare)
        If (iPos > 0) Then
            iEnd = InStr(iPos + 1, sFormula, ",", vbTextCompare)
            If (iEnd > 0) Then
                iStart = iPos + Len(sFind)
                sExpression = Mid(sFormula, iStart, iEnd - iStart)
                sURL = Evaluate(sExpression)
            End If
        End If
    End If
   
    If Err.Number <> 0 Then
        Debug.Print CStr(Now) & " " & RoutineName & " failed with error #" & CStr(Err.Number) & ": " & Err.Description
        Err.Clear
        sURL = ""
    End If
    
    On Error Goto 0 ' resume automatic error handling
    
    GetHyperLinkAddress = sURL
End Function ' GetHyperLinkAddress

' /////////////////////////////////////////////////////////////////////////////

Public Function GetURL(ByVal Target As Excel.Range) As String
    Application.Volatile
    GetURL = GetHyperLinkAddress(Target)
End Function ' GetURL

[Image: table-markdown-from-excel.png]
Reply


Messages In This Thread
C++ types > QB64 types: do we have an equivalent QB64PE page? - by madscijr - 05-31-2024, 03:26 PM



Users browsing this thread: 1 Guest(s)