• Welcome to Jose's Read Only Forum 2023.
 

Help on Help

Started by Nicola_Piano, December 12, 2021, 11:57:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nicola_Piano

Hello.
I was using oxygen help and noticed some pages are missing. In particular I did not find:
CALL, JMP, RET, #RETURN, YVAL.

Is there any information on these functions?
Thank you.

Zlatko Vid

It looks to me like assembler functions
i never use them.

Nicola_Piano

I think so too. If Charles told us their use we could add them to the help.

Chris Chancellor

Hello Charles
Can you guard us on this issue?
Thanxx a lot

Nicola_Piano

#4
Hi,
I am making this change to the help.
What do you think?
Cheers


13-01-2022 new version with new additions. I started writing on the CONSOLE.
25-01-2022 new version with best index.
02-02-2022 improvements on content and visuals.

Zlatko Vid

first
Merry Christmas

I am not sure how this Help really can Help
if user don't know how things work in OxygenBasic..
I am user long time (almost from beginining) but i still learn some
things testing old programs or looking into examples in this case i look into old
Peter Wirbelauer sw.inc app called deep

and yes ..for example JMP is similar like GOTO ( means JUMP ) ..loook into code :

'example deep - using sw.dll  by peter wirbelauer version A41
include "sw.inc"

window 800,600,1
setFps (16)
'test jmp / comment| uncomment next line
JMP the_end
string salt = "INTO THE DEEP"
single a,cx,cy,i,w,h,y
sys tcolor
w=800/2 : h=600/2
p = len(salt)

while key(27)=0
cls rgb(0,0,0)
for i=1,360
cx = w+sin(i-a)*i
cy = h+cos(i-a)*i
tcolor= rgb( i-105, i-105, 0)
'! FillCircle     Lib "sw.dll" (sys xpos,ypos,r1,color) as sys
fillcircle cx-20,cy+70,2*a ,tcolor
cx = w+sin(i+a)*i
cy = h+cos(i+a)*i
'color i-105, 0, i-105
tcolor = rgb(i-105, 0, i-105)
fillcircle cx-20,cy+70,3*a,tcolor
cx = w+sin(i-a)*i
cy = h+cos(i-a)*i
tcolor  = rgb(i-105, i, i-105)
fillcircle cx-20,cy+70,4*a, tcolor
cx = w+sin(i+a)*i
cy = h+cos(i+a)*i
tcolor = rgb(i, i-105, i-200)
fillcircle cx-20,cy+70,2*a, tcolor
a = a + 0.1
if a>=8 then a = -a
next
for s=1 to p
    'color 255,255,255
    text 900,200+s*20,20,mid(salt,s,1)
next
sync()
wend
'winEnd

'jump to labele here:
the_end:
print "test JMP ...THE END"


so program simply jump over code to label the_end

Zlatko Vid

the above program looks (see attachment)

according to help

do you know what this means ?

while key(27)=0

that means while loop running until key ESC is not pressed
simple ..? or is not ?
this is just one really simple question..right?
few years back i was tried to write some sort of help but that is a huge work
it is the best to learn from examples..test it ..modify it .
i know that would be great to have one big help file but oxygen basic
examples use different libs to make programs ..there is not standard GUI wrapper or gfx layer for
programs there are sdl,mine awinh,peter window,sw  Charles coreWin ..etc etc..

Nicola_Piano

#7
Aurel, I agree.
Here is the importance of the forum. Through the things we write and ask and answer we help ourselves to understand.
It is also interesting the things you wrote about the various "inc".

However I saw that sw.inc is in project C and it is for scriptbasic ... and the sw.dll is not there ...

Zlatko Vid

#8
I just checked C projects folder
and i am surprised why is this sw.inc there
but what I see ..it is not original sw.inc by Peter Wirbelauer
and why would be in scriptbasic folder .

And also i think that any connection with scriptBasic should be removed from
OxygenBasic files , simply because there is no any benefit using this files .
The similar opinion i have about Thinbasic files, o2 should be more for oriented to himself.

if you wish i can post sw.inc and sw.dll i have on my computer ?

Nicola_Piano

yes thanks,
I'd like to try the program you posted.

Zlatko Vid

OK
code you have above
in attachment are sw.inc and sw.dll

Nicola_Piano

Thanks Aurel.
Unfortunately I am unable to run the program.
He opens the window but says that the program is not responding and shows nothing.
I tried to compile it, but when I start the compiled program it doesn't find the dll. What directory should I put it in when I want to use the compiled program?

I tried JMP ... as you said it works the same way as goto ...

Hello

Zlatko Vid

must be all in one folder

deep.o2bas
sw.inc
sw.dll
oxygen.dll


program is JIT compiled in memory so require oxygen.dll
that is a main rule

Nicola_Piano

#13
Hi Aurel,
thanks for the tips.
However, unfortunately I was unable to run the program. If I compile it in 64-bit it always looks for the sw.dll, if I compile it in 32 the program "does not respond", if I simply do F5 the same program "does not respond" ...  the pc i use has the win10 64bit

I also tried on another 32bit laptop with win10 and even there the program "does not respond" ...

Where am I wrong?

Nicola_Piano

#14
On the other hand, I managed to adapt this other program (PONG) quite easily.
This runs quietly ...


'ScriptBasic PONG by Peter Wirbelauer
'adapted to O2 by NP

'INCLUDE "sbsw.inc"
INCLUDE "sw.inc"

Window 320, 240, 1
SetCaption "OxygenBasic Pong"

SetFPS 60

sys x = 50, y = 50, x2 = 130, y2 = 150, pspeed = 4, xadj = 2, yadj = 2
sys delay = 1, score = 0

sys haha = loadwav("wav/haha.wav"), pong = loadwav("wav/pong.wav")

WHILE Key(27) = 0
  Cls RGB(200, 200, 247)
  FillCircle x, y, 8, RGB(0, 0, 255)
  FillBox x2, y2, 30, 4, RGB(255, 255, 255)
  'Box 20, 20, 280, 160, 4, RGB(255, 255, 0)
  Box 20, 20, 280, 160, RGB(255, 255, 0)
  Text 10, 0, "SCORE:" & score, RGB(255, 0, 0)
  IF y <= 20 THEN
    yadj = 1
    PlayWav pong
  END IF
  IF y >= 180 THEN
    yadj = -1
    PlayWav pong
  END IF
  IF x >= 290 THEN
    xadj = -1
    PlayWav pong
  END IF
  IF x <= 20 THEN
    xadj = 1
    PlayWav pong
  END IF
  IF Key(37) AND x2 > 18 THEN x2 = x2 - pspeed
  IF Key(39) AND x2 < 270 THEN x2 = x2 + pspeed
  x += xadj
  y += yadj
  IF y > y2 - 7 AND y2 < y2 + 2 AND x < x2 + 30 AND x > x2 THEN
    yadj = -1
    score += 1
  END IF
  IF y > y2 + 10 THEN
    Text 100, 200, "GAME OVER!", RGB(0, 160, 55)
    Playwav haha
    Waitkey
    score = 0
    x = 50
    y = 50
    x2 = 130
    y2 = 150
  END IF
  Sync
WEND
CloseWindow



... however this dll is really nice in its simplicity and versatility ... :)