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: 762
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,032
Fall Banner Contest?
Forum: Site Suggestions
Last Post: grymmjack
08-31-2023, 11:50 PM
» Replies: 36
» Views: 1,261
ColorPicker - Function th...
Forum: Dav
Last Post: Dav
08-31-2023, 11:04 PM
» Replies: 3
» Views: 315
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

 
  Option _Explicit Keyword(s) of day XXX:
Posted by: bplus - 06-04-2023, 04:29 PM - Forum: Keyword of the Day! - Replies (27)

This thread started so people can talk about Option _Explicit without hijacking other threads.

Use Option _Explicit in your code to save yourself from typos, probably the number one cause of grief to any coder on any level.

Yes it forces you to declare every variable you use. Yes Dimster that includes For ... Next index variables.

If declared variable is a Const, you don't have to DIM it, same goes for Static, same goes for ReDim (or should).

But there is an interesting by-pass, if I recall, stay tuned... Nope! the example I had in mind didn't work as I remembered.

Print this item

  Temporary Forum Oddities
Posted by: admin - 06-04-2023, 05:04 AM - Forum: Announcements - Replies (93)

As some of you guys may have noticed, grymm has been hard at work on adding some nice new features into the forums.  We now get reports of posts here over in the Discord channel, as well as being able to post better colored code inside custom codeboxes, while also adding much better QBJS support and capabilities.  Go grymm!!

Another thing you might notice is that not all of these features have trickled down to all the extra themes which we offer, and our banner/logo may have changed, or things may not be quite as centered as they once was...  These little quirks aren't any fault of grymmjacks; instead, they're an unfortunate side effect from us updating to forum software to the latest version available.  Some of our custom theme settings got tweaked back to the defaults, and it'll take us a little while to sort out which themes were affected and what might be off with them.

Feel free to post any issues/changes that you guys notice where one of the themes isn't acting quite like it used to, (and include a screenshot if possible, along with browser make and model and such), and we'll see about addressing any issues once we're aware of them...

Well, we'll address them tomorrow.  For tonight, I think we're all off to bed.  Uncentered banners/images aren't the end of the world, and neither are missing buttons or whatnot.  If you have issues and can't bare to wait for us to fix them, click back over to the "Default" them, as it appears to be working as advertised for now.  We'll let you guys know once everything else is 100% again, as soon as we get all the little reported issues sorted out again.  Smile

Print this item

Heart qb bbcode now available!
Posted by: grymmjack - 06-04-2023, 04:03 AM - Forum: Announcements - Replies (32)

You can now use [ q b ] code [ / q b ] to share QB64PE source code.

You can click the QB64 button in the toolbar to use the bbcode.

  1. CTRL-SHIFT-S to go into Source mode (optional but will maintain all white space!)
  2. Paste your code
  3. CTRL-A to select your code
  4. Click the QB64 button to wrap it in [ q b ][/ q b ]

We had to use this new bbcode because of the way the highlighter works. However, the colors match the QB64PE wiki export that was created by @RhoSigma Smile

Here is an example:

Code: (Select All)
$Debug
'$INCLUDE:'../include/QB64_GJ_LIB/_GJ_LIB.BI'
'$INCLUDE:'../include/Toolbox64/FileOps.bi'
'$INCLUDE:'../include/Toolbox64/ANSIPrint.bi'

CONST TRUE = -1, FALSE = NOT TRUE

DIM AS STRING BOARD_ANSI, BOARD_ANSI_NO_LABELS, BOARD_ANSI_LEVEL_SECTORS
BOARD_ANSI$ = LoadFileFromDisk$("../assets/ansi/board-132x50-no-secrets.ans")
BOARD_ANSI_LEVEL_SECTORS$ = LoadFileFromDisk$("../assets/ansi/board-132x50-no-secrets.ans")

DIM SHARED AS _UNSIGNED LONG YELLOW, BLACK, BROWN, BRIGHT_BLUE
YELLOW~& = _RGB32(&HFF, &HFF, &H55)
BLACK~& = _RGB32(&H00, &H00, &H00)
BROWN~& = _RGB32(&HAA, &H55, &H00)
BRIGHT_BLUE~& = _RGB32(&H55, &H55, &HFF)

