Author Topic: AllegroBASIC  (Read 15556 times)

ScriptBasic

  • Guest
Re: AllegroBASIC
« Reply #45 on: January 26, 2016, 09:53:07 pm »
IF MyBASIC is doing the calling to your Allegro library, maybe you should release those resources before dropping MyBASIC.

Code: [Select]
static void _on_exit(void) {

  remove_sound();
  allegro_exit();
  mb_close(&bas);
  mb_dispose();
}

wang renxin

  • Guest
Re: AllegroBASIC
« Reply #46 on: January 27, 2016, 02:11:22 am »
@Aurel, Yes it does.

@Markus, Need to know in which step it triggers a segementation fault.

@John, It's proper to drop MY-BASIC before releasing resource stuff, especially when using referenced usertype to hold resources. It disposes all referenced data in mb_close, thus the reference could be a wild reference if it has already released resources before closing MY-BASIC. Your way might work ok in AllegroBASIC, since it's using non-referenced usertype; but it's a hidden trouble.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: AllegroBASIC
« Reply #47 on: February 07, 2016, 09:47:15 pm »
A new version will be uploaded soon with some major changes.
1. I got rid of that console window - since Windows user don't get on with that. I implemented via the nice tinyfiledialogs an inputbox (see attached screenshots). All errors are now reported by a messagebox.
2. You can now close the Window with the 'X' button - but the BASIC programmer have to take care of it. A function which returns ture or false if the window was closed was implemented. (So there are no segmentation faults anymore ...)
Sample code:
Code: [Select]
screen (800,600,"CircleTrap")
KEY_ESC          = 59   
setfps (200)
h = screenheight/2
w = screenwidth/2
paper (0,0,0)
do

cls (x)

t = tickcount/1000
for i=1 to 360
    ink (255,255-i,255-i)
    circle (w+sin(i*90+t)*200,h+cos(i*90+t)*200,20+i)
next
sync

until (keystate (KEY_ESC) = true) or (windowclosed=true)
end

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: AllegroBASIC
« Reply #48 on: February 08, 2016, 06:58:55 pm »
Good news ... I just compiled AllegroBASIC on Windows 10 and it works now without setting the compatiblity mode. Just a few days for upload ...

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: AllegroBASIC
« Reply #49 on: February 10, 2016, 07:21:10 pm »
I also added a time function, stay tuned, download will be next weekend.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: AllegroBASIC
« Reply #50 on: February 28, 2016, 11:59:46 am »
Allright guys, version 0.6 of AllegroBASIC is available on the homepage: http://allegrobasic.pulsar2d.org/
What's new?
  • included the tinyfiledialogs libarary for error output
  • added messagebox and inputbox (to replace PRINT and INPUT since there's no console window anymore)
  • added a TIME function which returns the time in format HH:MM:SS as a string
  • added drawspritepart and drawimagepart which let you draw part of a bitmap
  • added fileexists function
  • new about dialog in TinyIDE

Galileo

  • Guest
Re: AllegroBASIC
« Reply #51 on: July 30, 2016, 11:30:42 am »
Hello, Cybermonkey. I'm sorry you do not feel continue programming (I hope it is temporary). In any case, I tried AllegroBASIC and I find very interesting. I would better know the dialect, but for that I need documentation on it. Could you wrote if only a cursory relationship command with a description of its functionality and a small example of use?

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: AllegroBASIC
« Reply #52 on: July 30, 2016, 04:14:45 pm »
Well, the best documentation is what you'll find on the Github page for MY-BASIC: https://github.com/paladin-t/my_basic
Apart from that I added some input, graphics and sound functions. For any of them there's an example. (Most interesting/comprehensive example is probably keyandsprite.bas.)