Cambia esto:
Código Delphi
[-]if ModuloDatos.THistorialPRI2.AsString = 1X then
por esto
Código Delphi
[-]if ModuloDatos.THistorialPRI2.AsString = '1' then
Ahora reconocerá el caracter 1.
Si pretendes que reconozca el carácter ASCII número 1 entonces debes hacer esto:
Código Delphi
[-]if ModuloDatos.THistorialPRI2.AsString = #1 then
Saludos.