BBC BASIC for Windows
« copy right error ......LOL........:)............? »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:49pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: copy right error ......LOL........:)............?  (Read 622 times)
hitsware
Guest
xx copy right error ......LOL........:)............?
« Thread started on: Feb 2nd, 2010, 03:53am »

hMidiOut% +=0
ON CLOSE IF hMidiOut% SYS "midiOutClose", hMidiOut%
ON ERROR IF hMidiOut% SYS "midiOutClose", hMidiOut%
REPORT : END

User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: copy right error ......LOL........:).........
« Reply #1 on: Feb 2nd, 2010, 11:21am »

Code:
hMidiOut% +=0
ON CLOSE IF hMidiOut% SYS "midiOutClose", hMidiOut%
ON ERROR IF hMidiOut% SYS "midiOutClose", hMidiOut%
REPORT : END 

What is this code supposed to do? It appears to be gibberish!

Richard.
User IP Logged

hitswarecant register
Guest
xx Re: copy right error ......LOL........:).........
« Reply #2 on: Feb 2nd, 2010, 12:28pm »

on Feb 2nd, 2010, 11:21am, Richard Russell wrote:
Code:
hMidiOut% +=0
ON CLOSE IF hMidiOut% SYS "midiOutClose", hMidiOut%
ON ERROR IF hMidiOut% SYS "midiOutClose", hMidiOut%
REPORT : END 

What is this code supposed to do? It appears to be gibberish!

Richard.

ref : http://tech.groups.yahoo.com/group/bb4w/message/12429
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: copy right error ......LOL........:).........
« Reply #3 on: Feb 3rd, 2010, 08:16am »

Quote:
ref : http://tech.groups.yahoo.com/group/bb4w/message/12429

The code there seems to be quite different from the code you posted here, so I don't understand.

If you want some assistance please ask less cryptic questions!

Richard.
User IP Logged

hitswarecantregister
Guest
xx Re: copy right error ......LOL........:).........
« Reply #4 on: Feb 3rd, 2010, 09:59am »

To start midi I've been using:

hMidiOut% +=0
ON CLOSE IF hMidiOut% SYS "midiOutClose", hMidiOut%:END
SYS "midiOutOpen",^hMidiOut%,-1,0,0,0 TO ret%
IF ret% ERROR 100,"Failed to open MIDI output device"

Mike Hutton suggested:

ON CLOSE PROC_Cleanup: QUIT
ON ERROR PROC_Cleanup: REPORT : END
SYS "midiOutOpen",^hMidiOut%,-1,0,0,0 TO ret%
IF ret% ERROR 100,"Failed to open MIDI output device"
DEF PROC_Cleanup
hMidiOut% +=0 :IF hMidiOut% SYS "midiOutClose", hMidiOut%
ENDPROC

With my method (as Mike says) if you hit 'Escape', then
try to restart you get "failure to open MIDI" until you
close and then reopen the file.
I was trying to reduce Mike's method to as few lines as
possible (not use PROC).
Or any other real short method ?
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: copy right error ......LOL........:).........
« Reply #5 on: Feb 3rd, 2010, 11:34am »

Quote:
I was trying to reduce Mike's method to as few lines as possible (not use PROC).

What is your objection to using PROC? You won't get very far in BBC BASIC without using PROCs and FNs!

Any substitute for the PROC would involve code duplication (because PROC_Cleanup is called from two different places) and it's never a good idea to do that - it risks you modifying one but forgetting to modify the other if the code needs to be changed.

Also, if you don't use a PROC you can end up with code which you don't really want to see (because it's incidental to the main purpose of the program) cluttering up the listing and making it less readable. Better to move it to the end so it's not 'in your face'.

Another benefit of a PROC in this particular example is that, as your program gets more complicated, there may be many more things you need to do as part of your 'cleanup' on exit. In that case you just add them to PROC_Cleanup.

Richard.
User IP Logged

hitswarecantregister
Guest
xx Re: copy right error ......LOL........:).........
« Reply #6 on: Feb 3rd, 2010, 3:58pm »

>What is your objection to using PROC?

Just need to get used to it I guess.

http://home.comcast.net/~mnjmiller/midi_explore.bbc
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls