added LSL2 stored procedures
This commit is contained in:
42
LSL2/STPROC/RECIPE_PSN_VALID.txt
Normal file
42
LSL2/STPROC/RECIPE_PSN_VALID.txt
Normal file
@ -0,0 +1,42 @@
|
||||
compile subroutine recipe_psn_valid(ConvType, DataIo, Branch, ReturnedValue)
|
||||
begin condition
|
||||
pre:
|
||||
post:
|
||||
end condition
|
||||
declare function msg, get_property, set_property
|
||||
declare subroutine extract_si_keys
|
||||
|
||||
$insert logical
|
||||
$insert msg_equates
|
||||
$insert prod_spec_equ
|
||||
|
||||
equ valid$ to 0 ;* successful
|
||||
equ invalid_msg$ to 1 ;* bad data - print error message window
|
||||
equ invalid_conv$ to 2 ;* bad conversion - " "
|
||||
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
|
||||
equ CrLf$ to char(13):char(10)
|
||||
|
||||
ReturnedValue = DataIo
|
||||
status() = Valid$
|
||||
begin case
|
||||
case ConvType = 'ICONV'
|
||||
CurRecipeNo = get_property( @window:'.RECIPE_NO', 'TEXT' )
|
||||
PSNId = DataIo
|
||||
PSNRecipeNo = xlate( 'PROD_SPEC', PSNId, 'RECIPE_NO', 'X' )
|
||||
if ( PSNRecipeNo = CurRecipeNo ) then
|
||||
* VALIDATED OK THE CURRENT PSN THEY ARE ENTERING USES THE CURRENT RECIPE
|
||||
end else
|
||||
MsgInfo = ''
|
||||
MsgInfo<mtext$> = 'PSN ':quote(PSNId):' does not currently use recipe ':quote(CurRecipeNo):'.'
|
||||
MsgInfo<micon$> = 'H'
|
||||
Void = msg( '', MsgInfo )
|
||||
status() = invalid_nomsg$
|
||||
end
|
||||
case ConvType = 'OCONV'
|
||||
* no output
|
||||
ReturnedValue = DataIo
|
||||
case otherwise$
|
||||
ReturnedValue = ''
|
||||
status() = invalid_conv$
|
||||
end case
|
||||
return
|
Reference in New Issue
Block a user