Author Topic: oxymain() as long ?  (Read 2126 times)

0 Members and 1 Guest are viewing this topic.

Frankolinox

  • Guest
oxymain() as long ?
« on: March 30, 2013, 04:50:20 AM »
hi charles, hi all. I have a simple question about a general programming structure (architecture) of oxygen:

why does for example powerbasic needs a function (I suppose it's concerning entry point for code working, executing code and such things?) like

Code: [Select]
function pbmain() as long
'code goes here
end function

and such construct doesn't (need not) exist for oxygen and for freebasic (so far as I know)

Code: [Select]
function oxymain() as long
'code goes here, but you need to have this function for oxygen, but why? ;)
end function

can you tell more about oxygen why you don't need such fictive "oxymain() as long" for working? my silly thoughts were that it's ambivalent if you are using for a text string buffer (or file) for compiling to have a function pointer where to read all code infos. I don't know much about these things, therefore this little question. but I was wondering a lot of time while working between different basic languages (interpreter, compiler) they are using such an specific function (function *basic() as long.. end function).

what could be the benefit for such a function on oxygen, if there's a need for it (I don't think there is a need for it..) but only as an idea.. thanks in advance.

best regards, frank

Frankolinox

  • Guest
Re: oxymain() as long ?
« Reply #1 on: March 31, 2013, 06:27:17 AM »
no answer does it mean a) there was no time for a closer answer or b) it's a post for the dust bin because not very important to ask about it or c) you haven't understood what my intention was to ask  ;) ? (*smile*)

best regards, frank

Charles Pegge

  • Guest
Re: oxymain() as long ?
« Reply #2 on: March 31, 2013, 08:33:48 AM »
Hi Frank,

No, Oxygen does not require main or dllmain. You enter directly into global space. If you want to use main, it is easy to implement. You will just need to invoke it explicitly.

function main()
print "here"
end function

main


Happy Easter :)

Charles

Frankolinox

  • Guest
Re: oxymain() as long ?
« Reply #3 on: April 01, 2013, 08:24:08 AM »
yes, happy easter for you too :-)

a) here's very cold at the moment, I wandered with my doggy, girl friend (and my daughter!) and uncle fully two and a half hour through city and nature. that's strange easter party I cannot remember so far, without sitting outside with coffee, beer or icecream in the sun or there's a lot of people outside. Here in my hometown there's a special "fairy tale" party around the "brüder grimm märchen" and because of the cold wheather there's missing around one thousand people like the last years happened ;) but "only the hard ones can go to the garden" so we were drinking our first "hefeweizen beer" outside in a restaurant at the end!

b) thanks for your answer! it wasn't the reaction I wanted to have but my question was not clear to say, I am sorry.
once more: do you know why (for example) powerbasic needs this construct to use a

Code: [Select]
pbmain() as long
...
end function

and why oxygenbasic needn't such (silly? or uncomfortable? or unpractise) function?

thanks again

frank
« Last Edit: April 01, 2013, 08:37:59 AM by Frankolinox »

Charles Pegge

  • Guest
Re: oxymain() as long ?
« Reply #4 on: April 01, 2013, 01:17:01 PM »
Hi Frank,

Great! We had a good Easter gathering with friends too.

I don't know why PB requires a PBmain, or indeed, why there is a separate PB console-compiler. Like all compiled code, there is invisible house-keeping before and after the user code, but as far as the user is concerned, the program begins at the top of the page.