DIM SHARED AS LONG CANVAS, CANVAS_COPY, LEVEL_SECTORS

CONST SW = 132 ' SCREEN WIDTH IN CHARACTERS
CONST SH = 51 ' SCREEN HEIGHT IN CHARACTERS + 1 MORE TO PREVENT SCOLLING OFF
CONST CW = 8 ' WIDTH OF 1 CHARACTER
CONST CH = 16 ' HEIGHT OF 1 CHARACTER

$RESIZE:ON
$RESIZE:STRETCH
CANVAS& = _NEWIMAGE(SW * CW, SH * CH, 32)
CANVAS_COPY& = _NEWIMAGE(SW * CW, SH * CH, 32)
LEVEL_SECTORS& = _NEWIMAGE(SW * CW, SH * CH, 32)
_FONT CH
_FULLSCREEN _SQUAREPIXELS, _SMOOTH

' clear canvas
SCREEN CANVAS&
_DEST CANVAS&
_SOURCE CANVAS&
CLS , BLACK~&
PrintANSI(BOARD_ANSI$)

' copy canvas to the copy
_DEST CANVAS_COPY&
CLS , BLACK~&
PrintANSI(BOARD_ANSI$)
_DEST CANVAS&

' load level sectors
_DEST LEVEL_SECTORS&
CLS , BLACK~&
PrintANSI(BOARD_ANSI_LEVEL_SECTORS$)
_DEST CANVAS&

TYPE SECTOR
start_x AS INTEGER
start_y AS INTEGER
end_x AS INTEGER
end_y AS INTEGER
w AS INTEGER
h AS INTEGER
kolor AS _UNSIGNED LONG
label AS STRING
END TYPE
DIM SHARED SECTORS(1 TO 9) AS SECTOR

TYPE CURSOR
x AS INTEGER
y AS INTEGER
prev_x AS INTEGER
prev_y AS INTEGER
cursor_color AS _UNSIGNED LONG
in_sector AS INTEGER
in_room AS INTEGER
on_path AS INTEGER
on_door AS INTEGER
on_secret_door AS INTEGER
END TYPE
DIM SHARED c AS CURSOR

' setup CURSOR
c.x% = 59*CW
c.y% = 24*CH
c.cursor_color~& = _RGB32(&HFF, &H00, &H00, &HAA)
c.prev_x% = c.x%
c.prev_y% = c.y%

' setup SECTORS
' LEVEL 1
SECTORS(1).kolor~& = _RGB32(&H55, &HFF, &H55) ' BRIGHT GREEN
SECTORS(1).label$ = "LEVEL 1 - MAIN GALLERY"
SECTORS(1).start_x% = 41
SECTORS(1).start_y% = 17
SECTORS(1).end_x% = 79
SECTORS(1).end_y% = 32
SECTORS(1).w% = SECTORS(1).end_x% - SECTORS(1).start_x%
SECTORS(1).h% = SECTORS(1).end_y% - SECTORS(1).start_y%

' LEVEL 2
SECTORS(2).kolor~& = _RGB32(&H00, &HAA, &H00) ' DARK GREEN
SECTORS(2).label$ = "LEVEL 2 - GUARD ROOM + KITCHEN"
SECTORS(2).start_x% = 1
SECTORS(2).start_y% = 17
SECTORS(2).end_x% = 40
SECTORS(2).end_y% = 33
SECTORS(2).w% = SECTORS(2).end_x% - SECTORS(2).start_x%
SECTORS(2).h% = SECTORS(2).end_y% - SECTORS(2).start_y%

' LEVEL 3
SECTORS(3).kolor~& = _RGB32(&HAA, &H00, &H00) ' DARK RED
SECTORS(3).label$ = "LEVEL 3 - ARMORY"
SECTORS(3).start_x% = 1
SECTORS(3).start_y% = 1
SECTORS(3).end_x% = 34
SECTORS(3).end_y% = 16
SECTORS(3).w% = SECTORS(3).end_x% - SECTORS(3).start_x%
SECTORS(3).h% = SECTORS(3).end_y% - SECTORS(3).start_y%

