Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 308
» Latest member: Donaldvem
» Forum threads: 1,741
» Forum posts: 17,901

Full Statistics

Latest Threads
The QB64 IDE shell
Forum: Utilities
Last Post: JasonPag
09-16-2024, 05:37 PM
» Replies: 9
» Views: 764
Importance regarding Ches...
Forum: Utilities
Last Post: JasonPag
09-01-2024, 06:34 PM
» Replies: 0
» Views: 31
Chess and Analysis and En...
Forum: Utilities
Last Post: JasonPag
08-28-2024, 02:37 PM
» Replies: 0
» Views: 32
DAY 009:_PutImage
Forum: Keyword of the Day!
Last Post: grymmjack
09-02-2023, 02:57 PM
» Replies: 54
» Views: 2,034
Fall Banner Contest?
Forum: Site Suggestions
Last Post: grymmjack
08-31-2023, 11:50 PM
» Replies: 36
» Views: 1,262
ColorPicker - Function th...
Forum: Dav
Last Post: Dav
08-31-2023, 11:04 PM
» Replies: 3
» Views: 316
Goals(1) = New Tile()
Forum: Works in Progress
Last Post: RhoSigma
08-31-2023, 09:45 PM
» Replies: 3
» Views: 127
micro(A)v11
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 09:14 PM
» Replies: 90
» Views: 3,589
Updating The Single Most ...
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 09:13 PM
» Replies: 7
» Views: 254
QBJS Image Question
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 05:49 PM
» Replies: 5
» Views: 155

 
  Fonts
Posted by: Pete - 11-17-2022, 09:42 PM - Forum: Help Me! - Replies (5)

I'm finding it a bit difficult to get nice spacing with arial or calibri fonts. Lucida Console works perfectly, but I was hoping to discover a few other ttf windows fonts that wouldn't spread out so much over the screen and would not give unexpected results with extended ASCII characters.

I figure other members might have some favorites. Any suggestions?

Pete

Print this item

  Text encryption
Posted by: AtomicSlaughter - 11-17-2022, 10:59 AM - Forum: Utilities - Replies (8)

Ok, here is a simple program to encode text with a shifting cypher.

Usage:-
  crypt encode 1234 "your data"
  crypt decode 1234 "encoded data"

Code: (Select All)
$CONSOLE:ONLY
CLS
DIM SHARED AS STRING phrase, message, code
REDIM SHARED AS INTEGER sCode(0)
phrase = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
SplitCode
SELECT CASE LCASE$(COMMAND$(1))
    CASE "encode"
        en$ = EnCode
        PRINT "EnCode<", en$
        _CLIPBOARD$ = en$
        PRINT
        PRINT "encoded message has been copied to clipboard"
        SYSTEM
    CASE "decode"
        de$ = DeCode
        PRINT "DeCode>", de$
        _CLIPBOARD$ = de$
        SYSTEM
END SELECT

FUNCTION DeCode$
    DIM AS STRING t, h, e
    DIM AS INTEGER c
    c = 1
    h = UCASE$(COMMAND$(3))
    FOR i = 1 TO LEN(h)
        FOR x = 1 TO LEN(phrase)
            IF MID$(h, i, 1) = MID$(phrase, x, 1) THEN
                e = e + MID$(phrase, x - sCode(c), 1)
                EXIT FOR
            END IF
        NEXT x
        IF c = 4 THEN c = 1 ELSE c = c + 1
    NEXT i
    DeCode = dehex(e)

END FUNCTION

FUNCTION EnCode$
    DIM AS STRING t, h, e
    DIM AS INTEGER c
    c = 1
    h = toHex(COMMAND$(3))
    FOR i = 1 TO LEN(h)
        FOR x = 1 TO LEN(phrase)
            IF MID$(h, i, 1) = MID$(phrase, x, 1) THEN
                e = e + MID$(phrase, x + sCode(c), 1)
                EXIT FOR
            END IF
        NEXT x
        IF c = 4 THEN c = 1 ELSE c = c + 1
    NEXT i
    EnCode = e

