Author Topic: Output EXE to Source Folder  (Read 4400 times)

0 Members and 1 Guest are viewing this topic.

Offline NYYRIKKI

  • Newbie
  • Posts: 3
    • View Profile
Output EXE to Source Folder
« on: April 27, 2021, 12:39:27 pm »
Hi,

Can someone help me? I have two questions about QB64:

1) I have selected "Output EXE to Source Folder", but I still can't use RUN/Start (F5) as then my _STARTDIR$ is all wrong. What am I doing wrong? Am I using wrong function to find my other files? Should I be parsing COMMAND$(0) instead or...

2) Is there a build in way to output variable size string to COM-port without sending out the string size? It seems that I can do this ok to file, but on COM-port there are always these two extra size bytes in front... With fixed size strings I don't seem to have this problem.

I am using 64bit version of QB64 1.4 on Windows 10
Thank you.

Offline zaadstra

  • Newbie
  • Posts: 78
    • View Profile
Re: Output EXE to Source Folder
« Reply #1 on: April 27, 2021, 12:48:26 pm »
Hi & Welcome here!

Where did you save your .bas file?  As far as I know that's considered source folder.
I usually start with a .bas file somewhere in some editor, and then drag it onto QB64 (shortcur on desktop).
The exe is always created in the floler where the .bas is, and when running that is the startdir. That said, I usually doubleclick the generated .exe.

The COM question is out of my league but someone else wil kick in ;-)

Offline NYYRIKKI

  • Newbie
  • Posts: 3
    • View Profile
Re: Output EXE to Source Folder
« Reply #2 on: April 27, 2021, 01:11:33 pm »
Thank you.

Yes, the problem is not with the EXE-file... That is created to correct folder, but if I ie. use $EXEICON in my source then the parameter file is not fetched from the source folder... I did try also creating a shortcut of BQ64 and then editing the "Start in" of the shortcut, but this did not change anything, so the problem still remains.

~NYYRIKKI

Offline zaadstra

  • Newbie
  • Posts: 78
    • View Profile
Re: Output EXE to Source Folder
« Reply #3 on: April 27, 2021, 03:50:57 pm »
I think it's best to enter full path for the icon:

$EXEICON:'D:\Bas\Double\icons\double32f.ico'

Of course then it can be anywhere... My program dir here is Double.

Offline NYYRIKKI

  • Newbie
  • Posts: 3
    • View Profile
Re: Output EXE to Source Folder
« Reply #4 on: April 28, 2021, 12:48:38 am »
Yes... The thing is just that if I'm ever going to release the source of the tool I'm making, these kind of things lurking in there are quite a bombs...

Offline 191Brian

  • Newbie
  • Posts: 91
    • View Profile
    • My Itch page
Re: Output EXE to Source Folder
« Reply #5 on: April 28, 2021, 03:35:40 am »
Re com might help if you could share a snippet of your code. If you print to com it adds LF CR characters.
Brian ...

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Output EXE to Source Folder
« Reply #6 on: April 28, 2021, 04:38:36 am »
Re com might help if you could share a snippet of your code. If you print to com it adds LF CR characters.

It’s not CRLF characters.  Variable length strings print 2-bytes for size, then the string.

OPEN “com1” FOR OUTPUT AS #1
PRINT #1, “foo”
PRINT #1, “bar”
PRINT #1, “foo” + CHR$(13) + CHR$(10) + “bar”

Now, without knowing the size, how could you read those 3 batches of data and know how to delimitate them?

Fixed length data is simple — you know how many bytes to expect to send and receive, but how do you separate variable length data?  How would you know that’s not a single line of data like PRINT #1, “foobarfoo” + CHR$(13) + CHR$(10) + “bar”?

BASIC sends string size (as a 2-byte integer) and then the string, when using PRINT with variable-length strings.

If you just want to send raw data, use GET/PUT instead.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Output EXE to Source Folder
« Reply #7 on: April 28, 2021, 04:07:15 pm »
I think it's best to enter full path for the icon:

$EXEICON:'D:\Bas\Double\icons\double32f.ico'

Of course then it can be anywhere... My program dir here is Double.

Yeah but how will you know the full path of where the user is going to put the file?

Instruct user to put file in same place exe will go and then use Command$(0) to get full path of exe so file should be in same folder.

FellippeHeitor

  • Guest
Re: Output EXE to Source Folder
« Reply #8 on: April 28, 2021, 04:09:07 pm »
Isn't $EXEICON:'./filename.ico' cutting it?

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Output EXE to Source Folder
« Reply #9 on: April 28, 2021, 04:16:14 pm »
It didn't work for me on MasterGy's 4D maze, early version before he switched to 2nd thread.

Offline zaadstra

  • Newbie
  • Posts: 78
    • View Profile
Re: Output EXE to Source Folder
« Reply #10 on: April 28, 2021, 04:17:31 pm »
Yes... The thing is just that if I'm ever going to release the source of the tool I'm making, these kind of things lurking in there are quite a bombs...

Once compiled the program does not need the icon file and path anymore, it's inside the exe! :-)

FellippeHeitor

  • Guest
Re: Output EXE to Source Folder
« Reply #11 on: April 28, 2021, 04:19:41 pm »
I probably missed the issue at hand then. I'll let you guys carry on 😂

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Output EXE to Source Folder
« Reply #12 on: April 28, 2021, 09:08:52 pm »
I probably missed the issue at hand then. I'll let you guys carry on 😂

I think the issue is that $EXEICON doesn’t work from the output exe directory.

For example, say you have the following folders:

C:\QB64\
C:\BAS FILES\

Now, put a bas file and icon in the BAS FILES folder.  Open QB64.  Compile.   $EXEICON looks in the C:\QB64 folder for your icon, rather than the C:\BAS FILES folder.

You might tick Output EXE to Source Folder, but it doesn’t seem like $EXEICON works from source folder.

....at least, that’s how I’m reading the issue.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Output EXE to Source Folder
« Reply #13 on: April 28, 2021, 10:38:36 pm »
Isn't $EXEICON:'./filename.ico' cutting it?

Apologies to @FellippeHeitor the thing I was MIS-remembering was this:
https://www.qb64.org/forum/index.php?topic=3770.msg131317#msg131317

when the ./ did fix the problem.

FellippeHeitor

  • Guest
Re: Output EXE to Source Folder
« Reply #14 on: April 29, 2021, 09:04:26 am »
Nothing to apologize for. I'm glad it's not an issue after all.