Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
event inq : 1
var keypress : key
var checknumber: A20
clearislts
setisltskey 1, 1, 4, 4, 1, key(2,51) , "3"
setisltskey 6, 2, 4, 4, 1, @KEY_ENTER , "Pickup Check"
displayislts
inputkey keypress, checknumber, "Choose a check" // Assuming you pressed the key labeled 3 it will place the value 3 into the checknumber variable.
loadkybdmacro makekeys(checknumber), key(1, 327684) // Activate the pickup check method which will attempt to pickup the check number 3
endevent
RETAINGLOBALVAR
VAR NEXT_PAGE_KEY : KEY = KEY(1,2)
VAR PREV_PAGE_KEY : KEY = KEY(1,1)
VAR SQL_H : N12 = 0
VAR SQL_CMD : A2000
VAR CURRENT_RVC : N3
EVENT INQ : 1
IF @INSTANDALONEMODE OR @INBACKUPMODE
EXITWITHERROR "Not available while in stand-alone or backup mode"
ENDIF
CALL LOADSQL
FORMAT SQL_CMD AS "SELECT ob_tpriv11_pickup_others_chk FROM micros.emp_class_def WHERE emp_class_seq = (SELECT emp_class_seq FROM micros.emp_def WHERE obj_num = ", @TREMP, ")"
CALL SQL_QUERY(SQL_CMD)
VAR WHERE : A2000
IF SQL_CMD = "T;" //the sql_cmd always adds the separator even if just one record, don't feel like throwing in a SPLITQ here
FORMAT WHERE AS "chk_open = 'T'"
ELSE
FORMAT WHERE AS "chk_open = 'T' AND emp_seq = (SELECT emp_seq FROM micros.emp_def WHERE obj_num = ", @TREMP, ")"
ENDIF
FORMAT SQL_CMD AS "SELECT COUNT(chk_seq) FROM micros.chk_dtl WHERE ", WHERE
CALL SQL_QUERY(SQL_CMD)
VAR COUNT : N5 = SQL_CMD
VAR CHK_NUMS[ COUNT ] : N9
VAR CHK_SEQS[ COUNT ] : N9
FORMAT SQL_CMD AS "SELECT chk_num, chk_seq FROM micros.chk_dtl WHERE ", WHERE, " ORDER BY chk_open_date_time"
CALL SQL_RECORDSET(SQL_CMD)
VAR I : N9
FOR I = 1 TO COUNT
CALL SQL_NEXTRECORD(SQL_CMD)
SPLITQ SQL_CMD, ";", CHK_NUMS[I], CHK_SEQS[I]
ENDFOR
VAR INP_RESULT : A200
VAR KEY_RESULT : KEY
VAR CURRENT_PAGE : N9 = 1
VAR CHK_SEQ : N9
VAR CHK_NUM : N9
VAR CHK_RVC : N9
VAR LOOPING : N1 = 1
WHILE LOOPING
CALL ShowPaginationKeys(10, COUNT, CURRENT_PAGE, CHK_NUMS[], CHK_SEQS[])
INPUTKEY KEY_RESULT, INP_RESULT, "SELECT CHECK NUMBER"
//navigation keys accounted for first
IF KEY_RESULT = @KEY_CLEAR
EXITCONTINUE
ENDIF
IF KEY_RESULT = NEXT_PAGE_KEY
CURRENT_PAGE = CURRENT_PAGE + 1
ENDIF
IF KEY_RESULT = PREV_PAGE_KEY
CURRENT_PAGE = CURRENT_PAGE - 1
ENDIF
IF KEY_RESULT <> @KEY_CLEAR AND KEY_RESULT <> NEXT_PAGE_KEY AND KEY_RESULT <> PREV_PAGE_KEY
//not a navigation key? okie dokie
CHK_SEQ = KEYNUMBER(KEY_RESULT)
FORMAT SQL_CMD AS "SELECT chk_num, rvc_seq FROM micros.chk_dtl WHERE chk_seq = ", CHK_SEQ
CALL SQL_QUERY(SQL_CMD)
SPLITQ SQL_CMD, ";", CHK_NUM, CHK_RVC
//store the current RVC
CURRENT_RVC = @RVC
IF CURRENT_RVC <> CHK_RVC
LOADKYBDMACRO KEY(42, CHK_RVC),KEY(1,327684),MAKEKEYS(CHK_NUM),@KEY_ENTER
ELSE
LOADKYBDMACRO KEY(1,327684),MAKEKEYS(CHK_NUM),@KEY_ENTER
ENDIF
LOOPING = 0
ENDIF
ENDWHILE
CALL CLOSESQL
ENDEVENT
EVENT FINAL_TENDER
IF CURRENT_RVC <> 0
//attempt to put us back into our old rvc
IF CURRENT_RVC <> @RVC
LOADKYBDMACRO KEY(42, CURRENT_RVC)
ENDIF
CURRENT_RVC = 0
ENDIF
ENDEVENT
EVENT SRVC_TOTAL:*
IF CURRENT_RVC <> 0
//attempt to put us back into our old rvc
IF CURRENT_RVC <> @RVC
LOADKYBDMACRO KEY(42, CURRENT_RVC)
ENDIF
CURRENT_RVC = 0
ENDIF
ENDEVENT
//////////////////////////////////////////////////
/////////// FORMATTING FUNCTIONS ////////////
//////////////////////////////////////////////////
SUB PAD_LINE( REF OUT, VAR LINE : A40)
VAR PADDING : A40 = " "
FORMAT OUT AS MID(PADDING,1,(32-LEN(LINE))/2.0), LINE
ENDSUB
//////////////////////////////////////////////////
/////////// INPUT FUNCTIONS ////////////
//////////////////////////////////////////////////
SUB GET_YES_NO( REF ANSWER, VAR MESSAGE : A78 )
CLEARISLTS
SETISLTSKEYX 2, 10, 4, 4, 2, @KEY_ENTER, 10059, "LEFT", 10, "YES"
SETISLTSKEYX 2, 16, 4, 4, 2, @KEY_CLEAR, 10058, "LEFT", 10, "NO"
SETISLTSKEYX 11, 12, 2, 6, 2, @KEY_CANCEL, 10392, "LEFT", 10, "CANCEL"
DISPLAYISLTS
VAR CENTER : N3 = (78-LEN(MESSAGE))/2
WINDOW 3,78
DISPLAY 2, CENTER, MESSAGE
VAR KEY_PRESS : KEY
VAR DATA : A20
INPUTKEY KEY_PRESS, DATA, MESSAGE
IF KEY_PRESS = @KEY_ENTER
ANSWER = 1
ELSEIF KEY_PRESS = @KEY_CANCEL
EXITCONTINUE
ELSE
ANSWER = 0
ENDIF
WINDOWCLOSE
ENDSUB
SUB GET_INPUT( REF ANSWER, VAR MESSAGE : A78, VAR TS_SCRN : N9 )
VAR CENTER : N3 = (78-LEN(MESSAGE))/2
WINDOW 3,78
DISPLAY 2, CENTER, MESSAGE
VAR KEYPRESS : KEY
IF TS_SCRN > 0
TOUCHSCREEN TS_SCRN
ENDIF
INPUTKEY KEYPRESS, TIPAMT, MESSAGE
WINDOWCLOSE
ENDSUB
SUB ShowPaginationKeys( var ResultsPerPage : N4, var ResultSize : N4, var CurrentPage : N4, ref Names[], ref ObjNums[] )
Clearislts
while (CurrentPage-1) * ResultsPerPage + 1 > ResultSize AND CurrentPage > 1
CurrentPage = CurrentPage - 1
endwhile
var NumPages : N5 = 1
while NumPages*ResultsPerPage < ResultSize
NumPages = NumPages + 1
endwhile
var KeyHeight : N1 = 6
var KeyWidth : N1 = 30 / (ResultsPerPage / 2)
var FirstItem : N5 = (CurrentPage-1) * ResultsPerPage + 1
//draw first row of results
var i : N5
for i = FirstItem to FirstItem + ResultsPerPage / 2 - 1
if i > ResultSize
break
endif
SetIslTsKeyx 1,(i - FirstItem) * KeyWidth + 1,3,KeyWidth,1,key(1, ObjNums[ i ]), 0, "C", 1, Names[ i ]
endfor
//draw second row of results
for i = i to FirstItem + ResultsPerPage
if i > ResultSize
break
endif
SetIslTsKeyx 4,(i - FirstItem - ResultsPerPage / 2) * KeyWidth + 1,3,KeyWidth,1,key(1, ObjNums[ i ]), 0, "C", 1, Names[ i ]
endfor
//draw some page keys
if CurrentPage > 1
setisltskeyx 11, 1, 2, 2, 1, key(1,1), 10388, "C", 10, ""
endif
if CurrentPage < NumPages
setisltskeyx 11, 3, 2, 2, 1, key(1,2), 10389, "C", 10, ""
endif
//Provide an escape route
SetIslTsKeyx 9,27,4, 4, 1, @Key_Clear, 10058, "L", 10, "Done/Exit"
displayislts
endsub
SUB ShowISLKeyboard( var Keyboard_Width : N2, var Keyboard_Height : N2)
//ASCII keys 65 - 90
//calculate the starting X position for the top row of keys
var X : N2 = (30 - (10 * Keyboard_Width)) / 2
//calculate the starting Y position for the top row of keys
var Y : N2 = 12 - (Keyboard_Height * 3) + 1
//draw keys Q(81),W(87),E(69),R(82),T(84),Y(89),U(85),I(73),O(79),P(80)
SetIslTsKeyx Y,X + (Keyboard_Width * 0),Keyboard_Height,Keyboard_Width,1,key(1,81),0,"C",10,"Q"
SetIslTsKeyx Y,X + (Keyboard_Width * 1),Keyboard_Height,Keyboard_width,1,key(1,87),0,"C",10,"W"
SetIslTsKeyx Y,X + (Keyboard_Width * 2),Keyboard_Height,Keyboard_width,1,key(1,69),0,"C",10,"E"
SetIslTsKeyx Y,X + (Keyboard_Width * 3),Keyboard_Height,Keyboard_width,1,key(1,82),0,"C",10,"R"
SetIslTsKeyx Y,X + (Keyboard_Width * 4),Keyboard_Height,Keyboard_width,1,key(1,84),0,"C",10,"T"
SetIslTsKeyx Y,X + (Keyboard_Width * 5),Keyboard_Height,Keyboard_width,1,key(1,89),0,"C",10,"Y"
SetIslTsKeyx Y,X + (Keyboard_Width * 6),Keyboard_Height,Keyboard_width,1,key(1,85),0,"C",10,"U"
SetIslTsKeyx Y,X + (Keyboard_Width * 7),Keyboard_Height,Keyboard_width,1,key(1,73),0,"C",10,"I"
SetIslTsKeyx Y,X + (Keyboard_Width * 8),Keyboard_Height,Keyboard_width,1,key(1,79),0,"C",10,"O"
SetIslTsKeyx Y,X + (Keyboard_Width * 9),Keyboard_Height,Keyboard_width,1,key(1,80),0,"C",10,"P"
//calculate the starting X position for the second row of keys
X = (30 - (10 * Keyboard_Width)) / 2 + 1
//calculate the starting Y position for the second row of keys
Y = 12 - (Keyboard_Height * 2) + 1
//draw keys A(65),S(83),D(68),F(70),G(71),H(72),J(74),K(75),L(76)
SetIslTsKeyx Y,X + (Keyboard_Width * 0),Keyboard_Height,Keyboard_Width,1,key(1,65),0,"C",10,"A"
SetIslTsKeyx Y,X + (Keyboard_Width * 1),Keyboard_Height,Keyboard_width,1,key(1,83),0,"C",10,"S"
SetIslTsKeyx Y,X + (Keyboard_Width * 2),Keyboard_Height,Keyboard_width,1,key(1,68),0,"C",10,"D"
SetIslTsKeyx Y,X + (Keyboard_Width * 3),Keyboard_Height,Keyboard_width,1,key(1,70),0,"C",10,"F"
SetIslTsKeyx Y,X + (Keyboard_Width * 4),Keyboard_Height,Keyboard_width,1,key(1,71),0,"C",10,"G"
SetIslTsKeyx Y,X + (Keyboard_Width * 5),Keyboard_Height,Keyboard_width,1,key(1,72),0,"C",10,"H"
SetIslTsKeyx Y,X + (Keyboard_Width * 6),Keyboard_Height,Keyboard_width,1,key(1,74),0,"C",10,"J"
SetIslTsKeyx Y,X + (Keyboard_Width * 7),Keyboard_Height,Keyboard_width,1,key(1,75),0,"C",10,"K"
SetIslTsKeyx Y,X + (Keyboard_Width * 8),Keyboard_Height,Keyboard_width,1,key(1,76),0,"C",10,"L"
//calculate the starting X position for the third row of keys
X = (30 - (10 * Keyboard_Width)) / 2 + 2
//calculate the starting Y position for the second row of keys
Y = 12 - (Keyboard_Height * 1) + 1
//draw keys Z(90),X(88),C(67),V(86),B(66),N(78),M(77)
SetIslTsKeyx Y,X + (Keyboard_Width * 0),Keyboard_Height,Keyboard_Width,1,key(1,90),0,"C",10,"Z"
SetIslTsKeyx Y,X + (Keyboard_Width * 1),Keyboard_Height,Keyboard_width,1,key(1,88),0,"C",10,"X"
SetIslTsKeyx Y,X + (Keyboard_Width * 2),Keyboard_Height,Keyboard_width,1,key(1,67),0,"C",10,"C"
SetIslTsKeyx Y,X + (Keyboard_Width * 3),Keyboard_Height,Keyboard_width,1,key(1,86),0,"C",10,"V"
SetIslTsKeyx Y,X + (Keyboard_Width * 4),Keyboard_Height,Keyboard_width,1,key(1,66),0,"C",10,"B"
SetIslTsKeyx Y,X + (Keyboard_Width * 5),Keyboard_Height,Keyboard_width,1,key(1,78),0,"C",10,"N"
SetIslTsKeyx Y,X + (Keyboard_Width * 6),Keyboard_Height,Keyboard_width,1,key(1,77),0,"C",10,"M"
//backspace key
SetIslTsKeyx Y,X + (Keyboard_Width * 8),Keyboard_Height,Keyboard_width,1,key(1,91),10072,"C",10,""
//spacebar
SetIslTsKeyx Y,X + (Keyboard_Width * 7),Keyboard_Height,Keyboard_width,1,key(1,92),0,"C",39,"|__|"
//Provide an escape route
SetIslTsKeyx 9,27,4, 4, 1, @Key_Clear, 10058, "L", 10, "Done/Exit"
ENDSUB
/////////////////////////////////////////////////
/////////// SQL FUNCTIONS ///////////
/////////////////////////////////////////////////
SUB LOADSQL
CALL LOADDLL
CALL OPENSQL
ENDSUB
SUB LOADDLL
IF SQL_H = 0
DLLLOAD SQL_H, "MDSSysUtilsProxy.dll"
ENDIF
ENDSUB
SUB OPENSQL
IF SQL_H = 0
RETURN
ENDIF
VAR CON_STATUS : N9
DLLCALL_CDECL SQL_H, sqlIsConnectionOpen( REF CON_STATUS )
IF CON_STATUS = 0
DLLCALL_CDECL SQL_H, sqlInitConnection("micros", "ODBC;UID=custom;PWD=custom", "")
ENDIF
ENDSUB
SUB SQL_QUERY( REF SQL_CMD )
DLLCALL_CDECL SQL_H, sqlGetRecordSet( SQL_CMD )
SQL_CMD = ""
DLLCALL_CDECL SQL_H, sqlGetLastErrorString( REF SQL_CMD )
IF SQL_CMD <> ""
ERRORMESSAGE "SQL ERROR: ", SQL_CMD
ENDIF
DLLCALL_CDECL SQL_H, sqlGetNext( REF SQL_CMD )
ENDSUB
SUB SQL_EXEC( REF SQL_CMD )
DLLCALL_CDECL SQL_H, sqlExecuteQuery( SQL_CMD )
SQL_CMD = ""
DLLCALL_CDECL SQL_H, sqlGetLastErrorString( REF SQL_CMD )
IF SQL_CMD <> ""
ERRORMESSAGE "SQL ERROR: ", SQL_CMD
ENDIF
ENDSUB
SUB SQL_RECORDSET( REF SQL_CMD )
DLLCALL_CDECL SQL_H, sqlGetRecordSet( sql_cmd )
SQL_CMD = ""
DLLCALL_CDECL SQL_H, sqlGetLastErrorString( REF SQL_CMD )
IF SQL_CMD <> ""
EXITWITHERROR "SQL Error: ", SQL_CMD
ENDIF
ENDSUB
SUB SQL_NEXTRECORD( REF SQL_CMD )
DLLCALL_CDECL SQL_H, sqlGetNext( REF SQL_CMD )
ENDSUB
SUB CLOSESQL
IF SQL_H <> 0
DLLCALL_CDECL SQL_H, sqlCloseConnection()
DLLFREE SQL_H
ENDIF
SQL_H = 0
ENDSUB
RETAINGLOBALVAR
VAR NEXT_PAGE_KEY : KEY = KEY(1,2)
VAR PREV_PAGE_KEY : KEY = KEY(1,1)
VAR SQL_H : N12 = 0
VAR SQL_CMD : A2000
VAR SHOW_CHECKS : KEY = KEY(24, 16384*2+@PMSSEQNUM)
VAR CURRENT_RVC : N3
EVENT INQ : 1
LOADKYBDMACRO SHOW_CHECKS
ENDEVENT
EVENT INQ : 2
IF @INSTANDALONEMODE OR @INBACKUPMODE
EXITWITHERROR "Not available while in stand-alone or backup mode"
ENDIF
CALL LOADSQL
FORMAT SQL_CMD AS "SELECT ob_tpriv11_pickup_others_chk FROM micros.emp_class_def WHERE emp_class_seq = (SELECT emp_class_seq FROM micros.emp_def WHERE obj_num = ", @TREMP, ")"
CALL SQL_QUERY(SQL_CMD)
VAR WHERE : A2000
IF SQL_CMD = "T;" //the sql_cmd always adds the separator even if just one record, don't feel like throwing in a SPLITQ here
FORMAT WHERE AS "chk_open = 'T'"
ELSE
FORMAT WHERE AS "chk_open = 'T' AND emp_seq = (SELECT emp_seq FROM micros.emp_def WHERE obj_num = ", @TREMP, ")"
ENDIF
FORMAT SQL_CMD AS "SELECT COUNT(chk_seq) FROM micros.chk_dtl WHERE ", WHERE
CALL SQL_QUERY(SQL_CMD)
VAR COUNT : N5 = SQL_CMD
VAR CHK_NUMS[ COUNT ] : N9
VAR CHK_SEQS[ COUNT ] : N9
FORMAT SQL_CMD AS "SELECT chk_num, chk_seq FROM micros.chk_dtl WHERE ", WHERE, " ORDER BY chk_open_date_time"
CALL SQL_RECORDSET(SQL_CMD)
VAR I : N9
FOR I = 1 TO COUNT
CALL SQL_NEXTRECORD(SQL_CMD)
SPLITQ SQL_CMD, ";", CHK_NUMS[I], CHK_SEQS[I]
ENDFOR
VAR INP_RESULT : A200
VAR KEY_RESULT : KEY
VAR CURRENT_PAGE : N9 = 1
VAR CHK_SEQ : N9
VAR CHK_NUM : N9
VAR CHK_RVC : N9
VAR LOOPING : N1 = 1
WHILE LOOPING
CALL ShowPaginationKeys(10, COUNT, CURRENT_PAGE, CHK_NUMS[], CHK_SEQS[])
INPUTKEY KEY_RESULT, INP_RESULT, "SELECT CHECK NUMBER"
//navigation keys accounted for first
IF KEY_RESULT = @KEY_CLEAR
EXITCONTINUE
ENDIF
IF KEY_RESULT = NEXT_PAGE_KEY
CURRENT_PAGE = CURRENT_PAGE + 1
ENDIF
IF KEY_RESULT = PREV_PAGE_KEY
CURRENT_PAGE = CURRENT_PAGE - 1
ENDIF
IF KEY_RESULT <> @KEY_CLEAR AND KEY_RESULT <> NEXT_PAGE_KEY AND KEY_RESULT <> PREV_PAGE_KEY
//not a navigation key? okie dokie
CHK_SEQ = KEYNUMBER(KEY_RESULT)
FORMAT SQL_CMD AS "SELECT chk_num, rvc_seq FROM micros.chk_dtl WHERE chk_seq = ", CHK_SEQ
CALL SQL_QUERY(SQL_CMD)
SPLITQ SQL_CMD, ";", CHK_NUM, CHK_RVC
//store the current RVC
CURRENT_RVC = @RVC
IF CURRENT_RVC <> CHK_RVC
LOADKYBDMACRO KEY(42, CHK_RVC),KEY(1,327684),MAKEKEYS(CHK_NUM),@KEY_ENTER
ELSE
LOADKYBDMACRO KEY(1,327684),MAKEKEYS(CHK_NUM),@KEY_ENTER
ENDIF
LOOPING = 0
ENDIF
ENDWHILE
CALL CLOSESQL
ENDEVENT
EVENT FINAL_TENDER
IF CURRENT_RVC <> 0
//attempt to put us back into our old rvc
IF CURRENT_RVC <> @RVC
LOADKYBDMACRO KEY(42, CURRENT_RVC)
ENDIF
CURRENT_RVC = 0
ENDIF
ENDEVENT
EVENT SRVC_TOTAL:*
IF CURRENT_RVC <> 0
//attempt to put us back into our old rvc
IF CURRENT_RVC <> @RVC
LOADKYBDMACRO KEY(42, CURRENT_RVC)
ENDIF
CURRENT_RVC = 0
ENDIF
ENDEVENT
//////////////////////////////////////////////////
/////////// FORMATTING FUNCTIONS ////////////
//////////////////////////////////////////////////
SUB PAD_LINE( REF OUT, VAR LINE : A40)
VAR PADDING : A40 = " "
FORMAT OUT AS MID(PADDING,1,(32-LEN(LINE))/2.0), LINE
ENDSUB
//////////////////////////////////////////////////
/////////// INPUT FUNCTIONS ////////////
//////////////////////////////////////////////////
SUB GET_YES_NO( REF ANSWER, VAR MESSAGE : A78 )
CLEARISLTS
SETISLTSKEYX 2, 10, 4, 4, 2, @KEY_ENTER, 10059, "LEFT", 10, "YES"
SETISLTSKEYX 2, 16, 4, 4, 2, @KEY_CLEAR, 10058, "LEFT", 10, "NO"
SETISLTSKEYX 11, 12, 2, 6, 2, @KEY_CANCEL, 10392, "LEFT", 10, "CANCEL"
DISPLAYISLTS
VAR CENTER : N3 = (78-LEN(MESSAGE))/2
WINDOW 3,78
DISPLAY 2, CENTER, MESSAGE
VAR KEY_PRESS : KEY
VAR DATA : A20
INPUTKEY KEY_PRESS, DATA, MESSAGE
IF KEY_PRESS = @KEY_ENTER
ANSWER = 1
ELSEIF KEY_PRESS = @KEY_CANCEL
EXITCONTINUE
ELSE
ANSWER = 0
ENDIF
WINDOWCLOSE
ENDSUB
SUB GET_INPUT( REF ANSWER, VAR MESSAGE : A78, VAR TS_SCRN : N9 )
VAR CENTER : N3 = (78-LEN(MESSAGE))/2
WINDOW 3,78
DISPLAY 2, CENTER, MESSAGE
VAR KEYPRESS : KEY
IF TS_SCRN > 0
TOUCHSCREEN TS_SCRN
ENDIF
INPUTKEY KEYPRESS, TIPAMT, MESSAGE
WINDOWCLOSE
ENDSUB
SUB ShowPaginationKeys( var ResultsPerPage : N4, var ResultSize : N4, var CurrentPage : N4, ref Names[], ref ObjNums[] )
Clearislts
while (CurrentPage-1) * ResultsPerPage + 1 > ResultSize AND CurrentPage > 1
CurrentPage = CurrentPage - 1
endwhile
var NumPages : N5 = 1
while NumPages*ResultsPerPage < ResultSize
NumPages = NumPages + 1
endwhile
var KeyHeight : N1 = 6
var KeyWidth : N1 = 30 / (ResultsPerPage / 2)
var FirstItem : N5 = (CurrentPage-1) * ResultsPerPage + 1
//draw first row of results
var i : N5
for i = FirstItem to FirstItem + ResultsPerPage / 2 - 1
if i > ResultSize
break
endif
SetIslTsKeyx 1,(i - FirstItem) * KeyWidth + 1,3,KeyWidth,1,key(1, ObjNums[ i ]), 0, "C", 1, Names[ i ]
endfor
//draw second row of results
for i = i to FirstItem + ResultsPerPage
if i > ResultSize
break
endif
SetIslTsKeyx 4,(i - FirstItem - ResultsPerPage / 2) * KeyWidth + 1,3,KeyWidth,1,key(1, ObjNums[ i ]), 0, "C", 1, Names[ i ]
endfor
//draw some page keys
if CurrentPage > 1
setisltskeyx 11, 1, 2, 2, 1, key(1,1), 10388, "C", 10, ""
endif
if CurrentPage < NumPages
setisltskeyx 11, 3, 2, 2, 1, key(1,2), 10389, "C", 10, ""
endif
//Provide an escape route
SetIslTsKeyx 9,27,4, 4, 1, @Key_Clear, 10058, "L", 10, "Done/Exit"
displayislts
endsub
SUB ShowISLKeyboard( var Keyboard_Width : N2, var Keyboard_Height : N2)
//ASCII keys 65 - 90
//calculate the starting X position for the top row of keys
var X : N2 = (30 - (10 * Keyboard_Width)) / 2
//calculate the starting Y position for the top row of keys
var Y : N2 = 12 - (Keyboard_Height * 3) + 1
//draw keys Q(81),W(87),E(69),R(82),T(84),Y(89),U(85),I(73),O(79),P(80)
SetIslTsKeyx Y,X + (Keyboard_Width * 0),Keyboard_Height,Keyboard_Width,1,key(1,81),0,"C",10,"Q"
SetIslTsKeyx Y,X + (Keyboard_Width * 1),Keyboard_Height,Keyboard_width,1,key(1,87),0,"C",10,"W"
SetIslTsKeyx Y,X + (Keyboard_Width * 2),Keyboard_Height,Keyboard_width,1,key(1,69),0,"C",10,"E"
SetIslTsKeyx Y,X + (Keyboard_Width * 3),Keyboard_Height,Keyboard_width,1,key(1,82),0,"C",10,"R"
SetIslTsKeyx Y,X + (Keyboard_Width * 4),Keyboard_Height,Keyboard_width,1,key(1,84),0,"C",10,"T"
SetIslTsKeyx Y,X + (Keyboard_Width * 5),Keyboard_Height,Keyboard_width,1,key(1,89),0,"C",10,"Y"
SetIslTsKeyx Y,X + (Keyboard_Width * 6),Keyboard_Height,Keyboard_width,1,key(1,85),0,"C",10,"U"
SetIslTsKeyx Y,X + (Keyboard_Width * 7),Keyboard_Height,Keyboard_width,1,key(1,73),0,"C",10,"I"
SetIslTsKeyx Y,X + (Keyboard_Width * 8),Keyboard_Height,Keyboard_width,1,key(1,79),0,"C",10,"O"
SetIslTsKeyx Y,X + (Keyboard_Width * 9),Keyboard_Height,Keyboard_width,1,key(1,80),0,"C",10,"P"
//calculate the starting X position for the second row of keys
X = (30 - (10 * Keyboard_Width)) / 2 + 1
//calculate the starting Y position for the second row of keys
Y = 12 - (Keyboard_Height * 2) + 1
//draw keys A(65),S(83),D(68),F(70),G(71),H(72),J(74),K(75),L(76)
SetIslTsKeyx Y,X + (Keyboard_Width * 0),Keyboard_Height,Keyboard_Width,1,key(1,65),0,"C",10,"A"
SetIslTsKeyx Y,X + (Keyboard_Width * 1),Keyboard_Height,Keyboard_width,1,key(1,83),0,"C",10,"S"
SetIslTsKeyx Y,X + (Keyboard_Width * 2),Keyboard_Height,Keyboard_width,1,key(1,68),0,"C",10,"D"
SetIslTsKeyx Y,X + (Keyboard_Width * 3),Keyboard_Height,Keyboard_width,1,key(1,70),0,"C",10,"F"
SetIslTsKeyx Y,X + (Keyboard_Width * 4),Keyboard_Height,Keyboard_width,1,key(1,71),0,"C",10,"G"
SetIslTsKeyx Y,X + (Keyboard_Width * 5),Keyboard_Height,Keyboard_width,1,key(1,72),0,"C",10,"H"
SetIslTsKeyx Y,X + (Keyboard_Width * 6),Keyboard_Height,Keyboard_width,1,key(1,74),0,"C",10,"J"
SetIslTsKeyx Y,X + (Keyboard_Width * 7),Keyboard_Height,Keyboard_width,1,key(1,75),0,"C",10,"K"
SetIslTsKeyx Y,X + (Keyboard_Width * 8),Keyboard_Height,Keyboard_width,1,key(1,76),0,"C",10,"L"
//calculate the starting X position for the third row of keys
X = (30 - (10 * Keyboard_Width)) / 2 + 2
//calculate the starting Y position for the second row of keys
Y = 12 - (Keyboard_Height * 1) + 1
//draw keys Z(90),X(88),C(67),V(86),B(66),N(78),M(77)
SetIslTsKeyx Y,X + (Keyboard_Width * 0),Keyboard_Height,Keyboard_Width,1,key(1,90),0,"C",10,"Z"
SetIslTsKeyx Y,X + (Keyboard_Width * 1),Keyboard_Height,Keyboard_width,1,key(1,88),0,"C",10,"X"
SetIslTsKeyx Y,X + (Keyboard_Width * 2),Keyboard_Height,Keyboard_width,1,key(1,67),0,"C",10,"C"
SetIslTsKeyx Y,X + (Keyboard_Width * 3),Keyboard_Height,Keyboard_width,1,key(1,86),0,"C",10,"V"
SetIslTsKeyx Y,X + (Keyboard_Width * 4),Keyboard_Height,Keyboard_width,1,key(1,66),0,"C",10,"B"
SetIslTsKeyx Y,X + (Keyboard_Width * 5),Keyboard_Height,Keyboard_width,1,key(1,78),0,"C",10,"N"
SetIslTsKeyx Y,X + (Keyboard_Width * 6),Keyboard_Height,Keyboard_width,1,key(1,77),0,"C",10,"M"
//backspace key
SetIslTsKeyx Y,X + (Keyboard_Width * 8),Keyboard_Height,Keyboard_width,1,key(1,91),10072,"C",10,""
//spacebar
SetIslTsKeyx Y,X + (Keyboard_Width * 7),Keyboard_Height,Keyboard_width,1,key(1,92),0,"C",39,"|__|"
//Provide an escape route
SetIslTsKeyx 9,27,4, 4, 1, @Key_Clear, 10058, "L", 10, "Done/Exit"
ENDSUB
/////////////////////////////////////////////////
/////////// SQL FUNCTIONS ///////////
/////////////////////////////////////////////////
SUB LOADSQL
CALL LOADDLL
CALL OPENSQL
ENDSUB
SUB LOADDLL
IF SQL_H = 0
DLLLOAD SQL_H, "MDSSysUtilsProxy.dll"
ENDIF
ENDSUB
SUB OPENSQL
IF SQL_H = 0
RETURN
ENDIF
VAR CON_STATUS : N9
DLLCALL_CDECL SQL_H, sqlIsConnectionOpen( REF CON_STATUS )
IF CON_STATUS = 0
DLLCALL_CDECL SQL_H, sqlInitConnection("micros", "ODBC;UID=custom;PWD=custom", "")
ENDIF
ENDSUB
SUB SQL_QUERY( REF SQL_CMD )
DLLCALL_CDECL SQL_H, sqlGetRecordSet( SQL_CMD )
SQL_CMD = ""
DLLCALL_CDECL SQL_H, sqlGetLastErrorString( REF SQL_CMD )
IF SQL_CMD <> ""
ERRORMESSAGE "SQL ERROR: ", SQL_CMD
ENDIF
DLLCALL_CDECL SQL_H, sqlGetNext( REF SQL_CMD )
ENDSUB
SUB SQL_EXEC( REF SQL_CMD )
DLLCALL_CDECL SQL_H, sqlExecuteQuery( SQL_CMD )
SQL_CMD = ""
DLLCALL_CDECL SQL_H, sqlGetLastErrorString( REF SQL_CMD )
IF SQL_CMD <> ""
ERRORMESSAGE "SQL ERROR: ", SQL_CMD
ENDIF
ENDSUB
SUB SQL_RECORDSET( REF SQL_CMD )
DLLCALL_CDECL SQL_H, sqlGetRecordSet( sql_cmd )
SQL_CMD = ""
DLLCALL_CDECL SQL_H, sqlGetLastErrorString( REF SQL_CMD )
IF SQL_CMD <> ""
EXITWITHERROR "SQL Error: ", SQL_CMD
ENDIF
ENDSUB
SUB SQL_NEXTRECORD( REF SQL_CMD )
DLLCALL_CDECL SQL_H, sqlGetNext( REF SQL_CMD )
ENDSUB
SUB CLOSESQL
IF SQL_H <> 0
DLLCALL_CDECL SQL_H, sqlCloseConnection()
DLLFREE SQL_H
ENDIF
SQL_H = 0
ENDSUB