Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
SRP_Encode
I am trying to use a REST API that does not like the CRLF tagged and the end of my authorization. The encoding is BASE64. I am trying to use the option but am having a problem.
SRP_Encode(Data, 'BASE64') runs just fine
SRP_Encode(Data, 'BASE64',, 0) Returns a compile error , illegal expression encountered. No quote marks in third parameter
SRP_Encode(Data, 'BASE64', '', 0) This compiles okay but when executed fails with the following error image attached I updated SRP_Utilities by installing the new editor and I now get this error in the image titled capture2
I would like to verify that I am using the tool properly and if I am then turn it over to SRP
SRP_Encode(Data, 'BASE64') runs just fine
SRP_Encode(Data, 'BASE64',, 0) Returns a compile error , illegal expression encountered. No quote marks in third parameter
SRP_Encode(Data, 'BASE64', '', 0) This compiles okay but when executed fails with the following error image attached I updated SRP_Utilities by installing the new editor and I now get this error in the image titled capture2
I would like to verify that I am using the tool properly and if I am then turn it over to SRP
Comments
When I inspect the variable created with the option to strip the CRLF in the OI debugger the Modify Variable screen displays characters. When I inspect the variable created without the option to strip the CRLF in the OI debugger the Modify Variable screen displays in hex. That would be an indication that the CRLF has been stripped. I confirmed this by checking the length of the variables. The one with the option to strip the CRLF is two characters shorter as would be expected.
PicturePath = 'C:\AboutBanner.png' If Len(PicturePath) then OSRead PictureBinary from PicturePath then EncodedWithCRLF = SRP_Encode(PictureBinary, 'BASE64') Len1 = Len(EncodedWithCRLF) NumLF1 = Count(EncodedWithCRLF, \0A\) EncodedWOCRLF = SRP_Encode(PictureBinary, 'BASE64', '', 0) Len2 = Len(EncodedWOCRLF) NumLF2 = Count(EncodedWOCRLF, \0A\) end end