QB64 Phoenix Edition
Attach file - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11)
+--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2)
+---- Forum: Site Suggestions (https://qb64phoenix.com/forum/forumdisplay.php?fid=12)
+---- Thread: Attach file (/showthread.php?tid=1134)

Pages: 1 2


Attach file - PhilOfPerth - 11-17-2022

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


RE: Attach file - PhilOfPerth - 11-17-2022

From the info given on my other query, "open .bas files only", it seems that I don't need to use "Attach file" at all - they can be attached with the $include, is that correct? I'll have a look at that, thanks, @jack


RE: Attach file - Jack - 11-18-2022

I am not sure what you mean by Attach file and I can't think of a simple example to illustrate, let's say that you have some sub's and functions that you want to use in other programs, then you can put all those functions and sub's in a file with a .bm extension and if those functions need some type declarations or some shared variables you would put the declarations in a file with .bi extension, then to use your library you would do something like the following
Code: (Select All)
'$include: 'mylib.bi'
' your program here
'$include: 'mylib.bm'



RE: Attach file - PhilOfPerth - 11-18-2022

(11-18-2022, 12:40 AM)Jack Wrote: I am not sure what you mean by Attach file and I can't think of a simple example to illustrate, let's say that you have some sub's and functions that you want to use in other programs, then you can put all those functions and sub's in a file with a .bm extension and if those functions need some type declarations or some shared variables you would put the declarations in a file with .bi extension, then to use your library you would do something like the following
Code: (Select All)
'$include: 'mylib.bi'
' your program here
'$include: 'mylib.bm'
I was referring to attaching a file, such as a text file (in my case a word-list), and to do this using .bi and .bm seems like a bit of overkill. I just want the file to be available to the prog I attach it to. Isn't that what the field at the bottom of the screen is used for? It seems to do everything I need, but it's a bit "invisible" down at the bottom of the screen. Confused


RE: Attach file - mnrvovrfc - 11-18-2022

You could put your BASIC program and the text file (and others such as images and music) together into a single ZIP file which would then become the attachment to this forum. There's no other good way to combine BASIC code with a text file or with anything else which is not another source code file via "'$INCLUDE".

Where the attachment stuff is placed is the style of the forum, because the user would either have to create a file by dragon drop, or would like to see what he/she had given as attachments in the past. I agree that "Thread Subscription" is worthless for most users and should be allowed hidden, and a few other things below the text entry field so that it's easier to access the attachment stuff without having to scroll down a lot.


RE: Attach file - Jack - 11-18-2022

I think that I have seen a way to attach binary data to an executable, was it PureBasic?
you could make those text files as data statements and include them or instead of data statements assignments to an array


RE: Attach file - SMcNeill - 11-18-2022

(11-18-2022, 01:51 PM)Jack Wrote: I think that I have seen a way to attach binary data to an executable, was it PureBasic?
you could make those text files as data statements and include them or instead of data statements assignments to an array

Just copy it to the end of the executable.  It's probably the simplest and easiest way.  Wink


RE: Attach file - PhilOfPerth - 11-19-2022

A bit impractical when the data is the whole of the Collins dictionary, but.


RE: Attach file - SpriggsySpriggs - 11-22-2022

Could probably do something with the resource file and have it embed that information to be called back later.


RE: Attach file - bplus - 11-22-2022

I think PhilOfPerth is talking about attaching a file here in a reply.

Minerva's advice is best IMHO, seek wisdom and understanding Smile

I think Phil has it figured out see here: https://qb64phoenix.com/forum/showthread.php?tid=1160&pid=10376#pid10376

File properly attached!