END FUNCTION

SUB SplitCode
    REDIM sCode(LEN(COMMAND$(2))) AS INTEGER
    FOR i = i TO LEN(COMMAND$(2))
        sCode(i) = VAL(MID$(COMMAND$(2), i, 1))
    NEXT
END SUB

FUNCTION dehex$ (m AS STRING)
    DIM s AS STRING
    FOR i = 1 TO LEN(m) STEP 2
        s = s + CHR$(VAL("&h" + MID$(m, i, 2)))
        dehex = s
    NEXT

END FUNCTION

FUNCTION toHex$ (m AS STRING)
    DIM s AS STRING
    FOR i = 1 TO LEN(m)
        s = s + HEX$(ASC(MID$(m, i, 1)))
        toHex = s
    NEXT
END FUNCTION



Attached Files
.bas   crypt.bas (Size: 1.84 KB / Downloads: 70)
Print this item

  Open .bas files only
Posted by: PhilOfPerth - 11-17-2022, 08:38 AM - Forum: Site Suggestions - Replies (5)

When opening a file for editing, the "Open file" option shows all files in the directory. Can this be filtered to show only the editable ones (".bas")?  Idea

Print this item

  Attach file
Posted by: PhilOfPerth - 11-17-2022, 06:08 AM - Forum: Site Suggestions - Replies (10)

Would it be possible (or practical) to place an Attach File icon at the top of the thread page, maybe next to the Code icon? I know (now) that this is provided at the very bottom, but this is so far down the page that it's hard to find... at least for me, anyway.  Smile

Print this item

  Word Finder.
Posted by: PhilOfPerth - 11-17-2022, 05:15 AM - Forum: Programs - Replies (8)

Here's a small prog I wrote that finds all words that can be formed from a selected word, using each letter only once. You can select a minimum and maximum word size, up to 13 letters. It uses the wordlists in a folder that are attached as a .zip file.

Code: (Select All)
Screen 9
_FullScreen

Common Shared base$, blngth, dictfile$, dummy$, dictwrd$, l, found, totfound, foundwords$(), unique$, min, max
Dim foundwords$(100)
min = 3

Color 14: Locate 6, 35: Print "Word-Find": Color 15
Print Tab(26); "Copyright Phil Taylor (2022)": Print
Print Tab(5); "This programme will find all English words up to 13 letters in length"
Print Tab(5); "that appear in the Collins (2019) dictionary, that can be formed from "
Print Tab(5); "the letters of a word or group of letters, with each letter only being"
Print Tab(5); "used once."
Print: Print Tab(10); "(You can specify minimum and maximum word-lengths to find)."
Print: Color 14: Print Tab(30); "Press a key to start": Color 15
While InKey$ <> "": Wend
While InKey$ = "": Wend
Print Tab(15);: Input "Minimum size of words (ENTER for default of 2)"; min$
If Val(min$) < 2 Then min = 2 Else min = Val(min$)
Print Tab(30); "Minimum set at "; min
Print
Print Tab(15);: Input "Maximum size of words (ENTER for default of 13)"; max$
If Val(max$) < 2 Then max = 13 Else max = Val(max$)
Print Tab(30); "Maximum set at"; max
Sleep 1
Start:
Cls
While InKey$ <> "": Wend
Locate 10, 20: Color 14: Input "What is the Base-Word (or group)"; base$: Color 15
If base$ < "A" Then base$ = "ANYTHING" '                                                                              just a word for demo purposes
base$ = UCase$(base$)
blngth = Len(base$)
Cls
Color 14: Print "Base-word is "; base$
Print "Minimum length:"; min; "  Maximum length:"; max
: Color 15: Print
base$ = UCase$(base$)
sorted$ = Left$(base$, 1)

