I have a public variable define in my start program that is used to identify the user in the system. When I run a call to a program from a screen it loses the value but when the program returns to the screen the value is repopulated.
This is the code that calls the program:
This is the program code:
The public variable lost is gcUser. It is lost as soon as the control transfers into the program. When the program completes and returns to the screen the value is back. Anyone have any ideas on why this would happen?
Mark Davies
Warwickshire County Council
This is the code that calls the program:
Code:
DO dorscoursequeue_insert WITH ;
"0", ;
THISFORM.cCourseref, ;
CTOT(ALLTRIM(DTOC(TTOD(coursedate)))+ " " + ALLTRIM(coursetime) + ":00"), ;
lcinstructsurname, ;
lcinstructfirstnames, ;
venuecap, ;
dorssiteid, ;
lnforcecontractid, ;
{}, ;
1, ;
" ", ;
gcUser, ;
{}, ;
"A", ;
THISFORM.cCourseref
This is the program code:
Code:
LPARAMETERS ;
tccourseid, ;
tccoursetitle, ;
tccoursedatetime, ;
tcsurname, ;
tcfirstnames, ;
tncapacity, ;
tndorssiteid, ;
tnforcecontractid, ;
tddummy1, ;
tnsequence, ;
tciscurrent, ;
tcupuser, ;
tddummy2, ;
tcoperation, ;
tcwcccourseid
* Create Insert Statement
lcsql = "INSERT INTO DorsCourseQueue ("
lcsql =lcsql + "CourseID, "
lcsql =lcsql + "CourseTitle, "
lcsql =lcsql + "CourseDateTime, "
lcsql =lcsql + "TutorForename, "
lcsql =lcsql + "TutorSurname, "
lcsql =lcsql + "CourseCapacity, "
lcsql =lcsql + "SiteID,"
lcsql =lcsql + "ForceContractID, "
lcsql =lcsql + "QueueTime, "
lcsql =lcsql + "Operation, "
lcsql =lcsql + "WccCourseID, "
lcsql =lcsql + "Updated, "
lcsql =lcsql + "Sequence, "
lcsql =lcsql + "IsCurrent, "
lcsql =lcsql + "UpUser) "
lcsql =lcsql + "VALUES ("
lcsql =lcsql + "'" + tccourseid + ", "
lcsql =lcsql + "'" + tccoursetitle + "', "
lcsql =lcsql + sqldate(tccoursedatetime) + ", "
lcsql =lcsql + "'" + tcfirstnames + "', "
lcsql =lcsql + "'" + tcsurname + "', "
lcsql =lcsql + "'" + ALLTRIM(STR(tncapacity)) + "', "
lcsql =lcsql + "'" + ALLTRIM(STR(tndorssiteid)) + "', "
lcsql =lcsql + "'" + ALLTRIM(STR(tnforcecontractid)) + "', "
lcsql =lcsql + " getdate(), "
lcsql =lcsql + "'" + tcoperation + "', "
lcsql =lcsql + "'" + tcwcccourseid + "', "
lcsql =lcsql + "getdate(), "
lcsql =lcsql + "'" + ALLTRIM(STR(tnsequence)) + "', "
lcsql =lcsql + "'" + tciscurrent + "', "
lcsql =lcsql + "'" + tcupuser + "')"
IF odata.sql_exec(lcsql) <> .T.
CREATEOBJECT("uError", PROGRAM(), LINENO(), gcUser, lcsql, gcUnique )
RETURN .F.
ENDIF
The public variable lost is gcUser. It is lost as soon as the control transfers into the program. When the program completes and returns to the screen the value is back. Anyone have any ideas on why this would happen?
Mark Davies
Warwickshire County Council