
! script name: events.d/stndevents
! topic: Sample - standard events

!A
!A NAME:
!A
!A 	STANDARD EVENTS
!A
!A DESCRIPTION:
!A
!A 	Standard events
!A
!B INSTRUCTIONS:
!B
!B 	NO HELP AVAILABLE AT THIS TIME
!B
!C NOTE:
!C
!C 	This is an unsupported sample script.
!C

stat=ChangeLabelStr("ScriptNameStatus","Function: read standard events ")

DIM Destination$[256]
DIM Answer$[256]
DIM Name$[128]
DIM File_name$[128]
DIM Dir$[128]
DIM Events$(20,2)[64] ! 1- Filename  2- Eventname

WsEventData= 12345

DeActivateUndo
Start:!

Stat= NamedVarStr("events dir",WsSystemVars,"/usr/weber/util/eventdata/events/",Dir$)
No_events= 2
Events$(1,1)="m00_stop"
Events$(1,2)="M00 Stop"
Events$(2,1)="man_codes"
Events$(2,2)="Manual Codes"

FOR I= 1 TO No_events

	Answer$=Events$(I,1)
	File_name$= FileNameString(Dir$,Answer$)

	Event=FindUserData(Events$(I,2),WsEventData)
	IF NOT ValidGeometry(Event) THEN
		Event=ReadUserData(WsEventData,"temp",File_name$)
		IF NOT ValidGeometry(Event) THEN End_event
	END IF
	Stat=GetUserString(Event,"Event name:",Name$)
	Stat=ChangeDataName(Event,Name$)

End_event:!
NEXT I

Leave:!
	 LOAD "typecontrol"
END
