many forms of labels

David Sugar <[email protected]>
Newsgroups gmane.comp.gnu.bayonne.devel
Organization GNU Telephony
Message-ID <[email protected]>
At one time we had a lot of forms of duplicitive synonyms and ways of 
setting labels.  There was the ::xxx method.  There were "proc(edure)" 
and "service", and there was private and public.  There may have been a 
few others!  On the 1.0 ccscript3 I did purge all but the most logical 
ones.  Hence:

private	xxx
	label local to a script

public xxx
	label globally accessable from any script using yyy::xxx form

program xxx
	label globally accessible, with options, special use case.  With
	"program main" being the primary special use.

function xxx
	parametric function, globally callable from any script, called
	from call statement

local xxx
	same as function, but only accessible from the same script file
	commonly used to build local macros

I am hoping that is all the special label cases that now exist in 
ccscript3 1.0.

Calling labels:

	goto
		to goto a public or private label, can set vars...

	call
		to call a function, creates new stack context

	source
		to call a label using current stack context, kind of
		a subroutine call but uses same local vars...

	gosub
		to use a public or private label and create an entirely 			new base 
context

	return
		returns from a source, call, or gosub

golfong woo wrote:
> It can not work.
> starting 0.3.1 on x86 w32; timeslots=32
> soundcard/0: session starting
> soundcard/0: state=initial, event=100, seq=0
> soundcard/0: state=idle, event=100, seq=0
> binding ivrscript...
> compiled mytest::start; 2 steps
> compiled mytest::done; 1 steps
> compiled mytest; 2 steps
> C:\Program Filessoundcard msgport starting
> \GNU Telephony\Bayonne IVRScript1: directory missing
> 1 applications compiled
> driver(s) started; 1 timeslot(s) used
> soundcard/0: state=idle, event=105, seq=1
> soundcard/0: state=pickup, event=100, seq=1
> soundcard/0: state=pickup, event=400, seq=2
> soundcard/0: state=run, event=100, seq=2
> soundcard/0: mytest.scr(2): script start access
> soundcard/0: state=hangup, event=100, seq=2
> soundcard/0: state=hangup, event=400, seq=3
> soundcard/0: state=idle, event=100, seq=3
> 
> 2005/11/1, David Sugar <[email protected]>:
> 
>>In ccscript3, you no longer have labels done this way.  Instead, consider:
>>
>># some initialization stuff, occurs before any script starts...
>>set %myvar "1"
>>
>># main is the default entry point.
>>
>>program main
>>        sleep 60
>>        goto start
>>
>>proc start
>>        echo "i'm in start, myvar = %myvar"
>>        goto done
>>
>>proc done
>>        echo "i'm in done"
>>        exit
>>
>>You can have a script without a main, but then it starts from the top,
>>as in:
>>
>>        set %myvar "1"
>>        goto start
>>
>>proc start
>>        echo "started myvar = " %myvar
>>        goto done
>>
>>proc done
>>        echo "im done"
>>        exit
>>
>>golfong woo wrote:
>>
>>>Bayonne2-1.1.0 is working now. But when using label, it can not work well.
>>>Here is the script:
>>>::start
>>>sleep 60
>>>hangup
>>>exit
>>>
>>>^hangup
>>>      slog "^hangup"
>>>      exit
>>>
>>>^1
>>>      slog "^1"
>>>      goto ::start
>>>
>>>Here is the console info:
>>>starting 0.3.1 on x86 w32; timeslots=32
>>>soundcard/0: session starting
>>>soundcard/0: state=initial, event=100, seq=0
>>>soundcard/0: state=idle, event=100, seq=0
>>>binding ivrscript...
>>>compiled mytest; 6 steps
>>>C:\Program Files\GNU Telephony\Bayonne IVRScrisoundcard msgport starting
>>>pt1: directory missing
>>>1 applications compiled
>>>driver(s) started; 1 timeslot(s) used
>>>soundcard/0: state=idle, event=105, seq=1
>>>soundcard/0: state=pickup, event=100, seq=1
>>>soundcard/0: state=pickup, event=400, seq=2
>>>soundcard/0: state=run, event=100, seq=2
>>>soundcard/0: mytest.scr(1): script start missing
>>>soundcard/0: state=sleep, event=100, seq=2
>>>soundcard/0: state=sleep, event=709, seq=3
>>>soundcard/0: state=run, event=100, seq=3
>>>soundcard/0: ^1
>>>soundcard/0: state=run, event=400, seq=4
>>>soundcard/0: ^hangup
>>>soundcard/0: state=hangup, event=100, seq=4
>>>soundcard/0: state=hangup, event=400, seq=5
>>>soundcard/0: state=idle, event=100, seq=5
>>>
>>>
>>>_______________________________________________
>>>Bayonne-devel mailing list
>>>[email protected]
>>>http://lists.gnu.org/mailman/listinfo/bayonne-devel
>>
>>
>>

_______________________________________________
Bayonne-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bayonne-devel
dyfet.vcf (text/x-vcard, 212 B)
begin:vcard
fn:David Sugar
n:Sugar;David
org:GNU Telephony
adr:;;;;;;USA
email;internet:[email protected]
tel;work:+1 201 215 2609
x-mozilla-html:FALSE
url:http://www.gnutelephony.org
version:2.1
end:vcard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.