Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Html to QB64 Quote Converter
#1
Ever get sick and tired of typing endless CHR$(34) additions to quoted text so it can be used in the IDE. Really, just me? Well I'll post this anyway.

Code: (Select All)
' Automatically adds quotes in correct places to convert html to QB64.
Width 20, 5: _Font 16: _ScreenHide
a$ = _Clipboard$
For i = 1 To Len(a$)
    If Asc(Mid$(a$, i, 1)) < 32 Then _Continue
    b$ = b$ + Mid$(a$, i, 1)
    If Mid$(a$, i, 1) = Chr$(34) Then b$ = b$ + " + chr$(34) + " + Chr$(34)
Next
b$ = "a$ = " + Chr$(34) + b$ + Chr$(34)
seed = 1 ' Adjust for alt = ""
Do
    c = c + 1
    q = InStr(seed, b$, Chr$(34) + Chr$(34))
    If q Then
        b$ = Mid$(b$, 1, InStr(seed, b$, Chr$(34) + Chr$(34)) - 2) + Mid$(b$, InStr(seed, b$, Chr$(34) + Chr$(34)) + 4)
    Else
        Exit Do
    End If
    seed = q + 3
    If c > 1000 Then Beep: System
Loop
If Right$(b$, 2) = " +" Then b$ = Mid$(b$, 1, Len(b$) - 2) ' Remove any trailing + sign.
_Clipboard$ = b$
System

So just compile and make a desktop shortcut. When you need to us it, just copy the text you want converted to your clipboard, click the short cut, and paste the converted results. Nothing will show up on your screen, it's all handled in the background.

PRINT CHR$(34) + "Pete" + CHR$(34)
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
Html to QB64 Quote Converter - by Pete - 11-11-2024, 11:30 PM
RE: Html to QB64 Quote Converter - by SMcNeill - 11-12-2024, 01:26 AM
RE: Html to QB64 Quote Converter - by Pete - 11-12-2024, 02:02 AM
RE: Html to QB64 Quote Converter - by SMcNeill - 11-12-2024, 02:25 AM



Users browsing this thread: 1 Guest(s)