Author Topic: Help on Help  (Read 2637 times)

0 Members and 1 Guest are viewing this topic.

Offline Nicola_Piano

  • Full Member
  • ***
  • Posts: 111
  • User-Rate: +0/-0
Help on Help
« on: December 12, 2021, 11:57:55 PM »
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.

Offline Zlatko Vid

  • Sr. Member
  • ****
  • Posts: 298
  • User-Rate: +2/-2
Re: Help on Help
« Reply #1 on: December 13, 2021, 06:52:11 AM »
It looks to me like assembler functions
i never use them.

Offline Nicola_Piano

  • Full Member
  • ***
  • Posts: 111
  • User-Rate: +0/-0
Re: Help on Help
« Reply #2 on: December 20, 2021, 10:25:01 AM »
I think so too. If Charles told us their use we could add them to the help.

Offline Chris Chancellor

  • Sr. Member
  • ****
  • Posts: 354
  • User-Rate: +0/-0
Re: Help on Help
« Reply #3 on: December 24, 2021, 04:58:52 PM »
Hello Charles
Can you guard us on this issue?
Thanxx a lot

Offline Nicola_Piano

  • Full Member
  • ***
  • Posts: 111
  • User-Rate: +0/-0
Re: Help on Help
« Reply #4 on: December 24, 2021, 10:59:00 PM »
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.
« Last Edit: February 02, 2022, 10:37:20 PM by Nicola_Piano »

Offline Zlatko Vid

  • Sr. Member
  • ****
  • Posts: 298
  • User-Rate: +2/-2
Re: Help on Help
« Reply #5 on: December 25, 2021, 09:50:11 AM »
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 :

Code: [Select]
'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

Offline Zlatko Vid

  • Sr. Member
  • ****
  • Posts: 298
  • User-Rate: +2/-2
Re: Help on Help
« Reply #6 on: December 25, 2021, 10:25:46 AM »
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..

Offline Nicola_Piano

  • Full Member
  • ***
  • Posts: 111
  • User-Rate: +0/-0
Re: Help on Help
« Reply #7 on: December 25, 2021, 12:58:02 PM »
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 ...
« Last Edit: December 25, 2021, 02:04:36 PM by Nicola_Piano »

Offline Zlatko Vid

  • Sr. Member
  • ****
  • Posts: 298
  • User-Rate: +2/-2
Re: Help on Help
« Reply #8 on: December 25, 2021, 05:18:43 PM »
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 ?
« Last Edit: December 25, 2021, 05:22:40 PM by Zlatko Vid »

Offline Nicola_Piano

  • Full Member
  • ***
  • Posts: 111
  • User-Rate: +0/-0
Re: Help on Help
« Reply #9 on: December 25, 2021, 11:34:37 PM »
yes thanks,
I'd like to try the program you posted.

Offline Zlatko Vid

  • Sr. Member
  • ****
  • Posts: 298
  • User-Rate: +2/-2
Re: Help on Help
« Reply #10 on: December 26, 2021, 08:16:51 AM »
OK
code you have above
in attachment are sw.inc and sw.dll

Offline Nicola_Piano

  • Full Member
  • ***
  • Posts: 111
  • User-Rate: +0/-0
Re: Help on Help
« Reply #11 on: December 26, 2021, 11:25:59 PM »
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

Offline Zlatko Vid

  • Sr. Member
  • ****
  • Posts: 298
  • User-Rate: +2/-2
Re: Help on Help
« Reply #12 on: December 27, 2021, 10:26:08 AM »
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

Offline Nicola_Piano

  • Full Member
  • ***
  • Posts: 111
  • User-Rate: +0/-0
Re: Help on Help
« Reply #13 on: December 27, 2021, 11:43:33 AM »
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?
« Last Edit: December 27, 2021, 11:48:13 AM by Nicola_Piano »

Offline Nicola_Piano

  • Full Member
  • ***
  • Posts: 111
  • User-Rate: +0/-0
Re: Help on Help
« Reply #14 on: December 27, 2021, 12:43:45 PM »
On the other hand, I managed to adapt this other program (PONG) quite easily.
This runs quietly ...

Code: [Select]
'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 ... :)
« Last Edit: December 27, 2021, 01:27:03 PM by Nicola_Piano »