O$: Code 128 / QR Code on Mac

Jacques Zemron jacky at aec-ri.com
Thu Aug 28 04:47:39 EDT 2014


sorry, I forgot to give the code 

TestNum 
;  si les mini caractères à partir de i sont numeriques, alors mini=0
Calculate cMini as cMini-1
If cI+cMini<=len(cChaine)
While cMini>=0
If asc(cChaine,cI+cMini)<48|asc(cChaine,cI+cMini)>57
Break to end of loop
End If
Calculate cMini as cMini-1
End While
End If

Cordialement,

Jacques ZEMRON
 


2, Impasse du Marechal Ferrant
14540 SOLIERS
Tel : 02 31 72 73 54
Fax : 02 31 26 94 72
Portable : 06 82 68 60 08
Mailto:jacky at aec-ri.com





Le 27 août 2014 à 12:03, Nick Renders <omnis1 at arcict.com> a écrit :

> Hi Jacky,
> 
> Thank you very much for your code.
> I see that you call a method TestNum twice, but it doesn't set any variables.
> Is this relevant or can I just leave it out?
> 
> I also found out that Google has an API to create QR Codes:
> https://developers.google.com/chart/infographics/docs/qr_codes
> 
> We will probably end up implementing this, but it's good to have your
> Code 128 method just in case, so thanks again!
> 
> Cheers,
> 
> Nick Renders
> 
> ARC - your ICT service partner
> H. D. Saviolaan 8
> 1700 Dilbeek
> T: (00 32) (0)2 466 50 00
> F: (00 32) (0)2 466 88 33
> http://www.arcict.com
> 
> 
> On 26 Aug 2014, at 11:36, Jacques Zemron wrote:
> 
>> Hi Nick,
>> 
>> You need code 128 barfonts to print barcodes in your reports.
>> Code128 barcodes need to be coded
>> 
>> here is my code
>> 
>> Calculate cChaine as pChaine
>> If len(cChaine)>0
>> ;  Vérifier si les caractères son valides
>> For cI from 1 to len(cChaine) step 1
>> Calculate lASCII as asc(cChaine,cI)
>> If (asc(cChaine,cI)>=32&asc(cChaine,cI)<=126)|asc(cChaine,cI)=203
>> Else
>> Calculate cI as 0
>> Break to end of loop
>> End If
>> End For
>> ;  Calculer la chaine de code en optimisant l'usage des tables B et C
>> Calculate lTableB as kTrue
>> Calculate cCode128 as ''
>> If cI>0
>> Calculate cI as 1     ;; i% devient l'index sur la chaine
>> While cI<len(cChaine)
>> If lTableB
>> ;  voir si interessant de passer en table C
>> ;  Oui pour 4 chiffres au debut ou à la fin, sinon pour 6 chiffres
>> Calculate cMini as pick(cI=1|cI+3=len(cChaine),4,6)
>> Do method TestNum
>> If cMini<0     ;; choix table C
>> If cI=1     ;; débuter sur table C
>> Calculate cCode128 as chr(210)
>> Else     ;; commuter sur table C
>> Calculate cCode128 as con(cCode128,chr(199))
>> End If
>> Calculate lTableB as kFalse
>> Else
>> If cI=1     ;; débuter sur table B
>> Calculate cCode128 as chr(204)
>> End If
>> End If
>> End If
>> If not(lTableB)     ;; on est sur la table C, essayer de traier 2 chiffres
>> Calculate cMini as 2
>> Do method TestNum
>> If cMini<0     ;; OK pour 2 chiffres, les traiter
>> Calculate lDummy as mid(cChaine,cI,2)
>> Calculate lDummy as pick(lDummy<95,lDummy+32,lDummy+105)
>> Calculate cCode128 as con(cCode128,chr(lDummy))
>> Calculate cI as cI+2
>> Else     ;; on n'a pas 2 chiffres, repasser en table B
>> Calculate cCode128 as con(cCode128,chr(205))
>> Calculate lTableB as kTrue
>> End If
>> End If
>> If lTableB     ;; Traiter 1 caractère en table B
>> Calculate cCode128 as con(cCode128,mid(cChaine,cI,1))
>> Calculate cI as cI+1
>> End If
>> End While
>> ;  calcul de la cle de contrôle
>> For cI from 1 to len(cCode128) step 1
>> Calculate lDummy as asc(cCode128,cI)
>> Calculate lDummy as pick(lDummy<127,lDummy-32,lDummy-105)
>> If cI=1
>> Calculate lChecksum as lDummy
>> End If
>> Calculate lChecksum as mod(lChecksum+(cI-1)*lDummy,103)
>> End For
>> ;  calcul du code ascii de la cle
>> Calculate lChecksum as pick(lChecksum<95,lChecksum+32,lChecksum+105)
>> ;  Ajout de la cle et du stop
>> Calculate cCode128 as con(cCode128,chr(lChecksum),chr(211))
>> End If
>> End If
>> Quit method cCode128
>> 
>> Cordialement,
>> 
>> Jacques ZEMRON
>> 
>> 
>> 
>> 2, Impasse du Marechal Ferrant
>> 14540 SOLIERS
>> Tel : 02 31 72 73 54
>> Fax : 02 31 26 94 72
>> Portable : 06 82 68 60 08
>> Mailto:jacky at aec-ri.com
>> 
>> 
>> 
>> 
>> 
>> Le 26 août 2014 à 09:46, Nick Renders <omnis1 at arcict.com> a écrit :
>> 
>>> Hi List,
>>> 
>>> We are looking for a way to print barcodes on our Omnis reports.
>>> The barcodes should support all ASCII characters, so I think we
>>> will have to go for Code 128 or QR Code.
>>> 
>>> We are running Omnis Studio 4.3 non-unicode on MacOS X.
>>> Does anyone have a solution for this?
>>> 
>>> Best regards,
>>> 
>>> Nick Renders
>>> 
>>> ARC - your ICT service partner
>>> H. D. Saviolaan 8
>>> 1700 Dilbeek
>>> T: (00 32) (0)2 466 50 00
>>> F: (00 32) (0)2 466 88 33
>>> http://www.arcict.com
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list