Sprungmonkey,Try the attached solution in VS 2013.Make sure to install Net Framework 4.7.1 Developer Pack first (if you don't have it already installed).
/********************************************************************• .NET equivalent of STRING.REPLACE• Search a string for a specified string and replace it• Added looping capability to replace more than one• Added passing different custom source string size********************************************************************///Determine the size of the passed in arraySIZE(SourceArray,0,array_size);FOR index:= 0 TO array_size-1 DO COP(SourceArray[index],sSource.DATA[index],1);END_FOR;//sSource.LEN:= array_size;WHILE sSource.LEN > sSearch.LEN DO FIND(sSource,sSearch,1,PosFound); IF PosFound > 0 then DELETE(sSource,sSearch.LEN,PosFound,sSource); INSERT(sSource,sReplace,PosFound,sSource); ELSE EXIT; END_IF;END_WHILE;FOR index:= 0 TO sSource.LEN-1 DO COP(sSource.DATA[index],SourceArray[index],1);END_FOR;
Attached are some code bits from a project I did to print to a Zebra printer. I used Zebra Designer software to create a label, then exported it to a "prn" file. Within the label, I specified variable fields by closing them in brackets. The code would look for those fields and substitute it with the data.The code does use native methods so it will only work on Windows. It sends information to the printer that has been installed using the Zebra printer driver.
I tried this but I'm getting an error in RawPrinterHelper... any ideas?Quote from: Archie on September 30, 2018, 05:42:21 AMAttached are some code bits from a project I did to print to a Zebra printer. I used Zebra Designer software to create a label, then exported it to a "prn" file. Within the label, I specified variable fields by closing them in brackets. The code would look for those fields and substitute it with the data.The code does use native methods so it will only work on Windows. It sends information to the printer that has been installed using the Zebra printer driver.
Changing from OpenPrinterW DLL call to OpenPrinter2W call seems to have worked... I do not understand what i'm doing here. but i printed something!Quote from: PLCHorse on February 22, 2025, 07:22:02 PMI tried this but I'm getting an error in RawPrinterHelper... any ideas?Quote from: Archie on September 30, 2018, 05:42:21 AMAttached are some code bits from a project I did to print to a Zebra printer. I used Zebra Designer software to create a label, then exported it to a "prn" file. Within the label, I specified variable fields by closing them in brackets. The code would look for those fields and substitute it with the data.The code does use native methods so it will only work on Windows. It sends information to the printer that has been installed using the Zebra printer driver.