Author Topic: Importing C Code into QB64?  (Read 3881 times)

0 Members and 1 Guest are viewing this topic.

Offline rcamp48

  • Newbie
  • Posts: 62
    • View Profile
Importing C Code into QB64?
« on: October 05, 2020, 03:32:11 pm »
How do I go about importing C code into a program of mine in QB64 32 bit edition? I want to import a block of C Code , and don't have any idea how to do this, can anyone help me with this?

Russ

Transfolio.c is what I want to import,  the code I want to import it to (at the end of my program) is transfolioshell.bas

« Last Edit: October 05, 2020, 03:34:52 pm by rcamp48 »
Russ Campbell
rcamp48@rogers.com
BBS Files Programmer

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Importing C Code into QB64?
« Reply #1 on: October 05, 2020, 05:56:26 pm »
You can't.
Granted after becoming radioactive I only have a half-life!

Offline +KZ

  • Newbie
  • Posts: 21
  • an ugly avatar :)
    • View Profile
Re: Importing C Code into QB64?
« Reply #2 on: October 05, 2020, 08:55:00 pm »
I knew that you can include .h files, the bad thing is that I don't know how
google translate :0

Offline Galleon

  • QB64 Developer
  • Newbie
  • Posts: 25
    • View Profile
Re: Importing C Code into QB64?
« Reply #3 on: October 06, 2020, 02:06:39 am »
Including/calling C code is fairly easy (see screenshot).
Converting C code to native QB64 code may or may not be possible depending on the nature of the C code, however it will almost certainly involve manual processes specific to the code being converted.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Importing C Code into QB64?
« Reply #4 on: October 06, 2020, 12:38:32 pm »
But you can't just plop the C code into your source. Which is what I thought the original question was.
Granted after becoming radioactive I only have a half-life!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Importing C Code into QB64?
« Reply #5 on: October 07, 2020, 04:50:57 am »
@rcamp48
be careful because your C program included has using an external DLL, so surely you must have also that DLL to get working C program.

About the C program it accesses to parallel port to I/O.. I think that this can be made also by QB64 code if you know How C program manage that port.


@Galleon
Hy Master

about
Quote
Including/calling C code is fairly easy (see screenshot).
Converting C code to native QB64 code may or may not be possible depending on the nature of the C code, however it will almost certainly involve manual processes specific to the code being converted.
Can C code do anything ( also the old 16/32bit work that are emulated into QB64) ? Or just plain 32/64bit work ?

Thanks for feedback

Programming isn't difficult, only it's  consuming time and coffee