Thank you very much guys, having found QB64 and this community/forum gladdened me, bigtime, for two days I feel as if being in happy old times.
My passion is text processing of huge English text, searching, decompressing, indexing them in order to ease quick n-gram requests i.e. to have spell-checkers, and ... phrase-checkers of English texts under the fingers.
C and QB64 are so instrumental in that regard, eager to pursue this dream of mine...
@SMcNeillThank you Steve, not only for you suggestion (which prompted me to revise my first pseudo-buggy attempt) but for useful sharings of yours. Showing different scenarios being handled is the best way to help others, such snippets/etudes are instrumental for sure.
The idea is to write a simplistic viewer working with the "heap" by using the QB64's memaloc()-like new functions instead of array of NON-FIXED length strings. Wanna try how the scroller behaves with 1GB file text loaded in RAM.
Your MEMUSAGE tool is cool, MUCH NEEDED, accessing Windows APIs has to be explored as you did (I have no experience in using APIs), some functionality has to be "stolen" from DLLs, wanna write first that exact viewer...
Welcome aboard, @Sanmayce! Cool to see you're already getting it going with several modern keywords as well! Looking forward to your future contributions.
Thank you man! Surely in future will share all my code along with my feedback.
Fellippe, I bend a knee before you. resurrecting QB is just awesome! Many beers I owe you.
As far as I recall, only said this once back, to another developer - a true master of coding compression in C.
Really enliked your presentation about 'InForm', please consider doing such reviews more often, at least not stopping them:
https://www.youtube.com/watch?v=S3D4zEUQ0sQ&list=PLD7-OthpyuXNbrB12Cl5_3vBpRtvN7CA8&index=5Nice work with this Form Designer, wanna try it after some weeks, my tempo is slow but ongoing, a real fan here, that is.
My expertise is amateurish, I have been playing with search algorithms, and Windows (as far as Form Designer goes) not wanting to go into C++ and APIs, just played for a month or so with VisualStudio (ATL project) in order to make my GUI shell for invoking my console executables written in C. Just assigned some SHELL _HIDE like instance behind each button. The result:
www.sanmayce.com/Downloads/_GW_(Bare-Minimum_2018-Mar-16).zipIt looks very nice on Windows XP, and so ugly with the new Windows 7+ schemes, therefore for more than 3 years I abandoned it, shame.
[ Invalid Attachment ]
[ Invalid Attachment ]
[ Invalid Attachment ]
Similar thing is what I want to write with QB64 - a simplistic text editor sensitive to all my textual processing tools - my textual madness is deep and constant, my wish is in the near future to have phrase sensitive functionality (giving statistics about English language n-grams generated by external tools) while hovering over this text window, both with cursor and mouse.
Simply, I am hell bent on making and sharing one 100% FREE lightweight (and thanks to QB64 portability) text assistant/sidekick/application in the near future.
Want to ask for possible way to load our own bitmap (from DOS times) fonts, saw that '_FONT 16' is default for SCREEN 0, if there is a way to load those fonts will bring additional retro flavor as they were very nice, sharing them, to take a look if interested:
@Sanmayce
Welcome. I like GUI the stuff, too. I've got a project I'm working on currently, posted over at the QBasic forum. Since you're an old-timer, do you remember that forum? Network54 used to host it. Now it's on Tapatalk. Mallord was the first admin, followed by Mac, and Mac turned it over to me, when he passed away in 2008. Anyway, I'm just curious if you recall it, or Pete's QBasic forum, or any of the others back in the day.
Pete
Thanks, will share some GUI of mine in the future, my Gallowwalker GUI, in the meantime you are welcome to see some of its functionality at:
https://github.com/Sanmayce/1gram/issues/1As for the old forum, no, was not active in Internet for a long time, haven't seen it. Otherwise, I am a chatterbox :P
The idea is to have the first English Phrase-Checker - checking all n-grams (phrases of n words) of your text (the loaded into this QB64 assistant) against mega corpora of English n-grams, hundreds of millions strong!
@Sanmayce welcome! I did not know or see demo of _ACCEPTFILEDROP, thanks! Hopefully we can drop in more than one file eventually.
Thank you,
@bplus, I myself am uncovering new things on a daily basis, so many gaps ate there in my know-how.
Did a minor tweak (pseudo-bug fixage), rather add-on, now one can use the left button and "jump" on the desired line, along with scrolling with keys and the wheel:
' DragDropWheelScroller.bas
' written in QB64 v1.4 by Kaze, 2021-Jan-21
' Thanks go to the www.qb64.org/forum members for sharing useful excerpts/etudes
XdimCOL = 100
YdimROW = 44 ' ensure old laptops with 768pixels vertical will hold the whole window
IF high&
> 1000 THEN YdimROW
= 60
'_FONT 16 'wish we could use the old 8x16 bitmap/raster fonts from DOS times...
' Either one must be uncommented:
'_AUTODISPLAY 'no need of refreshing
'Y = CSRLIN 'save the row
'X = POS(0) 'save the column
filecount% = 0
REDIM FileArray$
(1000000) 'create dynamic array: 3880000 alocates 532MB - bigger values need 570+MB and give "Out Of Memory"
FileArray$(i) = ""
PRINT "Drag files from a folder and drop them in this window..." 'REDIM FileArray$(filecount%)
'pressakey$ = INPUT$(1)
a$ = ""
'FOR i = 1 TO _TOTALDROPPEDFILES
'a$ = _DROPPEDFILE(i)
'NEXT'
_FINISHDROP 'If _FINISHDROP isn't called here then _TOTALDROPPEDFILES never gets reset. 'ELSE
'a$ = "Scroller.$$$"
'SHELL _HIDE "DIR /B *.* > Scroller.$$$"
LINE INPUT #1, filename$
'read entire text file line filecount% = filecount% + 1
FileArray$(filecount%) = filename$
'PRINT "Printing filenames in current directory... ";: PRINT LTRIM$(STR$(filecount%))
FOR i
= 1 TO YdimROW
'filecount% FileArray$
(i
) = MID$(FileArray$
(i
), 1, XdimCOL
) FileArray$
(i
) = FileArray$
(i
) + SPACE$(XdimCOL
- LEN(FileArray$
(i
)))
crxOLD = crx
cryOLD = cry
'LOCATE cry, crx, 1, 30, 31
'DO: a$ = INKEY$: LOOP UNTIL a$ <> "" ' prevent ASC empty string read error
IF code%
THEN ' ASC returns any value greater than 0 CASE 80:
IF cry
< YdimROW
THEN cry
= cry
+ 1 'down CASE 77:
IF crx
< XdimCOL
THEN crx
= crx
+ 1 'right 'LOCATE cryOLD, crx, 1, 30, 31: COLOR 3, 0: PRINT FileArray$(cryOLD);
PRINT FileArray$
(cryOLD
);
cryOLD = cry
ELSE 'it 'cry' could be changed by Mouse Wheel too, check it IF cry
< YdimROW
THEN cry
= cry
+ 1 'down IF cry
> 1 THEN cry
= cry
- 1 'up 'Kinda trump the arrows and wheel with MOUSEmovement i.e. us having both the inverse(selected) line plus darklighting the current(under the mouse pointer) one
'dummy me, the 2021-Jan-20 was not smoot friendly, should have updated here (not in the loop afterwards) i.e. _DISPLY shows two inversed lines, ugh [
'LOCATE cryOLD, crx, 1, 30, 31: COLOR 3, 0: PRINT FileArray$(cryOLD);
PRINT FileArray$
(cryOLD
);
cryOLD = cry
'dummy me, the 2021-Jan-20 was not smoot friendly, should have updated here (not in the loop afterwards) i.e. _DISPLY shows two inversed lines, ugh ]
'LOCATE cry, crx, 1, 30, 31: COLOR 0, 3: PRINT FileArray$(cry);
'DO WHILE INKEY$ <> "": LOOP ' have to clear the keyboard buffer
'_LIMIT 30 'commented because the wheel up/down was not working?!
Kinda want to revive the DOS functionality of my old QB project: