Recent posts

#1
Code to share / Re: Reducing a Text
Last post by Frank Brübach - Today at 07:24:10 PM
Array Reducing a Text for a String

' array reducing text for a string
'
pindex 0

Dim txt() as zstring = "Hello World " + Chr(0)
dim i as integer
 
For i = 0 to Len(txt)-2 ''Len(txt)-1 if pindex is not active
   
    p? txt(i) + Chr(txt(i))
Next

' output: hello world ello world llo world lo world o world
' output: world orld rld ld d 
#2
Code to share / Re: Powerbasic Looks a Like ex...
Last post by Frank Brübach - Today at 05:44:46 PM
Powerbasic Looks a Like example with inc File

A new Update you can find below with all examples for Testing

If you have question about halProment or the halPromide24 (IDE) please ask :)

Regards, Frank

' poba looks like calculation, halProment, 2-6-24
'
''#COMPILE EXE
#DIMALL

include once "poba.inc"

FUNCTION PBMAIN() AS LONG
    LOCAL a,b,c AS LONG
    a=20
    b=40
    c=a*b
    MSGBOX "calculation test: "+str(c)  ' result 800
END FUNCTION

Include File
'
'poba.inc
'
'-------------- //
def msgbox mbox

pro a
if not a then
call pbmain()
end if
#3
Code to share / Re: Byte Array
Last post by Frank Brübach - Today at 05:41:53 PM
A Byte Array examples

' -- byte array example
'
pim strsrc as pstring
strsrc = "Hello, Animal World!"

Dim byteArray() as byte at strptr(strsrc)

  pim i,j as pro
  pim s,t as pstring
  j=1
  s=space 600
  for i=1 to 20
    t=chr(9)+str(byteArray[i]) ":  " + chr(byteArray[i])
    mid (s,j)=t
    j+=len t
  next

  p? left s,j

#4
Code to share / Re: cByte
Last post by Frank Brübach - Today at 05:39:24 PM
CByte example for riunding Numbers and Auto converting Strings

' -> cbyte example, rounded numbers or converting strings
' halProment
'
'dim cb as cbyte

cbyte cb
cb=45.2 ' 45
print cb

cb=72.6
print cb ' 73

cb="-72"
print cb ' -72

cb="-122.5"
print cb ' -123

cb=255
print cb '-1

cb=260
print cb '4

#5
Code to share / Re: EXE File create
Last post by Frank Brübach - Today at 05:36:17 PM
Hello all.. much more to come with a new Update with my Last Post later

How to create an EXE File?

' --> atestcalc 2 example
' --> create an Exe file with halProment
' --> menu/compile/Run compiling 32 bit
'
#fily "atestcal.exe"

dim s,st as string
dim a,b,c,d,e as long
a=10
b=20
c=30
d=a*b
e=d*c

s= "hello batman " + str(d)
st= "hello superman " + str(e)

print s ' result 200
print st ' result 6000

'-------------------------- //
'
pstring s1,st1
pro a,b,c,d,e ' pim as a,b,c,d,e as long
a=10
b=20
c=30
d=a*b
e=d*c

s1 = "hello batman1 " + str(d)
st1= "hello superman1 " + str(e)

print s1 ' result 200
print st1 ' result 6000
#6
I believe chatbots understand part of what they say. Let me explain.

Sabine Hossenfelder
11 mar 2023


#7
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
#8
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.)
#9
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 ;)
#10
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.