FindUnique
For bletrnum = 1 To blngth '                                                                                              for each letter in base$
    fileletr$ = Mid$(base$, bletrnum, 1)
    po = InStr(unique$, fileletr$)
    If po = 0 Then GoTo skip
    Mid$(unique$, po, 1) = " "
    dictfile$ = "wordlists/" + fileletr$
    Close
    Open dictfile$ For Input As #1
    GetAWord:
    While Not EOF(1)
        Input #1, dictwrd$
        l = Len(dictwrd$): If l < min Or l > max Then GoTo GetAWord
        WORDCHECK
    Wend
    skip:
Next
Color 14: Print Tab(35); "Finished!"
Print Tab(29); "Total words found:"; totfound
Sleep
GoTo Start

Sub WORDCHECK
    fail = 0
    dummy$ = base$
    For a = 1 To l
        dictletr$ = Mid$(dictwrd$, a, 1)
        po = InStr(dummy$, dictletr$)
        If po = 0 Then
            fail = 1 '                                                                                                     letter is not in dummy$ so abandon word
        Else
            Mid$(dummy$, po, 1) = " "
        End If
    Next
    If fail = 1 Then Exit Sub
    found = found + 1: totfound = totfound + 1
    foundwords$(found) = dictwrd$
    If Pos(0) > 77 Then Print
    Print dictwrd$; Space$(13 - l);
    If found = 100 Then
        While InKey$ <> "": Wend
        Color 14
        Print
        Print Tab(27); "Press a key for next group"
        While InKey$ = "": Wend
        found = 0
        Cls
        Color 14: Print "Base-word is "; base$: Print
        Print "Minimum length:"; min; "  Maximum length:"; max
        Color 15
    End If
End Sub

Sub FindUnique
    unique$ = ""
    For a = 1 To blngth
        l$ = Mid$(base$, a, 1)
        po = InStr(unique$, l$)
        If po = 0 Then unique$ = unique$ + l$
    Next
End Sub



Attached Files
.zip   wordlists.zip (Size: 713.44 KB / Downloads: 33)
Print this item

  NOT Problem
Posted by: Kernelpanic - 11-16-2022, 09:52 PM - Forum: General Discussion - Replies (9)

The problem with NOT is a hidden error for me. In any case, I personally have no comprehensible explanation for the results. Better for the one result. Why is an incorrect result returned at only one point?

PS: I've now tried everything I could think of again, the wrong result under No. 3 remains.

Code: (Select All)
'NOT-Problem - 16. Nov. 2022

Option _Explicit

Dim As Integer a, b, c, d

a = 10
b = 20
c = 40
d = 15

Print
Print "1"
Print (Not a) And (Not b)

Print
Print "2"
Print (Not c)

Print
Print "3"
Print (Not a) And (Not d)

Print
Print "4"
Print (Not d)

Print
Print "5"
Print (Not b) And (Not c)

End

[Image: NOT-Problem.jpg]

Print this item

  coming soon
Posted by: MasterGy - 11-16-2022, 09:36 PM - Forum: MasterGy - Replies (16)

there will be a game soon. It's just _maptriangle ! I couldn't wait to show a demo after I finished the water effect.

Print this item

  DAY 011: REM
Posted by: SMcNeill - 11-16-2022, 04:43 PM - Forum: Keyword of the Day! - Replies (33)

A command which everyone thinks they know flawlessly, and yet, they probably don't.  Tongue

What is it?  REM is a command that allows people to place remarks inside a program so that it helps clarify what's going on and makes it much easier to come back to the program at a future time and understand just what the BLEEP the programmer was thinking when he coded everything originially.

How to use it?  Just add REM to where you want to place a comment, and then type out your comment!



And with the basic description of this most basic command out of the way, let's touch back upon the opening sentence which begins this post, where I claimed: most folks don't know everything about REM, like they think they do.  WTH is up with that??  "What are people misunderstanding", you ask?

Most people think that REM and ' (the single quote) are interchangeable and completely the same.  In fact, most people think that ' (the single quote) is nothing more than a shortcut to reduce typing out the whole word REM.

This isn't true!!