' LEVEL 4
SECTORS(4).kolor~& = _RGB32(&HFF, &H55, &H55) ' BRIGHT RED
SECTORS(4).label$ = "LEVEL 4 - STORE ROOM"
SECTORS(4).start_x% = 1
SECTORS(4).start_y% = 34
SECTORS(4).end_x% = 40
SECTORS(4).end_y% = 50
SECTORS(4).w% = SECTORS(4).end_x% - SECTORS(4).start_x%
SECTORS(4).h% = SECTORS(4).end_y% - SECTORS(4).start_y%

' LEVEL 5
SECTORS(5).kolor~& = _RGB32(&HFF, &H55, &HFF) ' BRIGHT PURPLE
SECTORS(5).label$ = "LEVEL 5 - TORTURE CHAMBER"
SECTORS(5).start_x% = 41
SECTORS(5).start_y% = 33
SECTORS(5).end_x% = 80
SECTORS(5).end_y% = 50
SECTORS(5).w% = SECTORS(5).end_x% - SECTORS(5).start_x%
SECTORS(5).h% = SECTORS(5).end_y% - SECTORS(5).start_y%

' LEVEL 6
SECTORS(6).kolor~& = _RGB32(&H00, &HAA, &HAA) ' DARK CYAN
SECTORS(6).label$ = "LEVEL 6 - KING'S QUARTERS"
SECTORS(6).start_x% = 80
SECTORS(6).start_y% = 17
SECTORS(6).end_x% = 117
SECTORS(6).end_y% = 32
SECTORS(6).w% = SECTORS(6).end_x% - SECTORS(6).start_x%
SECTORS(6).h% = SECTORS(6).end_y% - SECTORS(6).start_y%

' LEVEL 7
SECTORS(7).kolor~& = _RGB32(&H55, &HFF, &HFF) ' BRIGHT CYAN
SECTORS(7).label$ = "LEVEL 7 - WIZ'S QUARTERS"
SECTORS(7).start_x% = 79
SECTORS(7).start_y% = 1
SECTORS(7).end_x% = 117
SECTORS(7).end_y% = 16
SECTORS(7).w% = SECTORS(7).end_x% - SECTORS(7).start_x%
SECTORS(7).h% = SECTORS(7).end_y% - SECTORS(7).start_y%

' LEVEL 8
SECTORS(8).kolor~& = _RGB32(&H55, &H55, &H55) ' BRIGHT BLACK
SECTORS(8).label$ = "LEVEL 8 - QUEEN'S QUARTERS"
SECTORS(8).start_x% = 81
SECTORS(8).start_y% = 33
SECTORS(8).end_x% = 117
SECTORS(8).end_y% = 50
SECTORS(8).w% = SECTORS(8).end_x% - SECTORS(8).start_x%
SECTORS(8).h% = SECTORS(8).end_y% - SECTORS(8).start_y%

' LEVEL 9
SECTORS(9).kolor~& = _RGB32(&HAA, &H00, &HAA) ' DARK PURPLE
SECTORS(9).label$ = "LEVEL 9 - THE CRYPT"
SECTORS(9).start_x% = 35
SECTORS(9).start_y% = 1
SECTORS(9).end_x% = 78
SECTORS(9).end_y% = 16
SECTORS(9).w% = SECTORS(9).end_x% - SECTORS(9).start_x%
SECTORS(9).h% = SECTORS(9).end_y% - SECTORS(9).start_y%

' render initial labels for board
render_room_labels

' draw CURSOR one time to start
CURSOR.draw

' loop waiting for input to move CURSOR
DIM k AS STRING
DIM p AS INTEGER
DIM cur_sector AS INTEGER
DO:
_LIMIT 30
k$ = UCASE$(INKEY$)
IF k$ = "" THEN k$ = CHR$(0)
p% = INSTR("WASD", k$)
IF p% <> 0 THEN
CURSOR.move k$
END IF
CURSOR.update_state
_DISPLAY
LOOP UNTIL k$=CHR$(27)

_FULLSCREEN _OFF
SCREEN 0 : _DEST 0
_DELAY 1
_FREEIMAGE CANVAS&
_FREEIMAGE CANVAS_COPY&
_FREEIMAGE LEVEL_SECTORS&
SYSTEM


