Wiki Diff Deprecated40, revision #1 to tip

== Deprecated Items in 4.0

=== Include Files

This may sound drastic, but **all** ##include/*.e## are deprecated. Version 4.0 comes with a newly organized standard library, which is located in ##include/std##. To use, you simply code:
This may sound drastic, but **all** ##include/*.e## are deprecated. With 4.0 comes a newly organized standard library that is located in ##include/std##. To use, you simply:

<eucode>
include std/sequence.e
include std/datetime.e
include std/map.e
include std/datetime.e as dt
include std/map.e as map
</eucode>

for example.

=== db_fatal_id
=== platform()

This was made available by database.e in order to set the fatal error handler. If well behaved, it should present user with the error message it received, clean up as much as possible, and then abort. But nothing was enforcing good behavior.

Old code:
Platform has not been deprecated however it's use will slowly dwindle as we have a better construct now that does platform checks as well as conditional compilation. ##ifdef## is superior to ##platform()##. An example replacement of ##platform()##:

<eucode>
procedure db_handler(sequence error_msg)
puts(2, error_msg)
flush(db_current())
close(db_current())
abort(1)
end procedure
include misc.e

db_fatal_id = routine_id("db_handler")
if platform() = LINUX then
puts(1, "Linux\n")
elsif platform() = WIN32 then
puts(1, "Windows\n")
elsif platform() = DOS32 then
puts(1, "DOS\n")
else
puts(1, "Unknown OS\n")
end if
</eucode>

New code:

<eucode>
procedure db_handler(sequence error_msg)
puts(2, error_msg)
flush(db_current())
close(db_current())
abort(1)
end procedure
include misc.e

include std/error.e
crash_routine(routine_id("db_handler"))
ifdef LINUX then
puts(1, "Linux\n")
elsifdef WIN32 then
puts(1, "Windows\n")
elsifdef DOS32 then
puts(1, "DOS\n")
else
puts(1, "Unknown OS\n")
end ifdef
</eucode>

For all the benefits of ##ifdef## please see the new [[http://openeuphoria.org/docs/|4.0 Manual]].




Search



Quick Links

User menu

Not signed in.

Misc Menu