Author Topic: #file alternative?  (Read 1514 times)

0 Members and 1 Guest are viewing this topic.

Frankolinox

  • Full Member
  • ***
  • Posts: 230
#file alternative?
« on: December 27, 2013, 04:58:08 AM »
lalala :)

.
« Last Edit: October 01, 2014, 08:44:26 AM by Frankolinox »

Peter

  • Full Member
  • ***
  • Posts: 161
Re: #file alternative?
« Reply #1 on: December 27, 2013, 07:16:45 AM »
Hi Frank,

Do you mean something like this ?
Code: [Select]
function simpletest(string filename ) as string
 
  #file "peter.exe" filename
 
  return filename
end function

string a
 simpletest ("test.txt")

print "test ends"

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4128
    • Oxygen Basic
Re: #file alternative?
« Reply #2 on: December 27, 2013, 08:14:11 AM »
#file "t.exe"
#file "t.dll"


These are directives to produce a PE binary, and normally go at the top of the program. A string literal or string constant can be used but not a string variable

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4128
    • Oxygen Basic
Re: #file alternative?
« Reply #3 on: December 30, 2013, 12:57:05 AM »
Hi Frank,

The RTLs were not designed to work as a DLL. They contain bootstrap code, required before any program can be executed.

Powrbasic's future is not secure at present, so I would advise caution before using it for any major new project.


Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4128
    • Oxygen Basic
Re: #file alternative?
« Reply #4 on: December 30, 2013, 09:03:20 AM »
#file (like #include) is an Oxygen directive to create a PE file, nothing to do with FreeBasic.

It has to be resolved at compile-time, variables only exist at run-time.