
-----------------------------------
Clayton
Wed Apr 26, 2006 8:32 pm

processes in classes?
-----------------------------------
is it possible to have a process in a class that you can call (or in a module for that matter) for a music player that i am working on?(im being asked to do it OOT)

-----------------------------------
Tony
Wed Apr 26, 2006 10:40 pm


-----------------------------------
I think you're looking for Music.PlayFileReturn

-----------------------------------
[Gandalf]
Thu Apr 27, 2006 12:07 am


-----------------------------------
And to answer your question, yes, it is possible to have a proccess, procedure, function, type, variable, or basically anything else inside a class.

-----------------------------------
Clayton
Thu Apr 27, 2006 12:58 pm


-----------------------------------
so would you do something like this

class Play
export play_from_cd
process play_from_cd
end play_from_cd
end Play

var p:^Play
new Play,p

fork Play(p).play_from_cd


-----------------------------------
Tony
Thu Apr 27, 2006 1:14 pm


-----------------------------------
no, because that code doesn't work.. have you tried?

I'd do something like

class Play
    export play_from_cd

    process play_process
        for i : 1 .. num_tracks
            Music.PlayFile (filename (i))
        end for
    end play_process

    procedure play_from_cd
        put "lets play"
        fork play_process
    end play_from_cd
end Play

var p : ^Play
new Play, p

p -> play_from_cd


it appears that you can call only procedures and functions, not processes. Though you could create an internal function that would call a process on user's behalf.

-----------------------------------
codemage
Thu Apr 27, 2006 1:24 pm


-----------------------------------
It's possible to use a process to do that, but it's also possible to feed yourself by placing a chocolate bar between your buttocks and ramming it home with a broomstick.

I don't highly recommend either though.

-----------------------------------
md
Thu Apr 27, 2006 2:25 pm


-----------------------------------
Using processes in classes is not possible. Using processes is not possible. There is no such thing as processes. 

Really, unless you are _complete_ comfortable with the rest of the entire language, and with threading models, and many many other ideas, processes are not something you should even be thinking about.

-----------------------------------
Clayton
Thu Apr 27, 2006 4:09 pm


-----------------------------------
ok thanks tony that was i kinda obvious thing to do (just didnt try it lol)

-----------------------------------
Martin
Thu Apr 27, 2006 11:57 pm


-----------------------------------
It's possible to use a process to do that, but it's also possible to feed yourself by placing a chocolate bar between your buttocks and ramming it home with a broomstick.

I don't highly recommend either though.

"Windows is easier than Linux, in the same way that crapping your pants is easier than going to the washroom." ;)

-----------------------------------
codemage
Fri Apr 28, 2006 8:45 am


-----------------------------------
That's a good one.   :o