SUB CURSOR.move (k AS STRING)
c.prev_x% = c.x%
c.prev_y% = c.y%
IF k$ = "A" THEN c.x% = c.x% - CW
IF k$ = "D" THEN c.x% = c.x% + CW
IF k$ = "W" THEN c.y% = c.y% - CH
IF k$ = "S" THEN c.y% = c.y% + CH
CURSOR.keep_in_bounds
IF CURSOR.can_move = TRUE THEN
CURSOR.erase
CURSOR.draw
SOUND 350, 0.1
ELSE
c.x% = c.prev_x%
c.y% = c.prev_y%
SOUND 200, 0.1
END IF
END SUB


SUB CURSOR.keep_in_bounds
IF c.x% + CW > SW * CW THEN c.x% = SW-CW
IF c.y% + CH > SH * CH THEN c.y% = SH-CH
IF c.x% - CW < 0 THEN c.x% = 0
IF c.y% - CH < 0 THEN c.y% = 0
IF c.x% > SW * CW THEN c.x% = SW-CW
IF c.y% > SH * CH THEN c.y% = SH-CH
IF c.x% < 0 THEN c.x% = 0
IF c.y% < 0 THEN c.y% = 0
END SUB


SUB CURSOR.update_state
DIM AS LONG img_box
DIM cur_sector AS INTEGER
DIM in_sector AS SECTOR
DIM state AS STRING
state$ = ""
img_box& = _NEWIMAGE(CW, CH, 32)
_PUTIMAGE (0, 0)-(CW, CH), CANVAS_COPY&, img_box&, (c.x%, c.y%)-(c.x%+CW, c.y%+CH)
c.on_path% = is_path(img_box&)
c.in_room% = in_room(img_box&)
c.on_door% = is_door(img_box&)
c.on_secret_door% = is_secret_door(img_box&)
COLOR _RGB32(&HFF, &HFF, &HFF), _RGB32(&H00, &H00, &H00)
cur_sector% = SECTOR.get_by_xy(c.x%, c.y%)
in_sector = SECTORS(cur_sector%)
_PRINTSTRING(0, 50 * CH), "SECTOR(" + _TRIM$(STR$(cur_sector%)) + "): " + in_sector.label$
' show state
IF c.on_path% = TRUE THEN state$ = state$ + " ON PATH"
IF c.in_room% = TRUE THEN state$ = state$ + " IN ROOM"
IF c.on_door% = TRUE THEN state$ = state$ + " ON DOOR"
IF c.on_secret_door% = TRUE THEN state$ = state$ + " ON SECRET DOOR"
_PRINTSTRING(80 * CW, 50 * CH), " "
_PRINTSTRING(80 * CW, 50 * CH), state$
_FREEIMAGE img_box&
END SUB


FUNCTION CURSOR.can_move%
DIM AS LONG img_box
DIM AS INTEGER __on_path, __in_room, __on_door, __on_secret_door
img_box& = _NEWIMAGE(CW, CH, 32)
_PUTIMAGE (0, 0)-(CW, CH), CANVAS_COPY&, img_box&, (c.x%, c.y%)-(c.x%+CW, c.y%+CH)
__on_path% = is_path(img_box&)
__in_room% = in_room(img_box&)
__on_door% = is_door(img_box&)
__on_secret_door% = is_secret_door(img_box&)
_FREEIMAGE img_box&
CURSOR.can_move = __on_path% OR __in_room% OR __on_door% OR __on_secret_door%
END FUNCTION


SUB CURSOR.erase
_SOURCE CANVAS_COPY&
_DEST CANVAS&
_PUTIMAGE
_SOURCE CANVAS&
render_room_labels
END SUB


SUB CURSOR.draw
LINE (c.x%, c.y%)-(c.x%+CW-1, c.y%+CH-1), c.cursor_color~&, BF
END SUB


