Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The QB64 full screen editor
#1
This attachment is the full screen editor for QB64:

Is a small editor in basic.

Some places from QB45 were edited for:

  Dir$ - _fileexists
  Redim preserve.

Adds _controlchr

Adds ListFiles and SearchFiles.

Erik.


Attached Files
.bas   SCRNEDIT.BAS (Size: 81.59 KB / Downloads: 41)
Reply
#2
Thank you for this. It works on Linux almost without changing anything, and in 64-bit.

The thing is I'm very lame about typing in full paths and I don't often have text files needed to be edited in the same directory as the executable. So I added to it to use "FileSelect$()" function which is documented here:

https://qb64phoenix.com/forum/showthread.php?tid=264

How I added to it is easy, but if a few people request it then I could post it.

Alternatively, I could have supported a special entry for input filename so it pastes from the clipboard. However, getting a full path into the clipboard could be troublesome on Linux for some reason...
Reply
#3
If you liked that then here is a code snippet which displays a filelist with date/time/filesize.

It uses FindFirst/FindNext/FindClose library function calls..


Attached Files
.bas   FINDDATA.BAS (Size: 14.54 KB / Downloads: 73)
Reply
#4
I noticed in your "FINDDATA.BAS" file that you've also declared "FindFirstFileW" and "FindNextFileW". Were you planning on making a version that would enable usage of unicode (wide) strings?

Side note: You should change your declarations from UNSIGNED OFFSET to just OFFSET as an invalid handle return in Win32 API is a -1 but since you are currently casting them to UNSIGNED, you won't notice the failure unless you cast them back to a signed OFFSET. This would be your "FindFirstFileA/W" and "FindNextFileA/W" declarations. Typically, you'd only ever use an UNSIGNED OFFSET for a wParam in Win32.
I'd still change the UNSIGNED OFFSETs to OFFSET just for matching of the data types but it does look like INVALID_HANDLE_VALUE will be caught just fine.
Tread on those who tread on you

Reply
#5
I have used wide Unicode filenames once in a Rename function, but all I can say is it is not easy.

Noted the _unsigned declare might be a bug in
  Dim Shared hfind As _Unsigned _Offset

For an example in Unicode find attached a Rename function..

The Unicode extends ASCIIZ from 260 to 520 chars. Each Unicode is 2-byte pairs which is 256^2 or 65536 possible symbols.

Nameit2 is VBdos (no unicode)
Nameit is QB64 (has unicode)


Attached Files
.bas   NAMEIT.BAS (Size: 29.54 KB / Downloads: 61)
.doc   NAMEIT.DOC (Size: 2.23 KB / Downloads: 63)
.bas   nameit2.bas (Size: 13.79 KB / Downloads: 53)
.doc   nameit2.doc (Size: 1.56 KB / Downloads: 59)
Reply
#6
I've also used Unicode before with my Win32 video player. Like you say, it is not easy. It is also not fun!
Tread on those who tread on you

Reply
#7
What a wonderful community: helpful and full of imagination!
Here it is like the top hat from which the magician always pulls out some rabbit suddenly! Such a very nice thing.

Basically there is only to do some changes to manage accents and special characters.
Reply




Users browsing this thread: 1 Guest(s)