Author Topic: Code C  (Read 4401 times)

0 Members and 1 Guest are viewing this topic.

Offline Ryster

  • Newbie
  • Posts: 77
    • View Profile
Code C
« on: March 12, 2019, 10:31:22 am »
Is the code translated into C language in: internal / temp / main?.

Regards

FellippeHeitor

  • Guest
Re: Code C
« Reply #1 on: March 12, 2019, 10:47:56 am »
Yes.

Offline Ryster

  • Newbie
  • Posts: 77
    • View Profile
Re: Code C
« Reply #2 on: March 12, 2019, 10:53:50 am »
Master, thank You very much.
Regards

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Code C
« Reply #3 on: March 12, 2019, 10:58:43 am »
Here's one I've been just curious about. Let's say I compile my program, go to that folder, get the main.txt file. Now if I were to open that up in a C studio, like Bloodshed, would it compile outside the QB64 environment?

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

FellippeHeitor

  • Guest
Re: Code C
« Reply #4 on: March 12, 2019, 11:02:20 am »
Not without some effort. Also check makeline.txt

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Code C
« Reply #5 on: March 12, 2019, 12:16:38 pm »
Glad I asked. I thought at some point I might want to revisit learning C/C++ and it would be neat to make a working program in QB64 and use the translated C code. It's kind of a shame, I guess probably because of work time, that Rob couldn't make it spit out a fully finished C/C++ program. Anyway, my instincts tell me it would take longer to try to figure out how to piece those parts together, without already knowing a lot of C/C++ than it would be to just learn C/C++ from the ground up. It isn't anything I am considering for now. As I said, just curious, but many thanks for clearing it up.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Code C
« Reply #6 on: March 12, 2019, 12:22:36 pm »
The place to start would be in the internal/c folder.  You’ll see a file there called (I don’t remember).cpp.  (It’s 3 letters; something like qbc.cpp and multiple copies will be qbc2.cpp or qbc3.cpp...). It’s what’s actually compiled with main.txt and the other files in the internal/temp folder included in it.

If you want to learn from the top/down, and not just look at the translated function calls and all, it’s the file you’d want to study first.  ;)


EDIT:  File is qbx.cpp or qbx2.cpp, depending on how many instances of the IDE you have open at the time.
« Last Edit: March 12, 2019, 12:25:04 pm by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Code C
« Reply #7 on: March 12, 2019, 12:35:49 pm »
Thanks. I remember that extension form C/C++ files I created in Bloodshed many moons ago. I have to say though, when I read through the code I get real turned off, fast. It probably has something to do with my absolute hatred of foreign languages. To me, BASIC is almost completely English, C is Greek... and FB is Polish. Hmm, now I miss my old Polish friend from high school. We'd go at each other with the Polish jokes vs Italian jokes all the time... before all this PC crap existed. Ah, the good ol' days.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: Code C
« Reply #8 on: March 12, 2019, 01:24:26 pm »
Everybody who wanna learn C/C++, this site is a great resource to do so:
http://www.cplusplus.com/doc/tutorial/
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Code C
« Reply #9 on: March 12, 2019, 02:18:06 pm »
Thanks for sharing that. I suppose if I were to dabble again, I'd get Eclipse or I guess Code:Blocks is still hanging in there. It bugs me that most people say get Visual Studios. I had it back in 2000, and I couldn't stand that piece of crap.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Ryster

  • Newbie
  • Posts: 77
    • View Profile
Re: Code C
« Reply #10 on: March 12, 2019, 02:47:34 pm »
It is not without reason that I asked where C is. Well, as part of the distribution of QB64, I sent a 64-bit version to a friend. The colleague claims that he does not create the main.txt file. Maybe someone knows what is causing this. Greetings

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Code C
« Reply #11 on: March 12, 2019, 03:09:45 pm »
You mean you sent him QB64, or a program written with QB64. I'm pretty sure you mean QB64, but just asking. I also don't know if all programs get a main.txt file created.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Ryster

  • Newbie
  • Posts: 77
    • View Profile
Re: Code C
« Reply #12 on: March 12, 2019, 03:32:29 pm »
And so: on my computer the file main.txt is created. However, there is no such file at a friend of this file. Of course it's about the 64-bit QB64. I have Win10 and my friend Win7. I think this is not the cause.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Code C
« Reply #13 on: March 12, 2019, 03:59:05 pm »
It may be write permissions.  Make certain he installed his version to its own directory (like C:\QB64) rather than in C:\Windows or C:\Program Files...

Second tip:  Make certain his antivirus isn’t quarantineing or deleting the file as fast as QB64 makes it.
« Last Edit: March 12, 2019, 04:00:18 pm by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!