FUNCTION image_is_monochromatic% (img AS LONG, kolor AS _UNSIGNED LONG)
DIM AS INTEGER x, y, has_kolor
DIM AS _UNSIGNED LONG check_color
DIM AS LONG old_source
old_source& = _SOURCE
_SOURCE img&
FOR y% = 0 TO _HEIGHT(img&) - 1
FOR x% = 0 TO _WIDTH(img&) - 1
check_color~& = POINT(x%, y%)
IF (check_color~& <> kolor~&) THEN
_SOURCE old_source&
image_is_monochromatic = FALSE
EXIT FUNCTION
ELSE
IF check_color~& = kolor~& THEN has_kolor% = TRUE
END IF
NEXT x%
NEXT y%
_SOURCE old_source&
image_is_monochromatic = has_kolor%
END FUNCTION


FUNCTION image_is_diachromatic% (img AS LONG, kolor1 AS _UNSIGNED LONG, kolor2 AS _UNSIGNED LONG)
DIM AS INTEGER x, y, has_kolor1, has_kolor2
DIM AS _UNSIGNED LONG check_color
DIM AS LONG old_source
old_source& = _SOURCE
_SOURCE img&
FOR y% = 0 TO _HEIGHT(img&) - 1
FOR x% = 0 TO _WIDTH(img&) - 1
check_color~& = POINT(x%, y%)
IF (check_color~& <> kolor1~&) AND (check_color~& <> kolor2~&) THEN
_SOURCE old_source&
image_is_diachromatic = FALSE
EXIT FUNCTION
ELSE
IF check_color~& = kolor1~& THEN has_kolor1% = TRUE
IF check_color~& = kolor2~& THEN has_kolor2% = TRUE
END IF
NEXT x%
NEXT y%
_SOURCE old_source&
image_is_diachromatic = has_kolor1% AND has_kolor2%
END FUNCTION


FUNCTION is_path% (img AS LONG)
c.on_path% = image_is_monochromatic(img&, YELLOW~&)
is_path = c.on_path%
END FUNCTION

FUNCTION in_room% (img AS LONG)
DIM sector_color AS _UNSIGNED LONG
DIM sector AS INTEGER
sector% = SECTOR.get_by_xy(c.x%, c.y%)
sector_color~& = SECTORS(sector%).kolor~&
c.in_room% = ( _
image_is_diachromatic(img&, sector_color~&, BROWN~&) _
OR image_is_diachromatic(img&, sector_color~&, BRIGHT_BLUE~&) _
OR image_is_monochromatic(img&, sector_color~&) _
)
in_room = c.in_room%
END FUNCTION

FUNCTION is_door% (img AS LONG)
DIM AS INTEGER is_door_on_path, is_door_in_room, is_door_fullblock, sector
DIM sector_color AS _UNSIGNED LONG
sector% = SECTOR.get_by_xy(c.x%, c.y%)
sector_color~& = SECTORS(sector%).kolor~&
is_door_on_path% = image_is_diachromatic(img&, YELLOW~&, BROWN~&)
is_door_in_room% = image_is_diachromatic(img&, sector_color~&, BROWN~&)
is_door_fullblock% = image_is_monochromatic(img&, BROWN~&)
c.on_door% = is_door_on_path% OR is_door_in_room% OR is_door_fullblock%
is_door = c.on_door%
END FUNCTION


FUNCTION is_secret_door% (img AS LONG)
DIM AS INTEGER is_secret_door_on_path, is_secret_door_in_room, is_secret_door_fullblock, sector
DIM sector_color AS _UNSIGNED LONG
sector% = SECTOR.get_by_xy(c.x%, c.y%)
sector_color~& = SECTORS(sector%).kolor~&
is_secret_door_on_path% = image_is_diachromatic(img&, YELLOW~&, BRIGHT_BLUE~&)
is_secret_door_in_room% = image_is_diachromatic(img&, sector_color~&, BRIGHT_BLUE~&)
is_secret_door_fullblock% = image_is_monochromatic(img&, BRIGHT_BLUE~&)
c.on_secret_door% = is_secret_door_on_path% OR is_secret_door_in_room% OR is_secret_door_fullblock%
is_secret_door = c.on_secret_door%
END FUNCTION



SUB render_room_labels
DIM AS _UNSIGNED LONG fg_color_blue, fg_color_red
fg_color_blue~& = _RGB32(&H00, &H00, &HAA)
fg_color_red~& = _RGB32(&HFF, &H55, &H55)

COLOR fg_color_red~&, YELLOW~&
_PRINTSTRING(57*CW,23*CH), "START"

COLOR fg_color_blue~&, YELLOW~&

_PRINTSTRING(57*CW,25*CH), "MAIN"
_PRINTSTRING(56*CW,26*CH), "GALLERY"

_PRINTSTRING(14*CW,10*CH), "ARMORY"

_PRINTSTRING(47*CW,7*CH), "THE"
_PRINTSTRING(47*CW,8*CH), "CRYPT"

_PRINTSTRING(83*CW,9*CH), "WIZ'S"
_PRINTSTRING(84*CW,10*CH), "LAB"

_PRINTSTRING(93*CW,7*CH), "WIZ'S"
_PRINTSTRING(93*CW,8*CH), "TREASURE"

_PRINTSTRING(3*CW,26*CH), "KITCHEN"

_PRINTSTRING(18*CW,23*CH), "GUARD"
_PRINTSTRING(18*CW,24*CH), "ROOM"

_PRINTSTRING(18*CW,41*CH), "STORE"
_PRINTSTRING(18*CW,42*CH), "ROOM"

_PRINTSTRING(49*CW,39*CH), "TORTURE"
_PRINTSTRING(49*CW,40*CH), "CHAMBER"

_PRINTSTRING(88*CW,42*CH), "QUEEN'S"
_PRINTSTRING(88*CW,43*CH), "ANNEX"

_PRINTSTRING(87*CW,34*CH), "QUEEN'S"
_PRINTSTRING(87*CW,35*CH), "TREASURE"

_PRINTSTRING(90*CW,27*CH), "KING'S"
_PRINTSTRING(88*CW,28*CH), "LIBRARY"

_PRINTSTRING(104*CW,21*CH), "KING'S"
_PRINTSTRING(104*CW,22*CH), "TREASURE"
END SUB


' gets sector
FUNCTION SECTOR.get_by_xy% (x AS INTEGER, y AS INTEGER)
DIM i AS INTEGER
DIM s AS SECTOR
DIM AS INTEGER sx, ex, sy, ey
FOR i% = 1 TO 9
s = SECTORS(i%)
sx% = (s.start_x% - 1) * CW
ex% = (s.end_x% - 1) * CW
sy% = (s.start_y% - 1) * CH
ey% = (s.end_y% - 1) * CH
IF x% >= sx% AND x% <= ex% AND y% >= sy% AND y% <= ey% THEN
SECTOR.get_by_xy% = i%
EXIT FUNCTION
END IF
NEXT i%
SECTOR.get_by_xy% = 0
END FUNCTION


'$INCLUDE:'../include/QB64_GJ_LIB/_GJ_LIB.BM'
'$INCLUDE:'../include/Toolbox64/FileOps.bas'
'$INCLUDE:'../include/Toolbox64/ANSIPrint.bas'

Print this item

  QB64PE Programs being flagged as having trojans
Posted by: hanness - 06-04-2023, 02:30 AM - Forum: General Discussion - Replies (7)

I have multiple programs that I have written in QB64PE that get flagged by Windows Defender on Windows 11 as having trojan malware.

For now I've been setting exceptions in the antivirus software, but I'm wondering if there is any other kind of strategy to avoiding this in the future.

Print this item

  Does QB64pe already have a function like IFF ?
Posted by: CharlieJV - 06-03-2023, 07:40 PM - Forum: QBJS, BAM, and Other BASICs - Replies (19)

This is something I want in BAM.  If QB64pe already has a similar function with a different name, I'd set up BAM's IFF function with the same name.


Code: (Select All)
_GetUrlKey$ = IFF( step2%, LEFT$(step1$, step2% - 1 ), step1$)

Print this item

  Nothing to see here
Posted by: SMcNeill - 06-03-2023, 07:11 PM - Forum: General Discussion - Replies (4)

Just testing some junk with Discord.

Print this item

  QB64PE Discord Integration is now in place.
Posted by: grymmjack - 06-03-2023, 06:54 PM - Forum: Announcements - No Replies

We have implemented an integration between this forum and the QB64PE Discord.

