Oxygen Basic

Programming => Problems & Solutions => Topic started by: Frankolinox on December 27, 2013, 04:58:08 AM

Title: #file alternative?
Post by: Frankolinox on December 27, 2013, 04:58:08 AM
lalala :)

.
Title: Re: #file alternative?
Post by: Peter 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"
Title: Re: #file alternative?
Post by: Charles Pegge 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
Title: Re: #file alternative?
Post by: Charles Pegge 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.

Title: Re: #file alternative?
Post by: Charles Pegge 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.