Barcode and sever info needed

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Barcode and sever info needed

Post by quailcreek » Wed Jul 31, 2013 4:55 pm

Hi,
I have some questions regarding barcodes and scanners. Mostly how to print them and how to use the data once their scanned. Barcodes and scanners are new things for me so I’ll have some pretty rudimentary questions. I’m guessing I’m going to use code128 because I believe it allows more flexibility.

Here’s what I need to accomplish:
Print the barcodes along with prefix, the suffix on the barcode needs to be a CR I think.
One barcode to identify a person and find them in the program.
One barcode to identify the item they purchase and record the sale in the program.
I also need to capture registration and payment by CC from a website.

If I can get advice along with some code to get me started or a place I can find it that would be great.
I’m not sure if this can be handled with a computer based program or if I need to do it through a server so advice here is welcome too.
Tom
MacBook Pro OS Mojave 10.14

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Barcode and sever info needed

Post by Mark » Thu Aug 01, 2013 9:54 am

Hi,

You can download a barcode generator here http://www.milk.com/barcode/

Most barcode scanners work just like a keyboard. Make sure that the focus is on a field and the numbers will be entered automatically.

CC payment implementation is easy with paypal but probably you need a merchant account with a credit card processing company. I have experience with this. Every implementation is different and you have to ask the company for the documentation.

You'll need a website if you want people to buy on-line. You don't need a website for the bar codes, but your system might involve a server depending on your requirements. There's insufficient information to give you all the answers now.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Barcode and sever info needed

Post by bangkok » Thu Aug 01, 2013 2:24 pm

-buy a regular barcode reader (USB, CDD) (first price 30 to 50 USD)

-it's USB, so plug it into your PC /laptop. it will be recognized as a simple keyboard

-by standard, those first price scanner read 128 barcodes, so no special parameters to set

-to print your own barcode : you need to install a special font
search on google : "free barcode 128 font"
Install it, type "HELLO" in a Wordprocessor, then change the font to the barcode font.

-to read barcode in LiveCode : nothing special to do, because the reader does the decoding work and send "keyboard strokes" to the computer, therefore to Livecode.

-if you create a simple field in LiveCode, put the insertion point, and then scan a barcode, the code will be "typed" into the field

-if you want to launch a special action (for instance a special script after the reading) then you have to play with "suffix". Here, it's done at the barecode reader level (parameter to setup). LiveCode will "read" each characters "typed" by the scanner... and if the character is the special suffix you have decided then the script can launch an action.

Voilà. Not sure if I'm clear. Hope it will help you.

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Barcode and sever info needed

Post by quailcreek » Mon Aug 05, 2013 2:47 am

Sorry for not replying sooner I've been out of town with limited internet access.

Thanks, Mark,
I'll try to supply more and better information. I realize I was a bit vague. Let me digest your reply and I'll repost my question.

Thanks,
Tom
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Barcode and sever info needed

Post by quailcreek » Mon Aug 05, 2013 2:53 am

Thanks bangkok,
OK, got the hardware part, pretty simple.
128 barcode, check.
I'm sure I'm going to want to launch a special action once the barcode is read. Is there a list of the special characters and what they do? Do you have more information on how this is handled?

Thanks,
Tom
bangkok wrote:-buy a regular barcode reader (USB, CDD) (first price 30 to 50 USD)

-it's USB, so plug it into your PC /laptop. it will be recognized as a simple keyboard

-by standard, those first price scanner read 128 barcodes, so no special parameters to set

-to print your own barcode : you need to install a special font
search on google : "free barcode 128 font"
Install it, type "HELLO" in a Wordprocessor, then change the font to the barcode font.

-to read barcode in LiveCode : nothing special to do, because the reader does the decoding work and send "keyboard strokes" to the computer, therefore to Livecode.

-if you create a simple field in LiveCode, put the insertion point, and then scan a barcode, the code will be "typed" into the field

-if you want to launch a special action (for instance a special script after the reading) then you have to play with "suffix". Here, it's done at the barecode reader level (parameter to setup). LiveCode will "read" each characters "typed" by the scanner... and if the character is the special suffix you have decided then the script can launch an action.

Voilà. Not sure if I'm clear. Hope it will help you.
Tom
MacBook Pro OS Mojave 10.14

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Barcode and sever info needed

Post by bangkok » Mon Aug 05, 2013 5:51 am

Ok, the idea is the following :

-create a field "mybarcode"
-in your barcode reader, set prefix to "%" and suffix to "$". If the printed barcode is "HELLO" then the barcode reader will decode and send to LiveCode "%HELLO$". Such a scheme allow you to deal with the barcode, once scanned.

-if the first char readed by the scanner is a "%" (prefix), then the field is emptied and a var is set
-if the var is true, then all following characters will be put into the field
-... until a "%" (suffix) is catched (field is emptied again, and an action is launched)

-in your card script, type the following :

global gReadBarCode

Code: Select all

on keyDown theKey
   if thekey is "%" then
   put empty into field "myBarCode"
      put true into gReadBarCode
      exit keydown
   end if
   if gReadBarCode=true then
      put theKey after field "myBarCode"
      exit keydown
      end if
   end if
   
   if thekey is "$" and gReadBarCode=true then
           put false into gReadBarCode
      delete last char of field "myBarCode"
--- put the script to deal with your action here
      myAction
      exit to  top
    end if
end keyDown 

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Barcode and sever info needed

Post by quailcreek » Sat Aug 10, 2013 4:09 pm

Thanks a lot, Bangkok. That will get me going ing the right direction.
Tom
MacBook Pro OS Mojave 10.14

Post Reply