This is a one way integration FROM the forum TO the Discord (trust us you want it this way!)

Thanks

Print this item

  Welcome grymmjack as Forum Guru!
Posted by: SMcNeill - 06-03-2023, 06:53 PM - Forum: General Discussion - Replies (12)

Everyone give a big hand of applause and many thanks to grymm for volunteering to step up and help with our server and forum maintenance and usability.  Pete was helping me with these things, but he's wandered off into the sunset after all the flooding his area of the world got since last December, and nobody's heard from him since.  (Let's all pray he's good and just dealing with insurance issues and such and simply hasn't felt like being indoors or programming for a while, and that nothing bad happened to him.)

Grymm's taken over handling our back-end server maintenance, and it's all thanks to him and @dbox that we can now embed QBJS in posts here and run those programs and examples.  He's currently at work on integrating our forum notifications so they appear in Discord for us, and who knows what improvements, optimizations, and fixes he'll bring in the future!  (After all, he's only been on the job for all of 2 days now, I think, and he's already finished the QBJS iFrame stuff!)

Any suggestions, issues, fixes, kindly @grymmjack with your concerns, and be certain to thank him for all his hard work and efforts.  Like everyone else who contributes to this project, grymm is doing so of his own free will and in his own free time, with no pay or reimbursement for his work.  Let him know if there's something he might can look into and help with, but as always -- be respectful and don't expect things to change instantly just cause someone reported something or requested something.  He's got a life, and he's got a right to live it first and foremost -- like any other dev here -- and even moreso, he now has admin rights and can ban those who are too pestersome for him....  

Wink

Print this item

Lightbulb qbjs evolving program #1
Posted by: grymmjack - 06-03-2023, 05:27 PM - Forum: QBJS, BAM, and Other BASICs - Replies (28)

On IRC back in the day, we used to play "neverending story".

How it worked:

The first person would provide a sentence or paragraph.

The next person picks up where that last person left off and continues.

e.g.:

First person: Once upon a time there was a pig that
Second person: had smelly breath and could talk like a human.

Story then is concatenated from that point:

"Once upon a time there was a pig that had smelly breath and could talk like a human."

... repeat ...

Let's try the same thing with qbjs!

The only change would be that you have to copy and paste the code from what you make into a new one in the qbjs.org site to get your version to persist for everyone. The other thing would be we should try to preserve what already is there, but extend on it. That is, don't do asshole things like in a SCREEN 0 text start thing, CLS the damned screen (be kind and have fun)?

Let's see what happens and where it goes.

@dbox you go first!

Print this item

Star qbjs bbcode now available!
Posted by: grymmjack - 06-03-2023, 02:55 PM - Forum: Announcements - Replies (11)

You can now use [qbjs] bbcode in your posts to embed qbjs.org code and play with it directly in the thread.

What is qbjs?
QBJS is an opensource project created by @dbox

QBJS is an implementation of the Basic programming language for the web, with multimedia support and easy sharing of programs. It aims to be compatible with QB64, which in turn implements the same dialect as the classic QBasic.

Support for browser APIs is built-in as of version 0.3.0-beta; a game engine is included separately.

Check it out on the qbjs GitHub

How do I use it?

  1. Go to https://qbjs.org
  2. Write some code
  3. Click the share button
  4. Copy the share link from the dialog to clipboard
  5. In forum use CTRL-SHIFT-S to switch to source mode (for whitespace preservation)
  6. Type: [qbjs]
  7. Paste from clipboard
  8. Type: [/qbjs]

Like this:

[Image: qbjs-share.png]


Anything you've made in qbjs.org IDE can be embedded in the new [qbjs] bbcode. You simply click the share button in qbjs.org, and copy the text and insert it between [qbjs] and [/qbjs] -- or you can just paste your share link from qbjs.org, select it, and click the QBJS button in the toolbar to wrap it in the new [qbjs] bbcode.

Here is an example:


(click the Play button to RUN it)

YOU CAN DO ALMOST ANYTHING YOU CAN DO IN QBASIC and QB64!
See: QBasic Language Support in QBJS
And: QBJS Supported Keywords (includes QBASIC and QB64, etc.)

Learn More:

Print this item