Useful Functions and procedures...
Author |
Message |
Homer_simpson

|
Posted: Thu May 08, 2003 8:28 pm Post subject: Useful Functions and procedures... |
|
|
Ok all the programming masters submit your useful procedures and functions here.....
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Homer_simpson

|
Posted: Thu May 08, 2003 8:38 pm Post subject: (No subject) |
|
|
Homer's first function submittion:
Ever wanted to have one command delayed in a loop and not stop other commands from running here's the function u need
code: | function timedelay (var r : int, t : int) : boolean
var tt : int
clock (tt)
if r = 0 then
clock(r)
result false
end if
if tt - r >= t then
r := tt
result true
else
result false
end if
end timedelay |
and here's an example of it in use
code: | View.Set ("offscreenonly")
var time1, i, r : int := 0
loop
if timedelay (time1, 1000) then
i += 1
% the rest of program is going on while the commands in this loop only work once every second
end if
r += 10
drawfillarc (320, 200, 150, 150, r, r + 10, 9)
locate (1, 1)
put i, " seconds"
View.Update
cls
end loop
|
|
|
|
|
|
 |
Catalyst

|
Posted: Thu May 08, 2003 9:28 pm Post subject: (No subject) |
|
|
i hav a library i compiled of useful fucntion/procs a while ago so i wouldnt have to hunt for them (note: not all are made by me)
Ive got this posted in submissions since there is no attachments in source
MOD EDIT: I attached the file, and I'm see if I can let users attach files over here - Tony
Description: |
Catalyst's function library |
|
 Download |
Filename: |
turinglib.t |
Filesize: |
7.91 KB |
Downloaded: |
732 Time(s) |
|
|
|
|
|
 |
Homer_simpson

|
Posted: Thu May 08, 2003 9:36 pm Post subject: (No subject) |
|
|
wow cool functions but why didn't u send them here as an attachment?
|
|
|
|
|
 |
Catalyst

|
Posted: Thu May 08, 2003 9:38 pm Post subject: (No subject) |
|
|
doesnt let you put attachments in source/tutorials
|
|
|
|
|
 |
Homer_simpson

|
Posted: Thu May 08, 2003 10:16 pm Post subject: (No subject) |
|
|
Doh!!! i am so very stupid... =(
Thx tony...
|
|
|
|
|
 |
|
|