Recent posts

#1
OxygenBasic Examples / Re: Function question
Last post by Frank Brübach - Today at 01:00:29 AM
Yes, thanks charles :) I have explored some Infos more... And I understand more about this Special topic..

"In PowerBASIC, the pbmain() function is a  special function that serves as the entry point for the program.
When you run a PowerBASIC program, the pbmain() function is automatically called by the PowerBASIC runtime, so you don't
need to call it explicitly in your code."

I am not quite sure but found an old simple example of a PowerBASIC program that demonstrates how The pbmain() function and the PowerBASIC runtime library work together:

#Include "PbWin90.inc"

Function pbMain() As Long

  MessageBox 0, "Hello, World!", "PowerBASIC Example", MB_OK

  EndFunction
#2
OxygenBasic Examples / Re: Function question
Last post by Charles Pegge - Yesterday at 11:37:08 PM
All functions are designed to be called. In PB there is invisible code calling pbmain(). (OxygenBasic does not require a main function.)
#3
OxygenBasic Examples / Re: Function question
Last post by Frank Brübach - Yesterday at 11:14:18 PM
Yes thanks..  I know already recursive function as Well but my question was more directed into this direction what happened If you dont call in your example the rf(20) ?

I tried to understand how does a function Like pbmain() Works without calling it itself at the end?

I think its Not possible but I can See it must Run ;)
#4
PowerBasic Adventures / Re: Power Basic forum maybe go...
Last post by Charles Pegge - Yesterday at 11:03:10 PM
I wonder if we will ever see it released as open source? Preserved for posterity and potentially resurrected by AI in 64bit form.
#5
OxygenBasic Examples / Re: Function question
Last post by Charles Pegge - Yesterday at 10:49:01 PM
If you mean recursion, yes. the function does not have to be declared first. But you have to make sure it stops calling itself before causing a stack overflow.

Example of simple direct recursion:
uses console
function rf(int i)
if i>0  'limit recursion
  print i tab i*i cr
  rf(i-1) 'recurse
endif
end function
rf 20
wait
#6
Code to share / Re: Example Intro and HalProm...
Last post by Frank Brübach - Yesterday at 10:43:14 PM
@karen

PS a guide doesn't exist yet at this Moment .. its a Hobby Project and If there's more time I will build such a Help File..

#7
Code to share / Re: Example Intro and HalProm...
Last post by Frank Brübach - Yesterday at 10:28:33 PM
Hello Karen :)

Its Not such a big step a Lot of commands and Syntax are equal to Powerbasic and freebasic.

The Name of my Compiler is "halProment Basic" , the Ide calls halPromide24.

You can Download the *.rar File some Posts before (post #48) there are a Lot of examples for Testing .. you can create Exe File too with Last update4 and there is a 64bit DLL too..

You will find a similar Powerbasic example too in my example folder ;)

All Work in Progress. If you have more questions please ask Here. Its all in Beta Version, but advanced..

Thanks, Frank
PS you can Download via GitHub Last Update 4 too
#8
OxygenBasic Examples / Function question
Last post by Frank Brübach - Yesterday at 10:19:58 PM
Hi Charles,

I have a General question if its possible with oxygen to call a function itself without calling it separately and extra as usual ? Dont using an include File?



'#include "testme.inc" '' with using an include file it's not a problem here

FUNCTION mytest() AS LONG
    local t as long
    LOCAL a,b,c AS LONG
    a=20
    b=50
    c=a*b
    print "calculation test "+ str(c)  ' result 1000
   
    ''' it's possible to call mytest() itself inner function?
    'if not t then
    'call mytest()
    'end if
    ''' it's possible to call mytest() itself inner function?

END FUNCTION

mytest() ' all ok that's the usual way to call a function

''
''mytest() ' if it's deactivated it's not possible to call mytest() function
''           or it's another way possible perhaps with asm?
#9
PowerBasic Adventures / Re: Power Basic forum maybe go...
Last post by Karen Zibowski - Yesterday at 10:13:20 PM
It was already dead many moons ago!
#10
Code to share / Re: Example Intro and HalProm...
Last post by Karen Zibowski - Yesterday at 10:10:02 PM
Hi Frank

What are the challenges to convert from PB to FrankBasic ?  Do you have a guide to convert from Powerbasic
to FrankBasic ?

Does FrankBasic has an IDE ?

Thank you
Regards
Karen