REM is a *COMMAND*.

' (the single quote) is part of a *COMMENT*.

With REM, REM is an actual command which basically says, "Hey, everything past this point is a comment!"

With ' (the single quote), ' is PART of the comment itself, and is basically excluded from your code.

A subtle difference, but one which can have drastic effects upon a program.  Let's take the following code for example:

Code: (Select All)
IF foo THEN REM foo is a make-believe variable for my example!

Code: (Select All)
IF foo THEN 'foo is a make-believe variable for my example!

Now, at first glance, those two statements look *exactly* alike.  They're not.  Tongue

The first code box contains a single-line IF statement, whereas the second code box contains the start of a multi-line IF statement.  You're going to have to put an END IF in the second code box, or else run into all sorts of errors in your code.

WHY??

Because you ended the first IF statement with a command.  Sure, it's a command which says, "A comment is coming next," but it's still a command.  Think of it just like you would:  IF foo THEN PRINT.   That command (REM, in this case) is enough to close up that IF statement and make it a valid single-line statement.

On the other hand, the second segment of code is basically just IF foo THEN....  Then WHAT??  You're not telling that IF statement what to do on that line, so it's got to be a multi-line IF statement.

REM is a *COMMAND*, just like GOTO, PRINT, and all the other commands in the language.  It's just a command which says, "Comments to the right!"

' (the single quote) is an actual part of a comment, and is basically ignored when used as one inside your programs.  It's not a command, and that's the biggest difference -- and it's a significant one -- between the two.

Print this item

  QB64 Phoenix Edition 3.4.1 Released
Posted by: SMcNeill - 11-16-2022, 04:13 PM - Forum: Announcements - Replies (53)

Release v3.4.1 · QB64-Phoenix-Edition/QB64pe (github.com)  <-- Link to the download the new release, as folks somehow overlook all the other links we've pasted around the site.  Big Grin

Quote:
  • #236#237#238#239#245 - Several improvements made to the dialog functionality introduced in 3.4.0 - @mkilgore

    • Single and double quotes can now be used in any string provided to a dialog.
    • On Windows, the popup from _NotifyPopup will now be associated with the program using the command.
    • On Windows, _InputBox$ no longer spawns a separate process to display the dialog.
    • Previously some strings passed to the dialog functions were not properly escaped before being passed to the underlying dialog provider, those issues have been fixed.
  • #241 - Fixed bug in PAINT when a border color is not provided - @TheJoyfulProgrammer@mkilgore

    • The broken syntax was 


      Code: (Select All)
      PAINT (x, y), tileString$
      , where the optional border color was left off.
    • That would fill as though you provided zero as the border color, now it correctly fills any pixels matching the initial color at 


      Code: (Select All)
      (x, y)
      .
  • #247 - The 'Open' dialog in the IDE now makes use of the system provided Open dialog - @SteveMcNeill@mkilgore

    • This can be toggled off if necessary via the 'GUI Dialogs' option in the 


      Code: (Select All)
      Options
       menu.
    • The old dialogs may be removed in a future version.
  • #243 - The MinGW version on Windows was updated, it now provides gcc 12.2.0 - @a740g


New File Open Dialog!   YAY!!
Newest MinGW Compiler!  YAY!!
Bug Fixes!  YAY!!
Paint Expansion!  YAY!!
GUI Enhancements and Expansion!!  YAY!!

And it's all FREE!!  YAAAAAAAYYYY!!

What's not to love?  Hurry out and go grab your very own copy now, while unlimited supplies remain in time for the Holidays!  Release v3.4.1 · QB64-Phoenix-Edition/QB64pe (github.com) 

YAY!!  Big Grin

Print this item

  Meta Commands
Posted by: NasaCow - 11-16-2022, 03:41 AM - Forum: General Discussion - Replies (15)

Can meta commands such as option base 0 or 1 or option _explicit be set to only affect the main program and not the included libraries? If not, be a cool addition to the IDE instead of being forced to be using the defaults.

Print this item