Author Topic: Inventory with barcode print out  (Read 4749 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris80194

  • Newbie
  • Posts: 42
    • View Profile
Inventory with barcode print out
« on: July 28, 2019, 02:38:54 pm »
Having issues sharing dim shared pos... across the entire program

Code: QB64: [Select]
  1. TYPE InventoryDataStructure
  2.     EmployeeScan AS STRING * 4
  3.     Employeename AS STRING * 60
  4.     ProductInventoryBrand AS STRING * 60
  5.     ProductInventoryNumber AS STRING * 60
  6.     ProductInventoryName AS STRING * 60
  7.     ProductInventoryWeightBegin AS _INTEGER64
  8.     ProductInventoryUPCCode AS STRING * 20
  9.     ProductInventoryCost AS _INTEGER64
  10.     ProductInventoryPurchaseDate AS STRING * 60
  11.     ProductInventoryExpirationDate AS STRING * 60
  12.     ProductInventoryWeightCheckOut AS _INTEGER64
  13.     ProductInventoryWeightCheckIn AS _INTEGER64
  14.     StockUPC AS STRING * 60
  15.     TypeofProductInventory AS STRING * 60
  16.     BatchNumber AS STRING * 60
  17.     BoxNumber AS STRING * 4
  18.     GallonorPound AS STRING * 8
  19.     InventoryCost AS STRING * 8
  20.     Room AS STRING * 60
  21.     Rack AS STRING * 60
  22.     Shelf AS STRING * 60
  23.     Bin AS STRING * 60
  24.     DT AS STRING * 60
  25.     TM AS STRING * 60
  26.     Phone AS _INTEGER64
  27. DIM SHARED ProductInventory AS InventoryDataStructure
  28. DIM array
  29. DIM SHARED pos1, pos2, linepos: pos1 = 2: linepos = 2: pos2 = 30
  30.  
  31. 'Product Constants future rewrite
  32. TYPE ProductDataStructure
  33.     EmployeeScan AS STRING * 4
  34.     Employeename AS STRING * 60
  35.     ProductInventoryBrand AS STRING * 60
  36.     ProductInventoryNumber AS STRING * 60
  37.     ProductInventoryName AS STRING * 60
  38.     ProductInventoryWeightBegin AS _INTEGER64
  39. 'DIM shared ProductPurchase AS ProductDataStructure
  40. 'OPEN ProductInventoryUPCFile$ FOR RANDOM AS #freefile LEN = LEN(ProductPurchase)
  41.  
  42. CLEAR 'Close All Open files After a Start.
  43.  
  44. 1
  45. COLOR 15, 7 'Foreground, Background  colors
  46. Author$ = "Written by Chris Owen on 6-20-2019, Email: chris.owen09@gmail.com"
  47. Title$ = "A1 Powder Coat"
  48. SerialFile$ = "Serial.csv"
  49. EmployeeFile$ = "Employee.csv"
  50. DBase$ = "ProductInventoryInventory.csv"
  51. ProductInventoryUPCFile$ = "ProductInventoryFile.csv"
  52.  
  53. LOCATE 25, 80 - LEN(Author$): PRINT Author$
  54. position = 3
  55. DO UNTIL choice$ <> ""
  56.     TTime$ = DATE$ + "_" + LEFT$(TIME$, 2) + "." + MID$(TIME$, 4, 2) + "." + RIGHT$(TIME$, 2)
  57.     LOCATE 3, 15: PRINT Title$ + " Inventory": COLOR 14, 7: LOCATE 3, 50: PRINT TTime$: COLOR 15, 7 ' only 23 lines on screen 80 wide
  58.     LOCATE 1, 80 - 5 - LEN(GetLocalIP$): COLOR 11, 7: PRINT "IP (" + GetLocalIP$ + ")": COLOR 15, 7
  59.     LOCATE 4 + position, 1: PRINT "1 Single Entry"
  60.     LOCATE 5 + position, 1: PRINT "2 Multiple Entry"
  61.     LOCATE 7 + position, 1: PRINT "E Edit Employee File " + EmployeeFile$
  62.  
  63.     LOCATE 15 + position, 1: PRINT "I RAW Edit " + DBase$ + " Passworded"
  64.     LOCATE 16 + position, 1: PRINT "V Verify Ping to Host"
  65.     LOCATE 17 + position, 1: PRINT ""
  66.  
  67.     LOCATE 19 + position, 1: PRINT "P Printer Select"
  68.     LOCATE 23, 1: PRINT "ESC to exit" ' Lock in here no lower
  69.  
  70.     choice$ = UCASE$(INKEY$) 'change any user key press to uppercase
  71.  
  72.  
  73. IF choice$ = "1" THEN CALL Part(choice$, DBase$, Title$, SerialFile$, EmployeeFile$, ProductInventoryUPCFile$)
  74. IF choice$ = "2" THEN CALL Part(choice$, DBase$, Title$, SerialFile$, EmployeeFile$, ProductInventoryUPCFile$)
  75.  
  76. IF choice$ = "I" THEN CALL Partcsv(DBase$, Title$)
  77. IF choice$ = "E" THEN CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$): GOTO 1
  78. IF choice$ = "V" THEN CALL ping
  79.  
  80. IF choice$ = "P" THEN CALL Select_Printer(Title$)
  81.  
  82. IF choice$ = CHR$(27) THEN SYSTEM
  83. choice$ = ""
  84.  
  85. SUB Part (choice$, Dbase$, Title$, Serial$, EmployeeFile$, ProductInventoryUPCFile$)
  86.     'INPUT "pause", a
  87.     OPEN Dbase$ FOR RANDOM AS #5 LEN = LEN(ProductInventory)
  88.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  89.  
  90.     444
  91.     CLS
  92.     IF UCASE$(choice$) = "2" THEN Multi = 1
  93.     choice$ = ""
  94.     COLOR 15, 5: CLS
  95.     IF Multi = 0 OR 1 THEN
  96.         LOCATE 1, 15: PRINT Title$ + " Single Entry"
  97.  
  98.     ELSE
  99.         LOCATE 1, 15: PRINT Title$ + " Multiple Entry"
  100.  
  101.     END IF
  102.     ' pos1 = 2: linepos = 2: pos2 = 30
  103.     LOCATE linepos + 20, pos1: PRINT "ESC key plus Enter to exit"; "Records " + STR$(NumRecords%)
  104.  
  105.     11
  106.     LOCATE linepos + 3, pos1: PRINT "Employee Scan"
  107.     LOCATE linepos + 3, pos2: INPUT EmployeeScan$
  108.     IF EmployeeScan$ = CHR$(27) THEN GOTO 31
  109.     CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$)
  110.  
  111.     LOCATE linepos + 2, 38: PRINT " Captured Employee Scan      " + ProductInventory.EmployeeScan + " " + ProductInventory.Employeename
  112.  
  113.     12
  114.     LOCATE linepos + 4, pos1: PRINT "ProductInventory UPC Code"
  115.     LOCATE linepos + 4, pos2: INPUT ProductInventoryUPCCode$
  116.     IF ProductInventoryUPCCode$ = "" THEN GOTO 12
  117.     IF ProductInventoryUPCCode$ = CHR$(27) THEN GOTO 31
  118.     CALL ProductInventoryFile(ProductInventoryUPCCode$, ProductInventoryBrand$, PartNumber$, ProductInventoryName$, ProductInventoryUPCFile$, linepos, pos1, pos2)
  119.  
  120.     LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT ProductInventory.ProductInventoryBrand
  121.     LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT ProductInventory.ProductInventoryName
  122.     LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT ProductInventory.ProductInventoryNumber
  123.     INPUT "pause", a
  124.     LOCATE linepos + 8, pos1: PRINT "Serialized Stock UPC": LOCATE linepos + 8, pos2: PRINT ProductInventory.StockUPC
  125.     INPUT "pause", a
  126.     LOCATE linepos + 9, pos1: PRINT "Batch Number"
  127.     LOCATE linepos + 10, pos1: PRINT "Box Number"
  128.     LOCATE linepos + 11, pos1: PRINT "Gallon or Pound"
  129.     LOCATE linepos + 12, pos1: PRINT "ProductInventory Weight"
  130.     LOCATE linepos + 13, pos1: PRINT "ProductInventory Cost"
  131.  
  132.     IF ProductInventory.ProductInventoryBrand = "" THEN LOCATE linepos + 5, pos2: INPUT ProductInventory.ProductInventoryBrand ELSE LOCATE linepos + 5, pos2: PRINT ProductInventory.ProductInventoryBrand
  133.     IF ProductInventory.ProductInventoryBrand = CHR$(27) THEN GOTO 31
  134.     IF ProductInventory.ProductInventoryName = "" THEN LOCATE linepos + 6, pos2: INPUT ProductInventory.ProductInventoryName ELSE LOCATE linepos + 7, pos2: PRINT ProductInventory.ProductInventoryName
  135.     IF ProductInventory.ProductInventoryName = CHR$(27) THEN GOTO 31
  136.     IF ProductInventory.ProductInventoryNumber = "" THEN LOCATE linepos + 7, pos2: INPUT ProductInventory.ProductInventoryNumber ELSE LOCATE linepos + 6, pos2: PRINT ProductInventory.ProductInventoryNumber
  137.     IF ProductInventory.ProductInventoryNumber = CHR$(27) THEN GOTO 31
  138.  
  139.     CALL SerialGen(Serial$)
  140.     ProductInventory.StockUPC = ProductInventory.ProductInventoryNumber + Serial$
  141.     LOCATE linepos + 8, pos1: PRINT "Serialized Stock UPC": LOCATE linepos + 8, pos2: PRINT ProductInventory.StockUPC
  142.  
  143.     LOCATE linepos + 9, pos2: INPUT ProductInventory.BatchNumber
  144.     IF ProductInventory.BatchNumber = CHR$(27) THEN GOTO 31
  145.  
  146.     LOCATE linepos + 10, pos2: INPUT ProductInventory.BoxNumber
  147.     IF ProductInventory.BoxNumber = CHR$(27) THEN GOTO 31
  148.  
  149.     LOCATE linepos + 11, pos2: INPUT ProductInventory.GallonorPound
  150.     IF ProductInventory.GallonorPound = CHR$(27) THEN GOTO 31
  151.  
  152.     LOCATE linepos + 12, pos2: INPUT ProductInventory.ProductInventoryWeightBegin
  153.  
  154.     LOCATE linepos + 13, pos2: INPUT ProductInventory.ProductInventoryCost
  155.  
  156.     LOCATE linepos + 14, pos1: PRINT "ProductInventory Purchase/Received Date"
  157.     IF ProductInventory.BoxNumber = CHR$(27) THEN GOTO 31
  158.     LOCATE linepos + 15, pos1: PRINT "ProductInventory Expiration Date"
  159.     IF ProductInventory.BoxNumber = CHR$(27) THEN GOTO 31
  160.     LOCATE linepos + 16, pos1: PRINT "ProductInventory Weight Check Out"
  161.  
  162.     LOCATE linepos + 17, pos1: PRINT "ProductInventory Weight Check In"
  163.  
  164.     LOCATE linepos + 18, pos1: PRINT "Serialized Stock UPC"
  165.  
  166.     LOCATE linepos + 19, pos1: PRINT "Type of ProductInventory"
  167.  
  168.     LOCATE linepos + 20, pos1: PRINT "Room"
  169.  
  170.     LOCATE linepos + 21, pos1: PRINT "Rack"
  171.  
  172.     LOCATE linepos + 22, pos1: PRINT "Shelf"
  173.  
  174.     LOCATE linepos + 23, pos1: PRINT "Bin"
  175.  
  176.     13
  177.     LOCATE linepos + 14, pos2: INPUT ProductInventory.ProductInventoryPurchaseDate
  178.     akey$ = ""
  179.     IF LEN(ProductInventory.ProductInventoryPurchaseDate) < 8 THEN ProductInventory.ProductInventoryPurchaseDate = LEFT$(ProductInventory.ProductInventoryPurchaseDate, 4) + "20" + RIGHT$(ProductInventory.ProductInventoryPurchaseDate, 2): ProductInventory.ProductInventoryPurchaseDate = LEFT$(ProductInventory.ProductInventoryPurchaseDate, 2) + "-" + MID$(ProductInventory.ProductInventoryPurchaseDate, 3, 2) + "-" + RIGHT$(ProductInventory.ProductInventoryPurchaseDate, 4)
  180.     LOCATE linepos + 14, pos2: PRINT "? " + ProductInventory.ProductInventoryPurchaseDate
  181.     LOCATE linepos + 14, pos2 + 13: PRINT "Correct N/Y ?"
  182.     DO
  183.         akey$ = INKEY$
  184.         IF UCASE$(akey$) = "N" THEN LOCATE linepos + 10, pos2: PRINT "                              ": GOTO 13
  185.     LOOP WHILE akey$ = ""
  186.  
  187.     14
  188.     LOCATE linepos + 15, pos2: INPUT ProductInventory.ProductInventoryExpirationDate
  189.     akey$ = ""
  190.     IF LEN(ProductInventory.ProductInventoryExpirationDate) < 8 THEN ProductInventory.ProductInventoryExpirationDate = LEFT$(ProductInventory.ProductInventoryExpirationDate, 4) + "20" + RIGHT$(ProductInventory.ProductInventoryExpirationDate, 2): ProductInventory.ProductInventoryExpirationDate = LEFT$(ProductInventory.ProductInventoryExpirationDate, 2) + "-" + MID$(ProductInventory.ProductInventoryExpirationDate, 3, 2) + "-" + RIGHT$(ProductInventory.ProductInventoryExpirationDate, 4)
  191.     LOCATE linepos + 15, pos2: PRINT "? " + ProductInventory.ProductInventoryExpirationDate
  192.     LOCATE linepos + 15, pos2 + 13: PRINT "Correct N/Y ?"
  193.     DO
  194.         akey$ = INKEY$
  195.         IF UCASE$(akey$) = "N" THEN LOCATE linepos + 11, pos2: PRINT "                              ": GOTO 14
  196.     LOOP WHILE akey$ = ""
  197.  
  198.     LOCATE linepos + 16, pos2: INPUT ProductInventory.ProductInventoryWeightCheckOut
  199.     LOCATE linepos + 17, pos2: INPUT ProductInventory.ProductInventoryWeightCheckIn
  200.     LOCATE linepos + 18, pos2: INPUT ProductInventory.TypeofProductInventory
  201.     LOCATE linepos + 19, pos2: INPUT ProductInventory.Room
  202.     LOCATE linepos + 20, pos2: INPUT ProductInventory.Rack
  203.     LOCATE linepos + 21, pos2: INPUT ProductInventory.Shelf
  204.     LOCATE linepos + 22, pos2: INPUT ProductInventory.Bin
  205.     LOCATE linepos + 24, pos1: PRINT "Only C Cancels Entry anything else to save"
  206.     DO
  207.         akey$ = INKEY$
  208.         IF UCASE$(akey$) = UCASE$("C") THEN Cancel = 1
  209.     LOOP WHILE akey$ = ""
  210.     akey$ = ""
  211.  
  212.     IF Multi = 1 THEN
  213.         LOCATE linepos + 20, pos1: PRINT "ESC to Save Last Entry and Exit"
  214.         DO
  215.             akey$ = INKEY$
  216.             IF UCASE$(akey$) = CHR$(27) THEN Last$ = "yes"
  217.         LOOP WHILE akey$ = ""
  218.     END IF
  219.     akey$ = ""
  220.  
  221.     ProductInventory.TM = TIME$: ProductInventory.DT = DATE$
  222.  
  223.     300
  224.     IF Cancel = 1 THEN GOTO 444
  225.     'IF Multi = 0 OR 1 THEN
  226.     OPEN SerialFile$ FOR OUTPUT AS #2
  227.  
  228.     'Add Inventory
  229.     Discpass$ = ProductInventory.ProductInventoryName
  230.     Datapass$ = ProductInventory.StockUPC
  231.     EXP$ = ProductInventory.ProductInventoryExpirationDate
  232.     Pass$ = ProductInventory.ProductInventoryNumber
  233.  
  234.     CALL Barcode(Datapass$, Discpass$, Title$, Pass$, EXP$)
  235.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  236.     PUT #5, NumRecords% + 1, ProductInventory
  237.  
  238.     'Increment Serial Number
  239.     CALL SerialGen(Serial$)
  240.  
  241.     IF Multi = 1 AND NOT Last$ = "yes" THEN 444
  242.    31
  243.  
  244. SUB Select_Printer (Title$)
  245.     Pos10 = 15
  246.     CLS
  247.     COLOR 15, 0
  248.     SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt"
  249.     DIM impresora(50) AS STRING
  250.     OPEN "I", 10, "impresora.txt"
  251.     n% = 0
  252.     LINE INPUT #10, dato$
  253.     DO
  254.         LINE INPUT #10, dato$: LINE INPUT #10, dato$
  255.         IF EOF(10) THEN EXIT DO
  256.         n% = n% + 1
  257.         DO
  258.             a% = INSTR(dato$, CHR$(0))
  259.             IF a% = 0 THEN EXIT DO
  260.             IF a% = 1 THEN
  261.                 dato$ = MID$(dato$, a% + 1)
  262.             ELSEIF a% = LEN(dato$) THEN
  263.                 dato$ = LEFT$(dato$, a% - 1)
  264.             ELSE
  265.                 dato$ = LEFT$(dato$, a% - 1) + MID$(dato$, a% + 1)
  266.             END IF
  267.         LOOP
  268.         a% = INSTR(dato$, "FALSE"): b% = INSTR(dato$, "TRUE")
  269.         IF a% <> 0 THEN
  270.             MID$(dato$, a%, 5) = SPACE$(5)
  271.             dato$ = LTRIM$(RTRIM$(dato$))
  272.         END IF
  273.         IF b% <> 0 THEN
  274.             MID$(dato$, b%, 5) = SPACE$(4)
  275.             dato$ = LTRIM$(RTRIM$(dato$))
  276.             loca% = n%
  277.         END IF
  278.         impresora(n%) = dato$
  279.         impresora(0) = LTRIM$(STR$(n%))
  280.     LOOP
  281.     COLOR 7, 0
  282.     CLS
  283.     COLOR 1, 7
  284.     LOCATE 8, Pos10 - 1: PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
  285.     LOCATE 9, Pos10 - 1: PRINT "º                                        º"
  286.     LOCATE 10, Pos10 - 1: PRINT "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹"
  287.     LOCATE 11, Pos10 - 1: PRINT "º                                        º"
  288.     LOCATE 12, Pos10 - 1: PRINT "º                                        º"
  289.     LOCATE 13, Pos10 - 1: PRINT "º                                        º"
  290.     LOCATE 14, Pos10 - 1: PRINT "º                                        º"
  291.     LOCATE 15, Pos10 - 1: PRINT "º                                        º"
  292.     LOCATE 16, Pos10 - 1: PRINT "ÈÍÍÍÍÍÍÍ<Esc>ÍÍÍÍ<"; CHR$(24); ">Í<"; CHR$(25); ">ÍÍÍÍ<"; CHR$(17); CHR$(217); ">ÍÍÍÍÍÍÍÍͼ"
  293.     COLOR 15, 1
  294.     LOCATE 9, Pos10: PRINT "            SELECT PRINTER              ";
  295.     COLOR 1, 7
  296.     max% = VAL(impresora(0))
  297.     GOSUB impridatos
  298.     DO
  299.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  300.         x$ = UCASE$(x$)
  301.         x% = ASC(RIGHT$(x$, 1))
  302.         SELECT CASE x%
  303.             CASE IS = 27
  304.                 a$ = "@"
  305.                 EXIT DO
  306.             CASE IS = 13
  307.                 a$ = impresora(loca%)
  308.                 EXIT DO
  309.             CASE IS = 72: '--Subir
  310.                 IF loca% > 1 THEN
  311.                     loca% = loca% - 1
  312.                     GOSUB impridatos
  313.                 END IF
  314.             CASE IS = 80: '--Bajar
  315.                 IF loca% < max% THEN
  316.                     loca% = loca% + 1
  317.                     GOSUB impridatos
  318.                 END IF
  319.         END SELECT
  320.     LOOP
  321.     COLOR 7, 0
  322.     CLS
  323.     IF a$ <> "@" THEN
  324.         SHELL _HIDE "cmd/c wmic printer where name='" + a$ + "' call setdefaultprinter"
  325.         PRINT "Selected printer: "; a$
  326.     ELSE
  327.         PRINT "The printer has not been modified"
  328.     END IF
  329.     GOTO 700
  330.     impridatos:
  331.     y% = 1
  332.     FOR n% = loca% - 2 TO loca% + 2
  333.         IF n% < 1 OR n% > max% THEN
  334.             COLOR 1, 7: LOCATE y% + 10, Pos10: PRINT "                                        "
  335.         ELSE
  336.             IF n% = loca% THEN COLOR 15, 4 ELSE COLOR 1, 7
  337.             LOCATE y% + 10, Pos10: PRINT "                                        "
  338.             LOCATE y% + 10, Pos10: PRINT LEFT$(impresora(n%), 40)
  339.         END IF
  340.         y% = y% + 1
  341.     NEXT
  342.     RETURN
  343.    700
  344.     CLOSE 10
  345.  
  346. FUNCTION GetLocalIP$
  347.     choice$ = ""
  348.     SHELL _HIDE "cmd /c ipconfig > IPconfig.tmp"
  349.     A = FREEFILE
  350.     OPEN "IPconfig.tmp" FOR INPUT AS #A
  351.     DO
  352.         LINE INPUT #A, ipline$
  353.         IF UCASE$(LEFT$(LTRIM$(ipline$), 4)) = "IPV4" THEN
  354.             GetLocalIP$ = MID$(ipline$, INSTR(ipline$, ":") + 2)
  355.             IF GetLocalIP$ = "127.0.0.1" THEN GetLocalIP$ = "offline": GOTO 77
  356.             '         CLOSE #A
  357.             '         KILL "IPconfig.tmp" 'kill the messenger?
  358.             EXIT DO
  359.            77
  360.         END IF
  361.     LOOP UNTIL EOF(1)
  362.     CLOSE #A
  363.     KILL "IPconfig.tmp" 'kill the messenger?
  364.  
  365.  
  366. SUB ping
  367.     ' Shell to ping and get results 0 up 1 down
  368.     INPUT "Host to ping? ", ip$
  369.     IF ip$ = "" GOTO 777
  370.     result& = _SHELLHIDE("ping " + ip$ + " -n 1 -w 100")
  371.     IF result& = 0 THEN
  372.         'success
  373.         COLOR 2, 15
  374.         PRINT DATE$ + " " + TIME$ + " " + " Ping ("; ip$; ") "; "UP   ";
  375.         COLOR 7, 1
  376.     ELSE
  377.         COLOR 4, 15
  378.         PRINT DATE$ + " " + TIME$ + " " + " Ping ("; ip$; ") "; "DN   ";
  379.         COLOR 7, 1
  380.         REM PRINT #2, DATE$ + " " + TIME$ + " " + "Ping (" + ip$ + ") (" + desc$ + ")" + "   Down": flag = 1: set = 0
  381.     END IF
  382.     flag = 1: set = 0
  383.     INPUT "pause", ip$
  384.    777
  385.  
  386. SUB Partcsv (DBase$, Title$)
  387.     CLS: LOCATE 6
  388.     PRINT "Whoa there pardner, lets make sure you are authorized to be here."
  389.     INPUT "Enter the User name? ", User$
  390.     INPUT "Enter the Password? ", Password$
  391.     IF UCASE$(User$) <> "CHRIS" AND Password$ <> "Rdg09Dgr!$@#" THEN
  392.         PRINT "Sorry you are not allowed to be in here, lets get you somewhere safe"
  393.         PRINT "Press any key to continue"
  394.         DO
  395.             akey$ = INKEY$
  396.             IF UCASE$(akey$) <> "" THEN EXIT SUB
  397.         LOOP WHILE akey$ = ""
  398.     END IF
  399.     SHELL "notepad " + DBase$
  400.  
  401.  
  402. SUB Choicea
  403.     ' OPEN Dbase$ FOR APPEND AS #1
  404.     ' WRITE #1, EmployeeScan$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryWeightBegin$, ProductInventoryUPCCode$, ProductInventoryCost$, ProductInventory.ProductInventoryPurchaseDate, ProductInventory.ProductInventoryExpirationDate, ProductInventoryWeightCheckOut$, ProductInventoryWeightCheckIn$, StockUPC$, TypeofProductInventory$, Rack$, Shelf$, Bin$, DT$, TM$, a10$, a11$, a12$, b10$, b11$, b12$, c10$, c11$, c12$, d10$, d11$, d12$, e10$, e11$, e12$, f10$, f11$, f12$
  405.  
  406.  
  407.     IF Station$ = "?" THEN CALL Partcsv(Dbase$, Title$)
  408.     IF Station$ = "1" THEN Station$ = "1": GOTO 12
  409.     IF Station$ = "2" THEN Station$ = "2": GOTO 12
  410.     IF Station$ = "3" THEN Station$ = "3": GOTO 12
  411.     IF Station$ = "4" THEN Station$ = "4": GOTO 12
  412.     IF Station$ = "5" THEN Station$ = "5": GOTO 12
  413.     IF Station$ = "6" THEN Station$ = "6": GOTO 12
  414.     IF Station$ = "7" THEN Station$ = "7": GOTO 12
  415.     IF Station$ = "8" THEN Station$ = "8": GOTO 12
  416.     IF Station$ = "9" THEN Station$ = "9": GOTO 12
  417.     IF Station$ = "1O" THEN Station$ = "10": GOTO 12
  418.     IF Station$ = "11" THEN Station$ = "11": GOTO 12
  419.     IF Station$ = "12" THEN Station$ = "12": GOTO 12
  420.     IF Station$ = "13" THEN Station$ = "13": GOTO 12
  421.     IF Station$ = "14" THEN Station$ = "14": GOTO 12
  422.     IF Station$ = "15" THEN Station$ = "15": GOTO 12
  423.     IF Station$ = CHR$(27) THEN GOTO 31
  424.  
  425.     DO
  426.  
  427.         LOCATE 19, 1: PRINT "Choose a Line to input: "; 'semicolon saves position for user entry
  428.  
  429.         DO: keypress$ = UCASE$(INKEY$) 'change any user key press to uppercase
  430.  
  431.         LOOP UNTIL keypress$ <> ""
  432.         COLOR 15, 1: PRINT keypress$
  433.         Station$ = keypress$
  434.         GOTO 12
  435.  
  436.     LOOP
  437.  
  438.     12
  439.     CLS
  440.     LOCATE 1, 20: PRINT Title$ + " Part": LOCATE 1, pos2: PRINT " Display" + STR$(Multi)
  441.     IF keypress$ = "O" THEN LOCATE 2, 2: INPUT ; "Station ?", Station$
  442.    31
  443.  
  444. SUB Employee (EmployeeScan$, EmployeeName$, EmployeeFile$)
  445.     LinepPos = 5
  446.     EF = FREEFILE
  447.     OPEN EmployeeFile$ FOR INPUT AS #EF
  448.  
  449.     'LOCATE Linepos + 11, pos2: INPUT "Number ", EmployeeScan$
  450.    651
  451.     DO WHILE NOT EOF(EF)
  452.         INPUT #EF, A$, B$, C$, D$
  453.         IF EmployeeScan$ = A$ THEN
  454.             EmployeeName$ = B$
  455.             ProductInventory.EmployeeScan = EmployeeScan$
  456.             ProductInventory.Employeename = EmployeeName$
  457.             EXIT DO
  458.         END IF
  459.     LOOP
  460.     IF EmployeeName$ <> "" THEN GOTO 657
  461.    652
  462.  
  463.     LOCATE linepos + 30, pos2: PRINT "Employee Maintance"
  464.     LOCATE linepos + 31, pos2: PRINT "Name ", EmployeeName$
  465.     LOCATE linepos + 32, pos2: PRINT "Number ", EmployeeScan$
  466.     LOCATE linepos + 34, pos2: PRINT "Do you need to Edit?"
  467.     LOCATE linepos + 35, pos2: PRINT "  (A)dd Restart, (N)umber, (E)mployee, then finaly (S)ave, (ESC) all changes"
  468.     DO
  469.         akey$ = INKEY$
  470.         IF UCASE$(akey$) = "N" THEN GOTO 653
  471.         IF UCASE$(akey$) = "E" THEN GOTO 654
  472.         IF UCASE$(akey$) = "A" THEN GOTO 655
  473.         IF UCASE$(akey$) = "S" THEN GOTO 656
  474.         IF UCASE$(akey$) = CHR$(27) THEN GOTO 657
  475.     LOOP WHILE akey$ = ""
  476.  
  477.     653
  478.  
  479.     LOCATE linepos + 30, pos2: PRINT "Change Employee Number"
  480.     LOCATE linepos + 31, pos2: PRINT "Name ", EmployeeName$
  481.     LOCATE linepos + 32, pos2: INPUT "Number ", EmployeeScan$
  482.     C$ = TIME$ + "-" + DATE$
  483.     GOTO 651
  484.  
  485.  
  486.     654
  487.  
  488.     LOCATE linepos + 30, pos2: PRINT "Change Employee Name"
  489.     LOCATE linepos + 31, pos2: PRINT "Number ", EmployeeScan$
  490.     LOCATE linepos + 32, pos2: INPUT "Name ", EmployeeName$
  491.     C$ = TIME$ + "-" + DATE$
  492.     GOTO 651
  493.  
  494.     655
  495.  
  496.     LOCATE linepos + 30, pos2: PRINT "Add New Employee"
  497.     LOCATE linepos + 31, pos2: INPUT "Number ", EmployeeScan$
  498.     LOCATE linepos + 32, pos2: INPUT "Name ", EmployeeName$
  499.     C$ = TIME$ + "-" + DATE$
  500.     IF D$ = "" THEN D$ = C$
  501.     GOTO 651
  502.  
  503.     656
  504.     CLOSE #EF: OPEN EmployeeFile$ FOR APPEND AS #EF
  505.     WRITE #EF, EmployeeScan$, EmployeeName$, C$, D$
  506.     CLOSE #EF
  507.    657
  508.     CLOSE #EF
  509.  
  510.  
  511. SUB ProductInventoryFile (ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryUPCFile$, linepos, pos1, pos2)
  512.     PIF = FREEFILE
  513.     IF _FILEEXISTS(ProductInventoryUPCFile$) THEN OPEN ProductInventoryUPCFile$ FOR INPUT AS #PIF ELSE GOTO 555
  514.     IF ProductInventoryUPCCode$ = CHR$(27) THEN EXIT SUB
  515.    553
  516.     DO WHILE NOT EOF(PIF)
  517.         INPUT #PIF, A$, B$, C$, D$
  518.         IF ProductInventoryUPCCode$ = A$ THEN
  519.             ProductInventoryBrand$ = B$
  520.             ProductInventoryNumber$ = C$
  521.             ProductInventoryName$ = D$
  522.             CLOSE #PIF
  523.             GOTO 554
  524.         END IF
  525.     LOOP
  526.  
  527.     555
  528.     CLOSE #PIF
  529.     OPEN ProductInventoryUPCFile$ FOR APPEND AS #PIF
  530.     LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT ProductInventory.ProductInventoryBrand
  531.     LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT ProductInventory.ProductInventoryName
  532.     LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT ProductInventory.ProductInventoryNumber
  533.  
  534.     LOCATE linepos + 5, pos2: INPUT ProductInventoryBrand$
  535.     LOCATE linepos + 6, pos2: INPUT ProductInventoryName$
  536.     LOCATE linepos + 7, pos2: INPUT ProductInventoryNumber$
  537.     WRITE #PIF, ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$
  538.     CLOSE #PIF
  539.  
  540.     554
  541.     ProductInventory.ProductInventoryUPCCode = ProductInventoryUPCCode$
  542.     ProductInventory.ProductInventoryBrand = ProductInventoryBrand$
  543.     ProductInventory.ProductInventoryNumber = PartNumber$
  544.     ProductInventory.ProductInventoryName = ProductInventoryName$
  545.  
  546.  
  547. SUB Barcode (DATAPASS$, DISCPASS$, Title$, Pass$, EXP$)
  548.  
  549.  
  550.     ' DATAPASS$ = "123456789"
  551.     DATAPASS$ = "*" + DATAPASS$ + "*"
  552.     'EXP$ = "07/12/1900"
  553.     'DISCPASS$ = "Black Powder"
  554.  
  555.     'Pass$ = "ASDFEWEW"
  556.  
  557.     'Page
  558.     FFONT$ = "free3of9x.ttf": FFSize = 120
  559.     EFONT$ = "Arial.ttf": EFSize = 60
  560.     AFONT$ = "Arial.ttf": AFSize = 60
  561.     PageWidth = 216 * 10
  562.     PageHeight = 279 * 10
  563.  
  564.     'Label designerd for the Brother 201 (29mm x 90mm or 1-1/7" x 3-1/2") / Zebra ZDesigner LP 2844 looks compatable.
  565.     FFONT$ = "free3of9x.ttf": FFSize = 240
  566.     EFONT$ = "Arial.ttf": EFSize = 35
  567.     AFONT$ = "Arial.ttf": AFSize = 20
  568.     PageWidth = 110 * 10 'maximized tweaks for whole label
  569.     PageHeight = 29 * 10 'Max is already set do not change.
  570.  
  571.     Colum = 10
  572.     a = 0
  573.     RowA = 70 'Barcode on top of Custom description
  574.     RowB = 45 'ProductInventory Description Above Barcode
  575.     RowC = 0 'Custom Description line below Barcode
  576.  
  577.     SCREEN _NEWIMAGE(PageWidth, PageHeight, 13)
  578.     _DEST Page&: CLS _RGB(1, 1, 1), _RGB(256, 256, 256): _DEST 0 'make background white to save ink!
  579.     COLOR
  580.     F& = _LOADFONT(FFONT$, FFSize)
  581.     E& = _LOADFONT(EFONT$, EFSize)
  582.     A& = _LOADFONT(AFONT$, AFSize)
  583.  
  584.     _FONT F&
  585.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, RowB), DATAPASS$ ' Print upc bars on bottom of label
  586.  
  587.     _FONT E&
  588.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (400, RowC), Title$ ' Print Line 1 description
  589.  
  590.     _FONT A&
  591.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, RowC + 25), DISCPASS$ ' Print Line 2 ProductInventory description
  592.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, RowC + 85), Pass$ ' Print Line 3 ProductInventory description
  593.  
  594.     _FONT A&
  595.     keep = LEN(DATAPASS$): DATAPASS$ = MID$(DATAPASS$, 2, keep - 2)
  596.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, RowC), "Serial " + DATAPASS$ ' Print upc bar information above bar scan font
  597.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (925, RowC), "Use By " + EXP$ ' Print Product Expiry Date
  598.  
  599.     INPUT a
  600.     _PRINTIMAGE 0 'print screen page on printer
  601.     SCREEN 0
  602.  
  603. SUB SerialGen (serial$)
  604.     SN = FREEFILE
  605.     Exists = _FILEEXISTS("SerialFile.txt")
  606.     IF Exists = 0 THEN
  607.         OPEN "SerialFile.txt" FOR OUTPUT AS #SN
  608.         serial$ = "000000000"
  609.         PRINT #SN, serial$
  610.         CLOSE #SN
  611.     END IF
  612.     OPEN "SerialFile.txt" FOR INPUT AS #SN
  613.     INPUT #SN, serial$: CLOSE #SN
  614.     SSerial$ = LEFT$(serial$, 1)
  615.     ISerial = VAL(serial$)
  616.     ISerial = ISerial + 1:
  617.     ISerial$ = LTRIM$(STR$(ISerial))
  618.     DO UNTIL LEN(ISerial$) = 9
  619.         ISerial$ = "0" + ISerial$
  620.     LOOP
  621.     OPEN "SerialFile.txt" FOR OUTPUT AS #SN
  622.     serial$ = SSerial$ + ISerial$
  623.     PRINT #SN, serial$
  624.     CLOSE #SN
  625.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Inventory with barcode print out
« Reply #1 on: July 28, 2019, 02:58:25 pm »
Code: QB64: [Select]
  1. DIM SHARED pos1, pos2, linepos: pos1 = 2: linepos = 2: pos2 = 30

I don't think colons a good idea for this line, I think it is equivalent to:
Code: QB64: [Select]
  1. DIM SHARED pos1, pos2, linepos
  2. pos1 = 2
  3. linepos = 2
  4. pos2 = 30

Oh wait, your are just making assignments... but still if you are having problems... try the equivalent.

Update: well that's not it by my simple test!

Looks like you are updating an old GOTO program, I see line numbers everywhere. OPTION _EXPLICIT can help track down typo's or misnamed renamimg...
« Last Edit: July 28, 2019, 03:21:55 pm by bplus »

Offline Chris80194

  • Newbie
  • Posts: 42
    • View Profile
Re: Inventory with barcode print out
« Reply #2 on: July 28, 2019, 05:48:51 pm »
LOL its a brand new program LOL
Im old goto school from GWbasic
My coding is more like a monkey in a cage tossing feces around to see what sticks.
but it is coming together.
Ill try that tip.
Thanks.

Offline Chris80194

  • Newbie
  • Posts: 42
    • View Profile
Re: Inventory with barcode print out
« Reply #3 on: July 28, 2019, 05:57:12 pm »
Ok so I have been bouncing around in the program pounding keys and this is what I found so far.
I think the screen size might be the major issue with line and column positioning.  The type declare has 60 positions for each part I need to reduce the fields some on many parts as a field that has only 8 letters does not need 60 places.
I do like the suggestion given and added it to the top so I can throw it as needed  'OPTION _EXPLICIT
The goal is to make each sub do its part without needing to rewrite each part twice aith tweaks.


Code: QB64: [Select]
  1. CLEAR 'OPTION _EXPLICIT
  2. TYPE InventoryDataStructure
  3.     EmployeeScan AS STRING * 4
  4.     Employeename AS STRING * 60
  5.     ProductInventoryBrand AS STRING * 60
  6.     ProductInventoryNumber AS STRING * 60
  7.     ProductInventoryName AS STRING * 60
  8.     ProductInventoryWeightBegin AS _INTEGER64
  9.     ProductInventoryUPCCode AS STRING * 20
  10.     ProductInventoryCost AS _INTEGER64
  11.     ProductInventoryPurchaseDate AS STRING * 60
  12.     ProductInventoryExpirationDate AS STRING * 60
  13.     ProductInventoryWeightCheckOut AS _INTEGER64
  14.     ProductInventoryWeightCheckIn AS _INTEGER64
  15.     StockUPC AS STRING * 60
  16.     TypeofProductInventory AS STRING * 60
  17.     BatchNumber AS STRING * 60
  18.     BoxNumber AS STRING * 4
  19.     GallonorPound AS STRING * 8
  20.     InventoryCost AS STRING * 8
  21.     Room AS STRING * 60
  22.     Rack AS STRING * 60
  23.     Shelf AS STRING * 60
  24.     Bin AS STRING * 60
  25.     DT AS STRING * 60
  26.     TM AS STRING * 60
  27.     Phone AS _INTEGER64
  28. DIM SHARED ProductInventory AS InventoryDataStructure
  29. DIM SHARED pos1, pos2, linepos: pos1 = 2: linepos = 1: pos2 = 30
  30.  
  31. 'Product Constants future rewrite
  32. TYPE ProductDataStructure
  33.     EmployeeScan AS STRING * 4
  34.     Employeename AS STRING * 60
  35.     ProductInventoryBrand AS STRING * 60
  36.     ProductInventoryNumber AS STRING * 60
  37.     ProductInventoryName AS STRING * 60
  38.     ProductInventoryWeightBegin AS _INTEGER64
  39. 'DIM shared ProductPurchase AS ProductDataStructure
  40. 'OPEN ProductInventoryUPCFile$ FOR RANDOM AS #freefile LEN = LEN(ProductPurchase)
  41.  
  42. CLEAR 'Close All Open files After a Start.
  43.  
  44. 1
  45. COLOR 15, 7 'Foreground, Background  colors
  46. Author$ = "Written by Chris Owen on 6-20-2019, Email: chris.owen09@gmail.com"
  47. Title$ = "A1 Powder Coat"
  48. EmployeeFile$ = "Employee.csv"
  49. DBase$ = "ProductInventoryStock.RND"
  50. ProductInventoryUPCFile$ = "ProductInventoryFile.csv"
  51.  
  52. LOCATE 25, 80 - LEN(Author$): PRINT Author$
  53. position = 3
  54. DO UNTIL choice$ <> ""
  55.     TTime$ = DATE$ + "_" + LEFT$(TIME$, 2) + "." + MID$(TIME$, 4, 2) + "." + RIGHT$(TIME$, 2)
  56.     LOCATE 3, 15: PRINT Title$ + " Inventory": COLOR 14, 7: LOCATE 3, 50: PRINT TTime$: COLOR 15, 7 ' only 23 lines on screen 80 wide
  57.     LOCATE 1, 80 - 5 - LEN(GetLocalIP$): COLOR 11, 7: PRINT "IP (" + GetLocalIP$ + ")": COLOR 15, 7
  58.     LOCATE 4 + position, 1: PRINT "1 Single Entry"
  59.     LOCATE 5 + position, 1: PRINT "2 Multiple Entry"
  60.     LOCATE 7 + position, 1: PRINT "E Edit Employee File " + EmployeeFile$
  61.  
  62.     LOCATE 15 + position, 1: PRINT "I RAW Edit " + DBase$ + " Passworded"
  63.     LOCATE 16 + position, 1: PRINT "V Verify Ping to Host"
  64.     LOCATE 17 + position, 1: PRINT ""
  65.  
  66.     LOCATE 19 + position, 1: PRINT "P Printer Select"
  67.     LOCATE 23, 1: PRINT "ESC to exit" ' Lock in here no lower
  68.  
  69.     choice$ = UCASE$(INKEY$) 'change any user key press to uppercase
  70.  
  71.  
  72. IF choice$ = "1" THEN CALL Part(choice$, DBase$, Title$, SerialFile$, EmployeeFile$, ProductInventoryUPCFile$)
  73. IF choice$ = "2" THEN CALL Part(choice$, DBase$, Title$, SerialFile$, EmployeeFile$, ProductInventoryUPCFile$)
  74.  
  75. IF choice$ = "I" THEN CALL Partcsv(DBase$, Title$)
  76. IF choice$ = "E" THEN CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$): GOTO 1
  77. IF choice$ = "V" THEN CALL ping
  78.  
  79. IF choice$ = "P" THEN CALL Select_Printer(Title$)
  80.  
  81. IF choice$ = CHR$(27) THEN SYSTEM
  82. choice$ = ""
  83.  
  84. SUB Part (choice$, Dbase$, Title$, Serial$, EmployeeFile$, ProductInventoryUPCFile$)
  85.     'INPUT "pause", a
  86.     pos1 = 2: linepos = 2: pos2 = 30
  87.     OPEN Dbase$ FOR RANDOM AS #5 LEN = LEN(ProductInventory)
  88.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  89.  
  90.     444
  91.     CLS
  92.     IF UCASE$(choice$) = "2" THEN Multi = 1
  93.     choice$ = ""
  94.     COLOR 15, 5: CLS
  95.     IF Multi = 0 OR 1 THEN
  96.         LOCATE 1, 15: PRINT Title$ + " Single Entry"; " Records " + STR$(NumRecords%)
  97.  
  98.     ELSE
  99.         LOCATE 1, 15: PRINT Title$ + " Multiple Entry"; " Records " + STR$(NumRecords%)
  100.  
  101.     END IF
  102.  
  103.     LOCATE linepos + 21, pos1: PRINT "ESC key plus Enter to exit"
  104.  
  105.     11
  106.     LOCATE linepos + 3, pos1: PRINT "Employee Scan"
  107.     LOCATE linepos + 3, pos2: INPUT EmployeeScan$
  108.     IF EmployeeScan$ = CHR$(27) THEN GOTO 31
  109.     CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$)
  110.  
  111.     LOCATE linepos + 3, pos1: PRINT "Captured Employee Scan      #" + RTRIM$(ProductInventory.EmployeeScan) + " " + RTRIM$(ProductInventory.Employeename)
  112.  
  113.     12
  114.     LOCATE linepos + 4, pos1: PRINT "ProductInventory UPC Code"
  115.     LOCATE linepos + 4, pos2: INPUT ProductInventoryUPCCode$
  116.     IF ProductInventoryUPCCode$ = "" THEN GOTO 12
  117.     IF ProductInventoryUPCCode$ = CHR$(27) THEN GOTO 31
  118.     CALL ProductInventoryFile(ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryUPCFile$, linepos, pos1, pos2)
  119.  
  120.     LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT RTRIM$(ProductInventory.ProductInventoryBrand)
  121.     LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT RTRIM$(ProductInventory.ProductInventoryName)
  122.     LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT RTRIM$(ProductInventory.ProductInventoryNumber)
  123.     CALL SerialGen(Serial$): ProductInventory.StockUPC = Serial$ + "-" + RTRIM$(ProductInventory.ProductInventoryNumber)
  124.     LOCATE linepos + 8, pos1: PRINT "Serialized Stock UPC": LOCATE linepos + 8, pos2: PRINT RTRIM$(ProductInventory.StockUPC)
  125.     LOCATE linepos + 9, pos1: PRINT "Batch Number"
  126.     LOCATE linepos + 10, pos1: PRINT "Box Number"
  127.     LOCATE linepos + 11, pos1: PRINT "Measured as Gallon or Pound"
  128.     LOCATE linepos + 12, pos1: PRINT "Weight"
  129.     LOCATE linepos + 13, pos1: PRINT "Cost"
  130.  
  131.     LOCATE linepos + 9, pos2: INPUT ProductInventory.BatchNumber
  132.     IF ProductInventory.BatchNumber = CHR$(27) THEN GOTO 31
  133.  
  134.     LOCATE linepos + 10, pos2: INPUT ProductInventory.BoxNumber
  135.     IF ProductInventory.BoxNumber = CHR$(27) THEN GOTO 31
  136.    22
  137.     LOCATE linepos + 11, pos2: PRINT "?"
  138.     GallonorPound$ = INKEY$
  139.     IF UCASE$(GallonorPound$) = "G" THEN GallonorPound$ = "GALLON": GOTO 21
  140.     IF UCASE$(GallonorPound$) = "P" THEN GallonorPound$ = "POUND": GOTO 21
  141.     IF GallonorPound$ = CHR$(27) THEN GOTO 31
  142.     GOTO 22
  143.    21
  144.     ProductInventory.GallonorPound = GallonorPound$
  145.     LOCATE linepos + 11, pos2: PRINT RTRIM$(ProductInventory.GallonorPound)
  146.  
  147.     LOCATE linepos + 12, pos2: INPUT ProductInventory.ProductInventoryWeightBegin
  148.  
  149.     LOCATE linepos + 13, pos2: INPUT ProductInventory.ProductInventoryCost
  150.  
  151.     LOCATE linepos + 14, pos1: PRINT "Purchase/Received Date"
  152.     IF ProductInventory.BoxNumber = CHR$(27) THEN GOTO 31
  153.     LOCATE linepos + 15, pos1: PRINT "Expiration Date"
  154.     IF ProductInventory.BoxNumber = CHR$(27) THEN GOTO 31
  155.  
  156.     LOCATE linepos + 16, pos1: PRINT "Type of Product Dry or Wet"
  157.  
  158.     LOCATE linepos + 17, pos1: PRINT "Room"
  159.  
  160.     LOCATE linepos + 18, pos1: PRINT "Rack"
  161.  
  162.     LOCATE linepos + 19, pos1: PRINT "Shelf"
  163.  
  164.     LOCATE linepos + 20, pos1: PRINT "Bin"
  165.  
  166.     13
  167.     LOCATE linepos + 14, pos2: INPUT ProductInventory.ProductInventoryPurchaseDate
  168.     akey$ = ""
  169.     IF LEN(ProductInventory.ProductInventoryPurchaseDate) < 8 THEN ProductInventory.ProductInventoryPurchaseDate = LEFT$(ProductInventory.ProductInventoryPurchaseDate, 4) + "20" + RIGHT$(ProductInventory.ProductInventoryPurchaseDate, 2): ProductInventory.ProductInventoryPurchaseDate = LEFT$(ProductInventory.ProductInventoryPurchaseDate, 2) + "-" + MID$(ProductInventory.ProductInventoryPurchaseDate, 3, 2) + "-" + RIGHT$(ProductInventory.ProductInventoryPurchaseDate, 4)
  170.     LOCATE linepos + 14, pos2: PRINT "? " + RTRIM$(ProductInventory.ProductInventoryPurchaseDate)
  171.     LOCATE linepos + 14, pos2 + 13: PRINT "Correct N/Y ?"
  172.     DO
  173.         akey$ = INKEY$
  174.         IF UCASE$(akey$) = "N" THEN LOCATE linepos + 10, pos2: PRINT "                              ": GOTO 13
  175.     LOOP WHILE akey$ = ""
  176.  
  177.     14
  178.     LOCATE linepos + 15, pos2: INPUT ProductInventory.ProductInventoryExpirationDate
  179.     akey$ = ""
  180.     IF LEN(ProductInventory.ProductInventoryExpirationDate) < 8 THEN ProductInventory.ProductInventoryExpirationDate = LEFT$(ProductInventory.ProductInventoryExpirationDate, 4) + "20" + RIGHT$(ProductInventory.ProductInventoryExpirationDate, 2): ProductInventory.ProductInventoryExpirationDate = LEFT$(ProductInventory.ProductInventoryExpirationDate, 2) + "-" + MID$(ProductInventory.ProductInventoryExpirationDate, 3, 2) + "-" + RIGHT$(ProductInventory.ProductInventoryExpirationDate, 4)
  181.     LOCATE linepos + 15, pos2: PRINT "? " + ProductInventory.ProductInventoryExpirationDate
  182.     LOCATE linepos + 15, pos2 + 13: PRINT "Correct N/Y ?"
  183.     DO
  184.         akey$ = INKEY$
  185.         IF UCASE$(akey$) = "N" THEN LOCATE linepos + 11, pos2: PRINT "                              ": GOTO 14
  186.     LOOP WHILE akey$ = ""
  187.  
  188.     LOCATE linepos + 12, pos2: INPUT ProductInventory.ProductInventoryWeightCheckOut
  189.     LOCATE linepos + 12, pos2: INPUT ProductInventory.ProductInventoryWeightCheckIn
  190.     LOCATE linepos + 16, pos2: INPUT ProductInventory.TypeofProductInventory
  191.    23
  192.     LOCATE linepos + 16, pos2: PRINT "?"
  193.     GallonorPound$ = INKEY$
  194.     IF UCASE$(GallonorPound$) = "W" THEN GallonorPound$ = "LIQUID": GOTO 24
  195.     IF UCASE$(GallonorPound$) = "D" THEN GallonorPound$ = "POWDER": GOTO 24
  196.     IF GallonorPound$ = CHR$(27) THEN GOTO 31
  197.     GOTO 23
  198.    24
  199.  
  200.     LOCATE linepos + 17, pos2: INPUT ProductInventory.Room
  201.     LOCATE linepos + 18, pos2: INPUT ProductInventory.Rack
  202.     LOCATE linepos + 19, pos2: INPUT ProductInventory.Shelf
  203.     LOCATE linepos + 20, pos2: INPUT ProductInventory.Bin
  204.     LOCATE linepos + 21, pos1: PRINT "Only C Cancels Entry anything else to save"
  205.     DO
  206.         akey$ = INKEY$
  207.         IF UCASE$(akey$) = UCASE$("C") THEN Cancel = 1
  208.     LOOP WHILE akey$ = ""
  209.     akey$ = ""
  210.  
  211.     IF Multi = 1 THEN
  212.         LOCATE linepos + 21, pos1: PRINT "ESC to Save Last Entry and Exit"
  213.         DO
  214.             akey$ = INKEY$
  215.             IF UCASE$(akey$) = CHR$(27) THEN Last$ = "yes"
  216.         LOOP WHILE akey$ = ""
  217.     END IF
  218.     akey$ = ""
  219.  
  220.     ProductInventory.TM = TIME$: ProductInventory.DT = DATE$
  221.  
  222.     300
  223.     IF Cancel = 1 THEN GOTO 444
  224.     'IF Multi = 0 OR 1 THEN
  225.     OPEN SerialFile$ FOR OUTPUT AS #2
  226.  
  227.     'Add Inventory
  228.     Discpass$ = ProductInventory.ProductInventoryName
  229.     Datapass$ = ProductInventory.StockUPC
  230.     EXP$ = ProductInventory.ProductInventoryExpirationDate
  231.     Pass$ = ProductInventory.ProductInventoryNumber
  232.  
  233.     CALL Barcode(Datapass$, Discpass$, Title$, Pass$, EXP$)
  234.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  235.     PUT #5, NumRecords% + 1, ProductInventory
  236.  
  237.     IF Multi = 1 AND NOT Last$ = "yes" THEN 444
  238.    31
  239.  
  240. SUB Select_Printer (Title$)
  241.     Pos10 = 15
  242.     CLS
  243.     COLOR 15, 0
  244.     SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt"
  245.     DIM impresora(50) AS STRING
  246.     OPEN "I", 10, "impresora.txt"
  247.     n% = 0
  248.     LINE INPUT #10, dato$
  249.     DO
  250.         LINE INPUT #10, dato$: LINE INPUT #10, dato$
  251.         IF EOF(10) THEN EXIT DO
  252.         n% = n% + 1
  253.         DO
  254.             a% = INSTR(dato$, CHR$(0))
  255.             IF a% = 0 THEN EXIT DO
  256.             IF a% = 1 THEN
  257.                 dato$ = MID$(dato$, a% + 1)
  258.             ELSEIF a% = LEN(dato$) THEN
  259.                 dato$ = LEFT$(dato$, a% - 1)
  260.             ELSE
  261.                 dato$ = LEFT$(dato$, a% - 1) + MID$(dato$, a% + 1)
  262.             END IF
  263.         LOOP
  264.         a% = INSTR(dato$, "FALSE"): b% = INSTR(dato$, "TRUE")
  265.         IF a% <> 0 THEN
  266.             MID$(dato$, a%, 5) = SPACE$(5)
  267.             dato$ = LTRIM$(RTRIM$(dato$))
  268.         END IF
  269.         IF b% <> 0 THEN
  270.             MID$(dato$, b%, 5) = SPACE$(4)
  271.             dato$ = LTRIM$(RTRIM$(dato$))
  272.             loca% = n%
  273.         END IF
  274.         impresora(n%) = dato$
  275.         impresora(0) = LTRIM$(STR$(n%))
  276.     LOOP
  277.     COLOR 7, 0
  278.     CLS
  279.     COLOR 1, 7
  280.     LOCATE 8, Pos10 - 1: PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
  281.     LOCATE 9, Pos10 - 1: PRINT "º                                        º"
  282.     LOCATE 10, Pos10 - 1: PRINT "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹"
  283.     LOCATE 11, Pos10 - 1: PRINT "º                                        º"
  284.     LOCATE 12, Pos10 - 1: PRINT "º                                        º"
  285.     LOCATE 13, Pos10 - 1: PRINT "º                                        º"
  286.     LOCATE 14, Pos10 - 1: PRINT "º                                        º"
  287.     LOCATE 15, Pos10 - 1: PRINT "º                                        º"
  288.     LOCATE 16, Pos10 - 1: PRINT "ÈÍÍÍÍÍÍÍ<Esc>ÍÍÍÍ<"; CHR$(24); ">Í<"; CHR$(25); ">ÍÍÍÍ<"; CHR$(17); CHR$(217); ">ÍÍÍÍÍÍÍÍͼ"
  289.     COLOR 15, 1
  290.     LOCATE 9, Pos10: PRINT "            SELECT PRINTER              ";
  291.     COLOR 1, 7
  292.     max% = VAL(impresora(0))
  293.     GOSUB impridatos
  294.     DO
  295.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  296.         x$ = UCASE$(x$)
  297.         x% = ASC(RIGHT$(x$, 1))
  298.         SELECT CASE x%
  299.             CASE IS = 27
  300.                 a$ = "@"
  301.                 EXIT DO
  302.             CASE IS = 13
  303.                 a$ = impresora(loca%)
  304.                 EXIT DO
  305.             CASE IS = 72: '--Subir
  306.                 IF loca% > 1 THEN
  307.                     loca% = loca% - 1
  308.                     GOSUB impridatos
  309.                 END IF
  310.             CASE IS = 80: '--Bajar
  311.                 IF loca% < max% THEN
  312.                     loca% = loca% + 1
  313.                     GOSUB impridatos
  314.                 END IF
  315.         END SELECT
  316.     LOOP
  317.     COLOR 7, 0
  318.     CLS
  319.     IF a$ <> "@" THEN
  320.         SHELL _HIDE "cmd/c wmic printer where name='" + a$ + "' call setdefaultprinter"
  321.         PRINT "Selected printer: "; a$
  322.     ELSE
  323.         PRINT "The printer has not been modified"
  324.     END IF
  325.     GOTO 700
  326.     impridatos:
  327.     y% = 1
  328.     FOR n% = loca% - 2 TO loca% + 2
  329.         IF n% < 1 OR n% > max% THEN
  330.             COLOR 1, 7: LOCATE y% + 10, Pos10: PRINT "                                        "
  331.         ELSE
  332.             IF n% = loca% THEN COLOR 15, 4 ELSE COLOR 1, 7
  333.             LOCATE y% + 10, Pos10: PRINT "                                        "
  334.             LOCATE y% + 10, Pos10: PRINT LEFT$(impresora(n%), 40)
  335.         END IF
  336.         y% = y% + 1
  337.     NEXT
  338.     RETURN
  339.    700
  340.     CLOSE 10
  341.  
  342. FUNCTION GetLocalIP$
  343.     choice$ = ""
  344.     SHELL _HIDE "cmd /c ipconfig > IPconfig.tmp"
  345.     A = FREEFILE
  346.     OPEN "IPconfig.tmp" FOR INPUT AS #A
  347.     DO
  348.         LINE INPUT #A, ipline$
  349.         IF UCASE$(LEFT$(LTRIM$(ipline$), 4)) = "IPV4" THEN
  350.             GetLocalIP$ = MID$(ipline$, INSTR(ipline$, ":") + 2)
  351.             IF GetLocalIP$ = "127.0.0.1" THEN GetLocalIP$ = "offline": GOTO 77
  352.             '         CLOSE #A
  353.             '         KILL "IPconfig.tmp" 'kill the messenger?
  354.             EXIT DO
  355.            77
  356.         END IF
  357.     LOOP UNTIL EOF(1)
  358.     CLOSE #A
  359.     KILL "IPconfig.tmp" 'kill the messenger?
  360.  
  361.  
  362. SUB ping
  363.     ' Shell to ping and get results 0 up 1 down
  364.     INPUT "Host to ping? ", ip$
  365.     IF ip$ = "" GOTO 777
  366.     result& = _SHELLHIDE("ping " + ip$ + " -n 1 -w 100")
  367.     IF result& = 0 THEN
  368.         'success
  369.         COLOR 2, 15
  370.         PRINT DATE$ + " " + TIME$ + " " + " Ping ("; ip$; ") "; "UP   ";
  371.         COLOR 7, 1
  372.     ELSE
  373.         COLOR 4, 15
  374.         PRINT DATE$ + " " + TIME$ + " " + " Ping ("; ip$; ") "; "DN   ";
  375.         COLOR 7, 1
  376.         REM PRINT #2, DATE$ + " " + TIME$ + " " + "Ping (" + ip$ + ") (" + desc$ + ")" + "   Down": flag = 1: set = 0
  377.     END IF
  378.     flag = 1: set = 0
  379.     INPUT "pause", ip$
  380.    777
  381.  
  382. SUB Partcsv (DBase$, Title$)
  383.     CLS: LOCATE 6
  384.     PRINT "Whoa there pardner, lets make sure you are authorized to be here."
  385.     INPUT "Enter the User name? ", User$
  386.     INPUT "Enter the Password? ", Password$
  387.     IF UCASE$(User$) <> "CHRIS" AND Password$ <> "Rdg09Dgr!$@#" THEN
  388.         PRINT "Sorry you are not allowed to be in here, lets get you somewhere safe"
  389.         PRINT "Press any key to continue"
  390.         DO
  391.             akey$ = INKEY$
  392.             IF UCASE$(akey$) <> "" THEN EXIT SUB
  393.         LOOP WHILE akey$ = ""
  394.     END IF
  395.     SHELL "notepad " + DBase$
  396.  
  397.  
  398. SUB Choicea
  399.     ' OPEN Dbase$ FOR APPEND AS #1
  400.     ' WRITE #1, EmployeeScan$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryWeightBegin$, ProductInventoryUPCCode$, ProductInventoryCost$, ProductInventory.ProductInventoryPurchaseDate, ProductInventory.ProductInventoryExpirationDate, ProductInventoryWeightCheckOut$, ProductInventoryWeightCheckIn$, StockUPC$, TypeofProductInventory$, Rack$, Shelf$, Bin$, DT$, TM$, a10$, a11$, a12$, b10$, b11$, b12$, c10$, c11$, c12$, d10$, d11$, d12$, e10$, e11$, e12$, f10$, f11$, f12$
  401.  
  402.  
  403.     IF Station$ = "?" THEN CALL Partcsv(Dbase$, Title$)
  404.     IF Station$ = "1" THEN Station$ = "1": GOTO 12
  405.     IF Station$ = "2" THEN Station$ = "2": GOTO 12
  406.     IF Station$ = "3" THEN Station$ = "3": GOTO 12
  407.     IF Station$ = "4" THEN Station$ = "4": GOTO 12
  408.     IF Station$ = "5" THEN Station$ = "5": GOTO 12
  409.     IF Station$ = "6" THEN Station$ = "6": GOTO 12
  410.     IF Station$ = "7" THEN Station$ = "7": GOTO 12
  411.     IF Station$ = "8" THEN Station$ = "8": GOTO 12
  412.     IF Station$ = "9" THEN Station$ = "9": GOTO 12
  413.     IF Station$ = "1O" THEN Station$ = "10": GOTO 12
  414.     IF Station$ = "11" THEN Station$ = "11": GOTO 12
  415.     IF Station$ = "12" THEN Station$ = "12": GOTO 12
  416.     IF Station$ = "13" THEN Station$ = "13": GOTO 12
  417.     IF Station$ = "14" THEN Station$ = "14": GOTO 12
  418.     IF Station$ = "15" THEN Station$ = "15": GOTO 12
  419.     IF Station$ = CHR$(27) THEN GOTO 31
  420.  
  421.     DO
  422.  
  423.         LOCATE 19, 1: PRINT "Choose a Line to input: "; 'semicolon saves position for user entry
  424.  
  425.         DO: keypress$ = UCASE$(INKEY$) 'change any user key press to uppercase
  426.  
  427.         LOOP UNTIL keypress$ <> ""
  428.         COLOR 15, 1: PRINT keypress$
  429.         Station$ = keypress$
  430.         GOTO 12
  431.  
  432.     LOOP
  433.  
  434.     12
  435.     CLS
  436.     LOCATE 1, 20: PRINT Title$ + " Part": LOCATE 1, pos2: PRINT " Display" + STR$(Multi)
  437.     IF keypress$ = "O" THEN LOCATE 2, 2: INPUT ; "Station ?", Station$
  438.    31
  439.  
  440. SUB Employee (EmployeeScan$, EmployeeName$, EmployeeFile$)
  441.     LinepPos = 5
  442.     EF = FREEFILE
  443.     OPEN EmployeeFile$ FOR INPUT AS #EF
  444.  
  445.     'LOCATE Linepos + 11, pos2: INPUT "Number ", EmployeeScan$
  446.    651
  447.     DO WHILE NOT EOF(EF)
  448.         INPUT #EF, A$, B$, C$, D$
  449.         IF EmployeeScan$ = A$ THEN
  450.             EmployeeName$ = B$
  451.             ProductInventory.EmployeeScan = EmployeeScan$
  452.             ProductInventory.Employeename = EmployeeName$
  453.             EXIT DO
  454.         END IF
  455.     LOOP
  456.     IF EmployeeName$ <> "" THEN GOTO 657
  457.    652
  458.  
  459.     LOCATE linepos + 30, pos2: PRINT "Employee Maintance"
  460.     LOCATE linepos + 31, pos2: PRINT "Name ", EmployeeName$
  461.     LOCATE linepos + 32, pos2: PRINT "Number ", EmployeeScan$
  462.     LOCATE linepos + 34, pos2: PRINT "Do you need to Edit?"
  463.     LOCATE linepos + 35, pos2: PRINT "  (A)dd Restart, (N)umber, (E)mployee, then finaly (S)ave, (ESC) all changes"
  464.     DO
  465.         akey$ = INKEY$
  466.         IF UCASE$(akey$) = "N" THEN GOTO 653
  467.         IF UCASE$(akey$) = "E" THEN GOTO 654
  468.         IF UCASE$(akey$) = "A" THEN GOTO 655
  469.         IF UCASE$(akey$) = "S" THEN GOTO 656
  470.         IF UCASE$(akey$) = CHR$(27) THEN GOTO 657
  471.     LOOP WHILE akey$ = ""
  472.  
  473.     653
  474.  
  475.     LOCATE linepos + 30, pos2: PRINT "Change Employee Number"
  476.     LOCATE linepos + 31, pos2: PRINT "Name ", EmployeeName$
  477.     LOCATE linepos + 32, pos2: INPUT "Number ", EmployeeScan$
  478.     C$ = TIME$ + "-" + DATE$
  479.     GOTO 651
  480.  
  481.  
  482.     654
  483.  
  484.     LOCATE linepos + 30, pos2: PRINT "Change Employee Name"
  485.     LOCATE linepos + 31, pos2: PRINT "Number ", EmployeeScan$
  486.     LOCATE linepos + 32, pos2: INPUT "Name ", EmployeeName$
  487.     C$ = TIME$ + "-" + DATE$
  488.     GOTO 651
  489.  
  490.     655
  491.  
  492.     LOCATE linepos + 30, pos2: PRINT "Add New Employee"
  493.     LOCATE linepos + 31, pos2: INPUT "Number ", EmployeeScan$
  494.     LOCATE linepos + 32, pos2: INPUT "Name ", EmployeeName$
  495.     C$ = TIME$ + "-" + DATE$
  496.     IF D$ = "" THEN D$ = C$
  497.     GOTO 651
  498.  
  499.     656
  500.     CLOSE #EF: OPEN EmployeeFile$ FOR APPEND AS #EF
  501.     WRITE #EF, EmployeeScan$, EmployeeName$, C$, D$
  502.     CLOSE #EF
  503.    657
  504.     CLOSE #EF
  505.  
  506.  
  507. SUB ProductInventoryFile (ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryUPCFile$, linepos, pos1, pos2)
  508.     pos1 = 2: linepos = 2: pos2 = 30
  509.     PIF = FREEFILE
  510.     IF _FILEEXISTS(ProductInventoryUPCFile$) THEN OPEN ProductInventoryUPCFile$ FOR INPUT AS #PIF ELSE GOTO 555
  511.     IF ProductInventoryUPCCode$ = CHR$(27) THEN EXIT SUB
  512.    553
  513.     DO WHILE NOT EOF(PIF)
  514.         INPUT #PIF, A$, B$, C$, D$
  515.         IF ProductInventoryUPCCode$ = A$ THEN
  516.             ProductInventoryBrand$ = B$
  517.             ProductInventoryNumber$ = C$
  518.             ProductInventoryName$ = D$
  519.             CLOSE #PIF
  520.             GOTO 554
  521.         END IF
  522.     LOOP
  523.  
  524.     555
  525.     CLOSE #PIF
  526.     OPEN ProductInventoryUPCFile$ FOR APPEND AS #PIF
  527.     LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT ProductInventory.ProductInventoryBrand
  528.     LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT ProductInventory.ProductInventoryName
  529.     LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT ProductInventory.ProductInventoryNumber
  530.  
  531.     LOCATE linepos + 5, pos2: INPUT ProductInventoryBrand$
  532.     LOCATE linepos + 6, pos2: INPUT ProductInventoryName$
  533.     LOCATE linepos + 7, pos2: INPUT ProductInventoryNumber$
  534.     WRITE #PIF, ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$
  535.     CLOSE #PIF
  536.  
  537.     554
  538.     ProductInventory.ProductInventoryUPCCode = ProductInventoryUPCCode$
  539.     ProductInventory.ProductInventoryBrand = ProductInventoryBrand$
  540.     ProductInventory.ProductInventoryNumber = ProductInventoryNumber$
  541.     ProductInventory.ProductInventoryName = ProductInventoryName$
  542.  
  543.  
  544. SUB Barcode (DATAPASS$, DISCPASS$, Title$, Pass$, EXP$)
  545.  
  546.  
  547.     ' DATAPASS$ = "123456789"
  548.     DATAPASS$ = "*" + DATAPASS$ + "*"
  549.     'EXP$ = "07/12/1900"
  550.     'DISCPASS$ = "Black Powder"
  551.  
  552.     'Pass$ = "ASDFEWEW"
  553.  
  554.     'Page
  555.     FFONT$ = "free3of9x.ttf": FFSize = 120
  556.     EFONT$ = "Arial.ttf": EFSize = 60
  557.     AFONT$ = "Arial.ttf": AFSize = 60
  558.     PageWidth = 216 * 10
  559.     PageHeight = 279 * 10
  560.  
  561.     'Label designerd for the Brother 201 (29mm x 90mm or 1-1/7" x 3-1/2") / Zebra ZDesigner LP 2844 looks compatable.
  562.     FFONT$ = "free3of9x.ttf": FFSize = 240
  563.     EFONT$ = "Arial.ttf": EFSize = 35
  564.     AFONT$ = "Arial.ttf": AFSize = 20
  565.     PageWidth = 110 * 10 'maximized tweaks for whole label
  566.     PageHeight = 29 * 10 'Max is already set do not change.
  567.  
  568.     Colum = 10
  569.     a = 0
  570.     RowA = 70 'Barcode on top of Custom description
  571.     RowB = 45 'ProductInventory Description Above Barcode
  572.     RowC = 0 'Custom Description line below Barcode
  573.  
  574.     SCREEN _NEWIMAGE(PageWidth, PageHeight, 13)
  575.     _DEST Page&: CLS _RGB(1, 1, 1), _RGB(256, 256, 256): _DEST 0 'make background white to save ink!
  576.     COLOR
  577.     F& = _LOADFONT(FFONT$, FFSize)
  578.     E& = _LOADFONT(EFONT$, EFSize)
  579.     A& = _LOADFONT(AFONT$, AFSize)
  580.  
  581.     _FONT F&
  582.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, RowB), DATAPASS$ ' Print upc bars on bottom of label
  583.  
  584.     _FONT E&
  585.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (400, RowC), Title$ ' Print Line 1 description
  586.  
  587.     _FONT A&
  588.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, RowC + 25), DISCPASS$ ' Print Line 2 ProductInventory description
  589.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, RowC + 85), Pass$ ' Print Line 3 ProductInventory description
  590.  
  591.     _FONT A&
  592.     keep = LEN(DATAPASS$): DATAPASS$ = MID$(DATAPASS$, 2, keep - 2)
  593.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, RowC), "Serial " + DATAPASS$ ' Print upc bar information above bar scan font
  594.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (925, RowC), "Use By " + EXP$ ' Print Product Expiry Date
  595.  
  596.     INPUT a
  597.     _PRINTIMAGE 0 'print screen page on printer
  598.     SCREEN 0
  599.  
  600. SUB SerialGen (serial$)
  601.     SN = FREEFILE
  602.     Exists = _FILEEXISTS("SerialFile.txt")
  603.     IF Exists = 0 THEN
  604.         OPEN "SerialFile.txt" FOR OUTPUT AS #SN
  605.         serial$ = "000000000"
  606.         PRINT #SN, serial$
  607.         CLOSE #SN
  608.     END IF
  609.     OPEN "SerialFile.txt" FOR INPUT AS #SN
  610.     INPUT #SN, serial$: CLOSE #SN
  611.     SSerial$ = LEFT$(serial$, 1)
  612.     ISerial = VAL(serial$)
  613.     ISerial = ISerial + 1:
  614.     ISerial$ = LTRIM$(STR$(ISerial))
  615.     DO UNTIL LEN(ISerial$) = 9
  616.         ISerial$ = "0" + ISerial$
  617.     LOOP
  618.     OPEN "SerialFile.txt" FOR OUTPUT AS #SN
  619.     serial$ = SSerial$ + ISerial$
  620.     PRINT #SN, serial$
  621.     CLOSE #SN
  622.  

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Inventory with barcode print out
« Reply #4 on: July 28, 2019, 06:21:26 pm »
Remove CLEAR from row 1 and 44 and program work correctly. CLEAR also erase all variables to zero!

Offline Chris80194

  • Newbie
  • Posts: 42
    • View Profile
Re: Inventory with barcode print out
« Reply #5 on: July 28, 2019, 09:29:47 pm »
ok
I was looking for a good way to close all files with one command

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Inventory with barcode print out
« Reply #6 on: July 28, 2019, 10:02:39 pm »
CLOSE

Offline Chris80194

  • Newbie
  • Posts: 42
    • View Profile
Re: Inventory with barcode print out
« Reply #7 on: July 29, 2019, 03:48:36 am »
ok

Offline Chris80194

  • Newbie
  • Posts: 42
    • View Profile
Re: Inventory with barcode print out
« Reply #8 on: July 29, 2019, 03:51:38 am »
Well I was throwing more keys around.  Wacked a few things into working need to clean up a few other things but mostly working
Need to stream line this thing.

Code: QB64: [Select]
  1. 'OPTION _EXPLICIT
  2.  
  3. TYPE InventoryDataStructure
  4.     EmployeeScan AS STRING * 4
  5.     Employeename AS STRING * 60
  6.     ProductInventoryBrand AS STRING * 60
  7.     ProductInventoryNumber AS STRING * 40
  8.     ProductInventoryName AS STRING * 60
  9.     ProductInventoryWeightBegin AS LONG
  10.     ProductInventoryUPCCode AS STRING * 20
  11.     ProductInventoryCost AS STRING * 8
  12.     ProductInventoryPurchaseDate AS STRING * 10
  13.     ProductInventoryExpirationDate AS STRING * 10
  14.     ProductInventoryWeightCheckOut AS LONG
  15.     ProductInventoryWeightCheckIn AS LONG
  16.     'STOCKUPC = 9 +  ProductInventoryNumber
  17.     StockUPC AS STRING * 49
  18.     TypeofProductInventory AS STRING * 20
  19.     BatchNumber AS STRING * 4
  20.     BoxNumber AS STRING * 4
  21.     GallonorPound AS STRING * 8
  22.     InventoryCost AS STRING * 8
  23.     Room AS STRING * 30
  24.     Rack AS STRING * 4
  25.     Shelf AS STRING * 4
  26.     Bin AS STRING * 4
  27.     DT AS STRING * 10
  28.     TM AS STRING * 8
  29. DIM SHARED ProductInventory AS InventoryDataStructure
  30. DIM SHARED pos1, pos2, linepos, Title$, Author$: pos1 = 2: linepos = 1: pos2 = 30
  31.  
  32. 'Product Constants future rewrite
  33. TYPE ProductDataStructure
  34.     EmployeeScan AS STRING * 4
  35.     Employeename AS STRING * 60
  36.     ProductInventoryBrand AS STRING * 60
  37.     ProductInventoryNumber AS STRING * 60
  38.     ProductInventoryName AS STRING * 60
  39.     ProductInventoryWeightBegin AS _INTEGER64
  40. 'DIM shared ProductPurchase AS ProductDataStructure
  41. 'OPEN ProductInventoryUPCFile$ FOR RANDOM AS #freefile LEN = LEN(ProductPurchase)
  42.  
  43. 1
  44.  
  45. COLOR 15, 7 'Foreground, Background  colors
  46. Author$ = "Written by Chris Owen on 6-20-2019, Email: chris.owen09@gmail.com"
  47. Title$ = "A1 Powder Coat"
  48.  
  49. EmployeeFile$ = "Employee.csv"
  50. ProductInventoryDBase$ = "ProductInventoryStock.RND"
  51. ProductInventoryUPCFile$ = "ProductInventoryFile.csv"
  52.  
  53. LOCATE 25, 80 - LEN(Author$): PRINT Author$
  54. position = 3
  55. PRINT "Default Printer " + Printerdisplay$
  56. DO UNTIL choice$ <> ""
  57.     TTime$ = DATE$ + "_" + LEFT$(TIME$, 2) + "." + MID$(TIME$, 4, 2) + "." + RIGHT$(TIME$, 2)
  58.     LOCATE 3, 15: PRINT Title$ + " Inventory": COLOR 14, 7: LOCATE 3, 50: PRINT TTime$: COLOR 15, 7 ' only 23 lines on screen 80 wide
  59.  
  60.     LOCATE 1, 80 - 5 - LEN(GetLocalIP$): COLOR 11, 7: PRINT "IP (" + GetLocalIP$ + ")": COLOR 15, 7
  61.     LOCATE 4 + position, 1: PRINT "1 Single Entry"
  62.     LOCATE 5 + position, 1: PRINT "2 Multiple Entry"
  63.  
  64.     LOCATE 13 + position, 1: PRINT "E Edit Employee File " + EmployeeFile$
  65.     LOCATE 14 + position, 1: PRINT "C Create Signs"
  66.  
  67.     LOCATE 17 + position, 1: PRINT ""
  68.     LOCATE 18 + position, 1: PRINT "V Verify Ping to Host"
  69.     LOCATE 19 + position, 1: PRINT "P Printer Select"
  70.     LOCATE 23, 1: PRINT "ESC to exit" ' Lock in here no lower
  71.  
  72.     choice$ = UCASE$(INKEY$) 'change any user key press to uppercase
  73.  
  74.  
  75. IF choice$ = "1" THEN CALL Part(choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$)
  76. IF choice$ = "2" THEN CALL Part(choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$)
  77. IF choice$ = "C" THEN CALL CodeCreator
  78. IF choice$ = "E" THEN CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$): GOTO 1
  79. IF choice$ = "V" THEN CALL ping
  80.  
  81. IF choice$ = "P" THEN CALL Select_Printer(Printer$)
  82.  
  83. IF choice$ = CHR$(27) THEN SYSTEM
  84. choice$ = ""
  85.  
  86. SUB Part (choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$)
  87.     pos1 = 2: linepos = 2: pos2 = 30
  88.     OPEN ProductInventoryDBase$ FOR RANDOM AS #5 LEN = LEN(ProductInventory)
  89.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  90.  
  91.     444
  92.     CLS
  93.     IF UCASE$(choice$) = "2" THEN Multi = 1
  94.     choice$ = ""
  95.     COLOR 15, 6: CLS
  96.     IF Multi = 0 OR 1 THEN
  97.         LOCATE 1, 15: PRINT Title$ + " Single Entry"; " Records " + STR$(NumRecords%)
  98.  
  99.     ELSE
  100.         LOCATE 1, 15: PRINT Title$ + " Multiple Entry"; " Records " + STR$(NumRecords%)
  101.  
  102.     END IF
  103.  
  104.     LOCATE linepos + 21, pos1: PRINT "ESC key plus Enter to exit"
  105.     'LOCATE linepos + 21, pos2: PRINT "Default Printer " + Printerdisplay$
  106.    11
  107.     LOCATE linepos + 3, pos1: PRINT "Employee Scan"
  108.     LOCATE linepos + 3, pos2: INPUT EmployeeScan$
  109.     IF EmployeeScan$ = CHR$(27) THEN GOTO 31
  110.     CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$)
  111.     (ProductInventory.EmployeeScan) = EmployeeScan$
  112.     (ProductInventory.Employeename) = EmployeeName$
  113.  
  114.     LOCATE linepos + 3, pos1: PRINT "Captured Employee Scan      #" + RTRIM$(ProductInventory.EmployeeScan) + " " + RTRIM$(ProductInventory.Employeename)
  115.  
  116.     12
  117.  
  118.     LOCATE linepos + 4, pos1: PRINT "ProductInventory UPC Code"
  119.     LOCATE linepos + 4, pos2: INPUT ProductInventoryUPCCode$
  120.     IF ProductInventoryUPCCode$ = "" THEN GOTO 12
  121.     IF ProductInventoryUPCCode$ = CHR$(27) THEN GOTO 31
  122.     CALL ProductInventoryFile(ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryUPCFile$, linepos, pos1, pos2)
  123.  
  124.     LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT RTRIM$(ProductInventory.ProductInventoryBrand)
  125.     LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT RTRIM$(ProductInventory.ProductInventoryName)
  126.     LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT RTRIM$(ProductInventory.ProductInventoryNumber)
  127.     CALL SerialGen(Serial$): ProductInventory.StockUPC = Serial$
  128.     LOCATE linepos + 8, pos1: PRINT "Serialized Stock UPC": LOCATE linepos + 8, pos2: PRINT RTRIM$(ProductInventory.StockUPC)
  129.     LOCATE linepos + 9, pos1: PRINT "Batch Number"
  130.     LOCATE linepos + 10, pos1: PRINT "Box Number"
  131.     LOCATE linepos + 11, pos1: PRINT "Measured as Gallon or Pound"
  132.     LOCATE linepos + 12, pos1: PRINT "Quanity"
  133.     LOCATE linepos + 13, pos1: PRINT "Cost"
  134.  
  135.     LOCATE linepos + 9, pos2: INPUT ProductInventory.BatchNumber
  136.     IF ProductInventory.BatchNumber = CHR$(27) THEN GOTO 31
  137.  
  138.     LOCATE linepos + 10, pos2: INPUT ProductInventory.BoxNumber
  139.     IF ProductInventory.BoxNumber = CHR$(27) THEN GOTO 31
  140.    22
  141.     LOCATE linepos + 11, pos2: PRINT "?"
  142.     GallonorPound$ = INKEY$
  143.     IF UCASE$(GallonorPound$) = "G" THEN GallonorPound$ = "GALLON": GOTO 21
  144.     IF UCASE$(GallonorPound$) = "P" THEN GallonorPound$ = "POUND": GOTO 21
  145.     IF GallonorPound$ = CHR$(27) THEN GOTO 31
  146.     GOTO 22
  147.    21
  148.     ProductInventory.GallonorPound = GallonorPound$
  149.     LOCATE linepos + 11, pos2: PRINT RTRIM$(ProductInventory.GallonorPound)
  150.  
  151.     LOCATE linepos + 12, pos2: INPUT ProductInventory.ProductInventoryWeightBegin
  152.  
  153.     LOCATE linepos + 13, pos2: INPUT ProductInventory.ProductInventoryCost
  154.  
  155.     LOCATE linepos + 14, pos1: PRINT "Purchase/Received Date"
  156.  
  157.     LOCATE linepos + 15, pos1: PRINT "Expiration Date"
  158.  
  159.     LOCATE linepos + 16, pos1: PRINT "Type of Product Dry or Wet"
  160.  
  161.     LOCATE linepos + 17, pos1: PRINT "Room"
  162.  
  163.     LOCATE linepos + 18, pos1: PRINT "Rack"
  164.  
  165.     LOCATE linepos + 19, pos1: PRINT "Shelf"
  166.  
  167.     LOCATE linepos + 20, pos1: PRINT "Bin"
  168.  
  169.     13 DT$ = ""
  170.     LOCATE linepos + 14, pos2: INPUT DT$
  171.     akey$ = ""
  172.     IF DT$ = "" THEN DT$ = DATE$ ': GOTO 4000
  173.     Century$ = MID$(DATE$, 7, 2)
  174.     IF LEN(DT$) = 6 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + Century$ + RIGHT$(DT$, 2): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 4000
  175.     IF LEN(DT$) = 8 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + RIGHT$(DT$, 4): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 4000
  176.    4000
  177.     ProductInventory.ProductInventoryPurchaseDate = DT$
  178.     LOCATE linepos + 14, pos2: PRINT "? " + ProductInventory.ProductInventoryPurchaseDate
  179.     LOCATE linepos + 14, pos2 + 13: PRINT "Correct N/Y ?"
  180.     DO UNTIL akey$ <> ""
  181.         akey$ = INKEY$
  182.         IF UCASE$(akey$) = "N" THEN LOCATE linepos + 14, pos2: PRINT "                              ": GOTO 13
  183.         IF UCASE$(akey$) = CHR$(12) THEN akey$ = ""
  184.         IF UCASE$(akey$) <> "Y" THEN akey$ = ""
  185.         IF UCASE$(akey$) = CHR$(27) THEN GOTO 31
  186.     LOOP
  187.  
  188.     14 DT$ = ""
  189.     LOCATE linepos + 15, pos2: INPUT DT$
  190.     akey$ = ""
  191.     IF DT$ = "" THEN DT$ = DATE$ ': GOTO 4001
  192.     Century$ = MID$(DATE$, 7, 2)
  193.     IF LEN(DT$) = 6 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + Century$ + RIGHT$(DT$, 2): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 4001
  194.     IF LEN(DT$) = 8 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + RIGHT$(DT$, 4): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 4001
  195.    4001
  196.     ProductInventory.ProductInventoryExpirationDate = DT$
  197.     LOCATE linepos + 15, pos2: PRINT "? " + ProductInventory.ProductInventoryExpirationDate
  198.     LOCATE linepos + 15, pos2 + 13: PRINT "Correct N/Y ?"
  199.     DO UNTIL akey$ <> ""
  200.         akey$ = INKEY$
  201.         IF UCASE$(akey$) = "N" THEN LOCATE linepos + 15, pos2: PRINT "                              ": GOTO 14
  202.         IF UCASE$(akey$) = CHR$(12) THEN akey$ = ""
  203.         IF UCASE$(akey$) <> "Y" THEN akey$ = ""
  204.         IF UCASE$(akey$) = CHR$(27) THEN GOTO 31
  205.     LOOP
  206.  
  207.     'LOCATE linepos + 12, pos2: INPUT ProductInventory.ProductInventoryWeightCheckOut
  208.     'LOCATE linepos + 12, pos2: INPUT ProductInventory.ProductInventoryWeightCheckIn
  209.  
  210.     23
  211.     LOCATE linepos + 16, pos2: PRINT "?"
  212.     DO UNTIL TypeOf$ <> ""
  213.         TypeOf$ = INKEY$
  214.         IF UCASE$(TypeOf$) = "W" THEN TypeOf$ = "LIQUID": GOTO 24
  215.         IF UCASE$(TypeOf$) = "D" THEN TypeOf$ = "POWDER": GOTO 24
  216.         IF UCASE$(TypeOf$) = CHR$(12) THEN TypeOf$ = ""
  217.         IF UCASE$(TypeOf$) = CHR$(27) THEN GOTO 31
  218.  
  219.     LOOP
  220.    24
  221.     ProductInventory.TypeofProductInventory = TypeOf$
  222.     LOCATE linepos + 16, pos2: PRINT ProductInventory.TypeofProductInventory
  223.  
  224.     LOCATE linepos + 17, pos2: INPUT ProductInventory.Room
  225.     ProductInventory.Room = UCASE$(ProductInventory.Room)
  226.     LOCATE linepos + 17, pos2: PRINT ProductInventory.Room
  227.  
  228.     LOCATE linepos + 18, pos2: INPUT ProductInventory.Rack
  229.     ProductInventory.Rack = UCASE$(ProductInventory.Rack)
  230.     LOCATE linepos + 18, pos2: PRINT ProductInventory.Rack
  231.  
  232.     LOCATE linepos + 19, pos2: INPUT ProductInventory.Shelf
  233.     ProductInventory.Shelf = UCASE$(ProductInventory.Shelf)
  234.     LOCATE linepos + 19, pos2: PRINT ProductInventory.Shelf
  235.  
  236.     LOCATE linepos + 20, pos2: INPUT ProductInventory.Bin
  237.     ProductInventory.Bin = UCASE$(ProductInventory.Bin)
  238.     LOCATE linepos + 20, pos2: PRINT ProductInventory.Bin
  239.  
  240.     LOCATE linepos + 21, pos1: PRINT "Only C Cancels Entry anything else to save"
  241.     DO
  242.         akey$ = INKEY$
  243.         IF UCASE$(akey$) = UCASE$("C") THEN GOTO 31
  244.     LOOP WHILE akey$ = ""
  245.     akey$ = ""
  246.  
  247.     IF Multi = 1 THEN
  248.         LOCATE linepos + 21, pos1: PRINT "ESC to Save Last Entry and Exit"
  249.         DO
  250.             akey$ = INKEY$
  251.             IF UCASE$(akey$) = CHR$(27) THEN Last$ = "yes"
  252.         LOOP WHILE akey$ = ""
  253.     END IF
  254.     akey$ = ""
  255.  
  256.     ProductInventory.TM = TIME$: ProductInventory.DT = DATE$
  257.  
  258.     'Add Inventory
  259.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  260.     PUT #5, NumRecords% + 1, ProductInventory
  261.  
  262.     ' Barcode Printout
  263.  
  264.     Datapass1$ = ProductInventory.StockUPC
  265.     DATAPASS2$ = ProductInventory.ProductInventoryExpirationDate
  266.     DATAPASS3$ = ProductInventory.ProductInventoryName
  267.     DATAPASS4$ = ProductInventory.ProductInventoryNumber
  268.  
  269.     CALL Barcode(Datapass1$, DATAPASS3$, DATAPASS4$, DATAPASS2$)
  270.  
  271.     IF Multi = 1 AND NOT Last$ = "yes" THEN 444
  272.    31
  273.     CLOSE 5
  274.  
  275. SUB Select_Printer (Printer$)
  276.     Pos10 = 15
  277.     CLS
  278.     COLOR 15, 0
  279.     SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt"
  280.     DIM impresora(50) AS STRING
  281.     OPEN "I", 10, "impresora.txt"
  282.     n% = 0
  283.     LINE INPUT #10, dato$
  284.     DO
  285.         LINE INPUT #10, dato$: LINE INPUT #10, dato$
  286.         IF EOF(10) THEN EXIT DO
  287.         n% = n% + 1
  288.         DO
  289.             a% = INSTR(dato$, CHR$(0))
  290.             IF a% = 0 THEN EXIT DO
  291.             IF a% = 1 THEN
  292.                 dato$ = MID$(dato$, a% + 1)
  293.             ELSEIF a% = LEN(dato$) THEN
  294.                 dato$ = LEFT$(dato$, a% - 1)
  295.             ELSE
  296.                 dato$ = LEFT$(dato$, a% - 1) + MID$(dato$, a% + 1)
  297.             END IF
  298.         LOOP
  299.         a% = INSTR(dato$, "FALSE"): b% = INSTR(dato$, "TRUE")
  300.         IF a% <> 0 THEN
  301.             MID$(dato$, a%, 5) = SPACE$(5)
  302.             dato$ = LTRIM$(RTRIM$(dato$))
  303.         END IF
  304.         IF b% <> 0 THEN
  305.             MID$(dato$, b%, 5) = SPACE$(4)
  306.             dato$ = LTRIM$(RTRIM$(dato$))
  307.             loca% = n%
  308.         END IF
  309.         impresora(n%) = dato$
  310.         impresora(0) = LTRIM$(STR$(n%))
  311.     LOOP
  312.     COLOR 7, 0
  313.     CLS
  314.     COLOR 1, 7
  315.     LOCATE 8, Pos10 - 1: PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
  316.     LOCATE 9, Pos10 - 1: PRINT "º                                        º"
  317.     LOCATE 10, Pos10 - 1: PRINT "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹"
  318.     LOCATE 11, Pos10 - 1: PRINT "º                                        º"
  319.     LOCATE 12, Pos10 - 1: PRINT "º                                        º"
  320.     LOCATE 13, Pos10 - 1: PRINT "º                                        º"
  321.     LOCATE 14, Pos10 - 1: PRINT "º                                        º"
  322.     LOCATE 15, Pos10 - 1: PRINT "º                                        º"
  323.     LOCATE 16, Pos10 - 1: PRINT "ÈÍÍÍÍÍÍÍ<Esc>ÍÍÍÍ<"; CHR$(24); ">Í<"; CHR$(25); ">ÍÍÍÍ<"; CHR$(17); CHR$(217); ">ÍÍÍÍÍÍÍÍͼ"
  324.     COLOR 15, 1
  325.     LOCATE 9, Pos10: PRINT "            SELECT PRINTER              ";
  326.     COLOR 1, 7
  327.     max% = VAL(impresora(0))
  328.     GOSUB impridatos
  329.     DO
  330.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  331.         x$ = UCASE$(x$)
  332.         x% = ASC(RIGHT$(x$, 1))
  333.         SELECT CASE x%
  334.             CASE IS = 27
  335.                 a$ = "@"
  336.                 EXIT DO
  337.             CASE IS = 13
  338.                 a$ = impresora(loca%)
  339.                 EXIT DO
  340.             CASE IS = 72: '--Subir
  341.                 IF loca% > 1 THEN
  342.                     loca% = loca% - 1
  343.                     GOSUB impridatos
  344.                 END IF
  345.             CASE IS = 80: '--Bajar
  346.                 IF loca% < max% THEN
  347.                     loca% = loca% + 1
  348.                     GOSUB impridatos
  349.                 END IF
  350.         END SELECT
  351.     LOOP
  352.     COLOR 7, 0
  353.     CLS
  354.     IF a$ <> "@" THEN
  355.         SHELL _HIDE "cmd/c wmic printer where name='" + a$ + "' call setdefaultprinter"
  356.         PRINT "Selected printer: "; a$
  357.     ELSE
  358.         PRINT "The printer has not been modified"
  359.     END IF
  360.     GOTO 700
  361.     impridatos:
  362.     y% = 1
  363.     FOR n% = loca% - 2 TO loca% + 2
  364.         IF n% < 1 OR n% > max% THEN
  365.             COLOR 1, 7: LOCATE y% + 10, Pos10: PRINT "                                        "
  366.         ELSE
  367.             IF n% = loca% THEN COLOR 15, 4 ELSE COLOR 1, 7
  368.             LOCATE y% + 10, Pos10: PRINT "                                        "
  369.             LOCATE y% + 10, Pos10: PRINT LEFT$(impresora(n%), 40)
  370.         END IF
  371.         y% = y% + 1
  372.     NEXT
  373.     RETURN
  374.    700
  375.     CLOSE 10
  376.  
  377. FUNCTION GetLocalIP$
  378.     choice$ = ""
  379.     SHELL _HIDE "cmd /c ipconfig > IPconfig.tmp"
  380.     A = FREEFILE
  381.     OPEN "IPconfig.tmp" FOR INPUT AS #A
  382.     DO
  383.         LINE INPUT #A, ipline$
  384.         IF UCASE$(LEFT$(LTRIM$(ipline$), 4)) = "IPV4" THEN
  385.             GetLocalIP$ = MID$(ipline$, INSTR(ipline$, ":") + 2)
  386.             IF GetLocalIP$ = "127.0.0.1" THEN GetLocalIP$ = "offline": GOTO 77
  387.             IF GetLocalIP$ = "" THEN GetLocalIP$ = "offline": GOTO 77
  388.             '         CLOSE #A
  389.             '         KILL "IPconfig.tmp" 'kill the messenger?
  390.             EXIT DO
  391.            77
  392.         END IF
  393.     LOOP UNTIL EOF(1)
  394.     CLOSE #A
  395.     KILL "IPconfig.tmp" 'kill the messenger?
  396.  
  397.  
  398. SUB ping
  399.     ' Shell to ping and get results 0 up 1 down
  400.     INPUT "Host to ping? ", ip$
  401.     IF ip$ = "" GOTO 777
  402.     result& = _SHELLHIDE("ping " + ip$ + " -n 1 -w 100")
  403.     IF result& = 0 THEN
  404.         'success
  405.         COLOR 2, 15
  406.         PRINT DATE$ + " " + TIME$ + " " + " Ping ("; ip$; ") "; "UP   ";
  407.         COLOR 7, 1
  408.     ELSE
  409.         COLOR 4, 15
  410.         PRINT DATE$ + " " + TIME$ + " " + " Ping ("; ip$; ") "; "DN   ";
  411.         COLOR 7, 1
  412.         REM PRINT #2, DATE$ + " " + TIME$ + " " + "Ping (" + ip$ + ") (" + desc$ + ")" + "   Down": flag = 1: set = 0
  413.     END IF
  414.     flag = 1: set = 0
  415.     INPUT "pause", ip$
  416.    777
  417.  
  418. SUB Employee (EmployeeScan$, EmployeeName$, EmployeeFile$)
  419.  
  420.     LinepPos = 5
  421.     EF = FREEFILE
  422.    651
  423.     CLOSE EF
  424.     IF _FILEEXISTS(EmployeeFile$) THEN OPEN EmployeeFile$ FOR INPUT AS #EF ELSE GOTO 652
  425.     'LOCATE linepos + 11, pos2: INPUT "Number ", EmployeeScan$
  426.  
  427.     DO WHILE NOT EOF(EF)
  428.         INPUT #EF, A$, B$
  429.         IF EmployeeScan$ = A$ THEN
  430.             EmployeeName$ = B$
  431.             ProductInventory.EmployeeScan = EmployeeScan$
  432.             ProductInventory.Employeename = EmployeeName$
  433.             EXIT DO
  434.         END IF
  435.     LOOP
  436.     IF EmployeeName$ <> "" THEN GOTO 657
  437.    652
  438.     CLS
  439.     CLOSE #EF
  440.     OPEN EmployeeFile$ FOR APPEND AS #EF
  441.     LOCATE linepos + 10, pos2: PRINT "Employee Maintance"
  442.     LOCATE linepos + 11, pos2: PRINT "Number ", EmployeeScan$
  443.     LOCATE linepos + 12, pos2: PRINT "Name ", EmployeeName$
  444.     LOCATE linepos + 14, pos2: PRINT "Do you need to Edit?"
  445.     LOCATE linepos + 15, pos2: PRINT "  (A)dd Restart, (N)umber Scan, (E)mployee Name, then finaly (S)ave, (ESC) all changes"
  446.  
  447.     DO
  448.         akey$ = INKEY$
  449.         IF UCASE$(akey$) = "N" THEN GOTO 653
  450.         IF UCASE$(akey$) = "E" THEN GOTO 654
  451.         IF UCASE$(akey$) = "A" THEN GOTO 655
  452.         IF UCASE$(akey$) = "S" THEN GOTO 656
  453.  
  454.         IF UCASE$(akey$) = CHR$(27) THEN GOTO 657
  455.     LOOP WHILE akey$ = ""
  456.  
  457.     653
  458.  
  459.     LOCATE linepos + 10, pos2: PRINT "Change Employee Number"
  460.     LOCATE linepos + 11, pos2: INPUT "Number ", EmployeeScan$
  461.     LOCATE linepos + 12, pos2: PRINT "Name ", EmployeeName$
  462.  
  463.     GOTO 652
  464.  
  465.     654
  466.  
  467.     LOCATE linepos + 10, pos2: PRINT "Change Employee Name"
  468.     LOCATE linepos + 11, pos2: PRINT "Number ", EmployeeScan$
  469.     LOCATE linepos + 12, pos2: INPUT "Name ", EmployeeName$
  470.  
  471.     GOTO 652
  472.  
  473.     655
  474.  
  475.     LOCATE linepos + 10, pos2: PRINT "Add New Employee"
  476.     LOCATE linepos + 11, pos2: INPUT "Number ", EmployeeScan$
  477.     LOCATE linepos + 12, pos2: INPUT "Name ", EmployeeName$
  478.     GOTO 652
  479.  
  480.     656
  481.     CLOSE #EF: OPEN EmployeeFile$ FOR APPEND AS #EF
  482.     WRITE #EF, EmployeeScan$, EmployeeName$
  483.     CLOSE #EF
  484.    657
  485.     CLS
  486.     CLOSE #EF
  487.  
  488.  
  489. SUB ProductInventoryFile (ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryUPCFile$, linepos, pos1, pos2)
  490.     pos1 = 2: linepos = 2: pos2 = 30
  491.     PIF = FREEFILE
  492.     IF _FILEEXISTS(ProductInventoryUPCFile$) THEN OPEN ProductInventoryUPCFile$ FOR INPUT AS #PIF ELSE GOTO 555
  493.     IF ProductInventoryUPCCode$ = CHR$(27) THEN EXIT SUB
  494.    553
  495.     DO WHILE NOT EOF(PIF)
  496.         INPUT #PIF, A$, B$, C$, D$
  497.         IF ProductInventoryUPCCode$ = A$ THEN
  498.             ProductInventoryBrand$ = B$
  499.             ProductInventoryNumber$ = C$
  500.             ProductInventoryName$ = D$
  501.             CLOSE #PIF
  502.             GOTO 554
  503.         END IF
  504.     LOOP
  505.  
  506.     555
  507.     CLOSE #PIF
  508.     OPEN ProductInventoryUPCFile$ FOR APPEND AS #PIF
  509.     LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT ProductInventory.ProductInventoryBrand
  510.     LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT ProductInventory.ProductInventoryName
  511.     LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT ProductInventory.ProductInventoryNumber
  512.  
  513.     LOCATE linepos + 5, pos2: INPUT ProductInventoryBrand$
  514.     LOCATE linepos + 6, pos2: INPUT ProductInventoryName$
  515.     LOCATE linepos + 7, pos2: INPUT ProductInventoryNumber$
  516.     WRITE #PIF, ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$
  517.     CLOSE #PIF
  518.  
  519.     554
  520.     ProductInventory.ProductInventoryUPCCode = ProductInventoryUPCCode$
  521.     ProductInventory.ProductInventoryBrand = ProductInventoryBrand$
  522.     ProductInventory.ProductInventoryNumber = ProductInventoryNumber$
  523.     ProductInventory.ProductInventoryName = ProductInventoryName$
  524.  
  525.  
  526. SUB Barcode (DATAPASS1$, DATAPASS3$, DATAPASS4$, DATAPASS2$)
  527.     CLS
  528.     DATAPASS1$ = "*" + RTRIM$(DATAPASS1$) + "*"
  529.  
  530.     PRINT "--------------------------------------------------------------"
  531.     PRINT "Serial " + DATAPASS1$ + "                  Use By "; DATAPASS2$
  532.     PRINT DATAPASS3$
  533.     PRINT DATAPASS4$
  534.     PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||"
  535.     PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||"
  536.     PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||"
  537.     PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||"
  538.     PRINT "--------------------------------------------------------------"
  539.     INPUT "Pause", a
  540.  
  541.     'FFONT$ = "free3of9x.ttf": FFSize = 120
  542.     'EFONT$ = "Arial.ttf": EFSize = 60
  543.     'AFONT$ = "Arial.ttf": AFSize = 60
  544.     'PageWidth = 216 * 10
  545.     'PageHeight = 279 * 10
  546.  
  547.     'Label designer for the Brother 201 (29mm x 90mm or 1-1/7" x 3-1/2") / Zebra ZDesigner LP 2844 looks compatible.
  548.     FFONT$ = "free3of9x.ttf": FFSize = 240
  549.     EFONT$ = "Arial.ttf": EFSize = 40
  550.     AFONT$ = "Arial.ttf": AFSize = 40
  551.     PageWidth = 110 * 10 'maximized tweaks for whole label
  552.     PageHeight = 29 * 10 'Max is already set do not change.
  553.  
  554.     Colum = 10
  555.  
  556.     SCREEN _NEWIMAGE(PageWidth, PageHeight, 13)
  557.     _DEST Page&: CLS _RGB(1, 1, 1), _RGB(256, 256, 256): _DEST 0 'make background white to save ink!
  558.     COLOR
  559.     F& = _LOADFONT(FFONT$, FFSize)
  560.     E& = _LOADFONT(EFONT$, EFSize)
  561.     A& = _LOADFONT(AFONT$, AFSize)
  562.  
  563.     _FONT F&
  564.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 45), DATAPASS1$ ' Print upc bars on bottom of label
  565.  
  566.     _FONT A&
  567.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 35), DATAPASS3$ ' Print Line 2 ProductInventory description
  568.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 68), DATAPASS4$ ' Print Line 3 ProductInventory description
  569.  
  570.     _FONT A&
  571.     keep = LEN(DATAPASS1$): DATAPASS1$ = MID$(DATAPASS1$, 2, keep - 2)
  572.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 0), "Serial " + DATAPASS1$ ' Print upc bar information above bar scan font
  573.     IF DATAPASS2$ <> "" THEN COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (725, 0), "Use By " + DATAPASS2$ ' Print Product Expiry Date
  574.  
  575.     _PRINTIMAGE 0 'print screen page on printer
  576.     SCREEN 0
  577.  
  578. SUB SerialGen (serial$)
  579.     SN = FREEFILE
  580.     Exists = _FILEEXISTS("SerialFile.txt")
  581.     IF Exists = 0 THEN
  582.         OPEN "SerialFile.txt" FOR OUTPUT AS #SN
  583.         serial$ = "000000000"
  584.         PRINT #SN, serial$
  585.         CLOSE #SN
  586.     END IF
  587.     OPEN "SerialFile.txt" FOR INPUT AS #SN
  588.     INPUT #SN, serial$: CLOSE #SN
  589.     SSerial$ = LEFT$(serial$, 1)
  590.     ISerial = VAL(serial$)
  591.     ISerial = ISerial + 1:
  592.     ISerial$ = LTRIM$(STR$(ISerial))
  593.     DO UNTIL LEN(ISerial$) = 9
  594.         ISerial$ = "0" + ISerial$
  595.     LOOP
  596.     OPEN "SerialFile.txt" FOR OUTPUT AS #SN
  597.     serial$ = SSerial$ + ISerial$
  598.     PRINT #SN, serial$
  599.     CLOSE #SN
  600.  
  601.  
  602. FUNCTION Printerdisplay$
  603.     Pos10 = 15
  604.     CLS
  605.     COLOR 15, 0
  606.     SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt"
  607.     DIM impresora(50) AS STRING
  608.     OPEN "I", 10, "impresora.txt"
  609.     n% = 0
  610.     LINE INPUT #10, dato$
  611.     DO
  612.  
  613.         LINE INPUT #10, dato$: LINE INPUT #10, dato$
  614.         IF EOF(10) THEN EXIT DO
  615.         n% = n% + 1
  616.         DO
  617.             a% = INSTR(dato$, CHR$(0))
  618.             IF a% = 0 THEN EXIT DO
  619.             IF a% = 1 THEN
  620.                 dato$ = MID$(dato$, a% + 1)
  621.             ELSEIF a% = LEN(dato$) THEN
  622.                 dato$ = LEFT$(dato$, a% - 1)
  623.             ELSE
  624.                 dato$ = LEFT$(dato$, a% - 1) + MID$(dato$, a% + 1)
  625.             END IF
  626.         LOOP
  627.         a% = INSTR(dato$, "FALSE"): b% = INSTR(dato$, "TRUE")
  628.         IF a% <> 0 THEN
  629.             MID$(dato$, a%, 5) = SPACE$(5)
  630.             dato$ = LTRIM$(RTRIM$(dato$))
  631.  
  632.         END IF
  633.         IF b% <> 0 THEN
  634.             MID$(dato$, b%, 5) = SPACE$(4)
  635.             dato$ = LTRIM$(RTRIM$(dato$))
  636.             Printerdisplay$ = dato$
  637.             loca% = n%
  638.         END IF
  639.  
  640.  
  641.         impresora(n%) = dato$
  642.         impresora(0) = LTRIM$(STR$(n%))
  643.     LOOP
  644.     CLOSE 10
  645.  
  646. SUB CodeCreator
  647.     CLS
  648.  
  649.     FFONT$ = "free3of9.ttf": FFSize = 120
  650.     EFONT$ = "Arial.ttf": EFSize = 60
  651.     AFONT$ = "Arial.ttf": AFSize = 60
  652.     PageWidth = 216 * 10
  653.     PageHeight = 279 * 10
  654.  
  655.     Colum = 10
  656.     INPUT "Barcode Information to print ", DATAPASS1$: DATAPASS1$ = "*" + RTRIM$(UCASE$(DATAPASS1$)) + "*"
  657.  
  658.     SCREEN _NEWIMAGE(PageWidth, PageHeight, 13)
  659.     _DEST Page&: CLS _RGB(1, 1, 1), _RGB(256, 256, 256): _DEST 0 'make background white to save ink!
  660.     COLOR
  661.     F& = _LOADFONT(FFONT$, FFSize)
  662.     E& = _LOADFONT(EFONT$, EFSize)
  663.     A& = _LOADFONT(AFONT$, AFSize)
  664.  
  665.     _FONT F&
  666.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 45), DATAPASS1$ ' Print upc bars on bottom of label
  667.  
  668.     _FONT A&
  669.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 35), DATAPASS3$ ' Print Line 2 ProductInventory description
  670.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 68), DATAPASS4$ ' Print Line 3 ProductInventory description
  671.  
  672.     _FONT A&
  673.     keep = LEN(DATAPASS1$): DATAPASS1$ = MID$(DATAPASS1$, 2, keep - 2)
  674.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 0), DATAPASS1$ ' Print upc bar information above bar scan font
  675.     IF DATAPASS2$ <> "" THEN COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (725, 0), "Use By " + DATAPASS2$ ' Print Product Expiry Date
  676.     INPUT "", a
  677.     _PRINTIMAGE 0 'print screen page on printer
  678.     SCREEN 0
  679.  

Offline Chris80194

  • Newbie
  • Posts: 42
    • View Profile
Re: Inventory with barcode print out
« Reply #9 on: August 03, 2019, 08:23:33 pm »
Ok I have wacked more stuff into working.
probably not very clean though

Code: QB64: [Select]
  1. 'OPTION _EXPLICIT
  2.  
  3. TYPE InventoryDataStructure
  4.     EmployeeScan AS STRING * 4
  5.     Employeename AS STRING * 60
  6.     Brand AS STRING * 60
  7.     Number AS STRING * 40
  8.     UnitName AS STRING * 60
  9.     WeightBegin AS SINGLE
  10.     UPCCode AS STRING * 20
  11.     Cost AS SINGLE
  12.     PurchaseDate AS STRING * 10
  13.     ExpirationDate AS STRING * 10
  14.     WeightCheckOut AS SINGLE
  15.     WeightCheckIn AS SINGLE
  16.     'STOCKUPC = 9, more corrupts the barcode print out.
  17.     StockUPC AS STRING * 10 'Serial number
  18.     TypeofProductInventory AS STRING * 20
  19.     BatchNumber AS STRING * 4
  20.     BoxNumber AS STRING * 4
  21.     GallonorPound AS STRING * 8
  22.     INorOut AS STRING * 3
  23.     Room AS STRING * 10
  24.     Rack AS STRING * 4
  25.     Shelf AS STRING * 4
  26.     Bin AS STRING * 4
  27.     DT AS STRING * 10
  28.     TM AS STRING * 8
  29. DIM SHARED ProductInventory AS InventoryDataStructure
  30. DIM SHARED pos1, pos2, linepos, Title$, Author$: pos1 = 2: linepos = 1: pos2 = 30
  31.  
  32. 'Product Constants future rewrite
  33. TYPE ProductDataStructure
  34.     ProductInventoryEmployeeScan AS STRING * 4
  35.     ProductInventoryEmployeename AS STRING * 60
  36.     ProductInventoryBrand AS STRING * 60
  37.     ProductInventoryNumber AS STRING * 60
  38.     ProductInventoryName AS STRING * 60
  39.     ProductInventoryWeightBegin AS SINGLE
  40. 'DIM shared ProductPurchase AS ProductDataStructure
  41. 'OPEN ProductInventoryUPCFile$ FOR RANDOM AS #freefile LEN = LEN(ProductPurchase)
  42.  
  43. 1
  44.  
  45. COLOR 15, 7 'Foreground, Background  colors
  46. Author$ = "Written by Chris Owen on 6-20-2019, Email: chris.owen09@gmail.com"
  47. Title$ = "A1 Powder Coat"
  48.  
  49. EmployeeFile$ = "Employee File.csv"
  50. ProductInventoryDBase$ = "Product Inventory Stock.RND"
  51. ProductInventoryUPCFile$ = "Product Inventory File.csv"
  52. Printer1$ = "Brother QL-500"
  53. Printer2$ = "Lexmark C500"
  54. Printer3$ = "Microsoft Print to PDF"
  55.  
  56. LOCATE 25, 80 - LEN(Author$): PRINT Author$
  57. position = 3
  58. COLOR 11, 7: PRINT "Default Printer " + Printerdisplay$: COLOR 15, 7
  59. choice$ = ""
  60. DO UNTIL choice$ <> ""
  61.     TTime$ = DATE$ + "_" + LEFT$(TIME$, 2) + "." + MID$(TIME$, 4, 2) + "." + RIGHT$(TIME$, 2)
  62.     LOCATE 3, 15: PRINT Title$ + " Inventory": COLOR 14, 7: LOCATE 3, 50: PRINT TTime$: COLOR 15, 7 ' only 23 lines on screen 80 wide
  63.  
  64.     LOCATE 1, 80 - 5 - LEN(GetLocalIP$): COLOR 11, 7: PRINT "IP (" + GetLocalIP$ + ")": COLOR 15, 7
  65.     LOCATE 4 + position, 1: PRINT "1 Single Entry"
  66.     LOCATE 5 + position, 1: PRINT "2 Multiple Entry"
  67.     LOCATE 7 + position, 1: PRINT "3 Check Out"
  68.     LOCATE 8 + position, 1: PRINT "4 Check In"
  69.     LOCATE 12 + position, 1: PRINT "R Reprint Label "
  70.     LOCATE 13 + position, 1: PRINT "E Edit Employee File " + EmployeeFile$
  71.     LOCATE 14 + position, 1: PRINT "C Create Signs"
  72.  
  73.     LOCATE 18 + position, 1: PRINT "V Verify Ping to Host"
  74.     LOCATE 19 + position, 1: PRINT "P Printer Select"
  75.     LOCATE 23, 1: PRINT "ESC to exit" ' Lock in here no lower
  76.     choice$ = UCASE$(INKEY$) 'change any user key press to uppercase
  77.  
  78. IF choice$ = "1" THEN
  79.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$ + "' call setdefaultprinter"
  80.     CALL Part(choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$, Printer$)
  81.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$ + "' call setdefaultprinter"
  82.  
  83. IF choice$ = "2" THEN
  84.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$ + "' call setdefaultprinter"
  85.     CALL Part(choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$, Printer$)
  86.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$ + "' call setdefaultprinter"
  87.  
  88. IF choice$ = "3" THEN
  89.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$ + "' call setdefaultprinter"
  90.     CALL SEARCH(choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$, Printer$)
  91.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$ + "' call setdefaultprinter"
  92.  
  93. IF choice$ = "4" THEN
  94.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$ + "' call setdefaultprinter"
  95.     CALL SEARCH(choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$, Printer$)
  96.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$ + "' call setdefaultprinter"
  97.  
  98. IF choice$ = "R" THEN
  99.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer1$ + "' call setdefaultprinter"
  100.     CALL SEARCH(choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$, Printer$)
  101.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$ + "' call setdefaultprinter"
  102.  
  103. IF choice$ = "C" THEN CALL CodeCreator(Printer1$, Printer2$, Printer3$)
  104. IF choice$ = "E" THEN CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$): GOTO 1
  105. IF choice$ = "V" THEN CALL ping
  106.  
  107. IF choice$ = "P" THEN CALL Select_Printer(Printer$)
  108.  
  109. IF choice$ = CHR$(27) THEN SYSTEM
  110. choice$ = ""
  111.  
  112. SUB SEARCH (choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$, Printer$)
  113.     pos1 = 2: linepos = 2: pos2 = 30
  114.     OPEN ProductInventoryDBase$ FOR RANDOM AS #5 LEN = LEN(ProductInventory)
  115.     OPEN ProductInventoryUPCFile$ FOR INPUT AS #6
  116.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  117.  
  118.     600
  119.     GOTO 601
  120.     IF UCASE$(choice$) = "2" THEN Multi = 1
  121.     IF UCASE$(choice$) = "R" THEN Check$ = "REPRINT"
  122.     choice$ = ""
  123.     COLOR 15, 6: CLS
  124.     IF Multi = 0 OR 1 THEN
  125.         LOCATE 1, 15: PRINT Title$ + " Single Entry"; " Records " + STR$(NumRecords%)
  126.  
  127.     ELSE
  128.         LOCATE 1, 15: PRINT Title$ + " Multiple Entry"; " Records " + STR$(NumRecords%)
  129.  
  130.     END IF
  131.    601
  132.     IF UCASE$(choice$) = "3" THEN Check$ = "OUT"
  133.     IF UCASE$(choice$) = "4" THEN Check$ = "IN"
  134.     IF UCASE$(choice$) = "R" THEN Check$ = "REPRINT"
  135.     choice$ = ""
  136.     COLOR 15, 6: CLS
  137.     IF Check$ = "OUT" THEN LOCATE 3, 15: PRINT Title$ + " Check Out"; " Records " + STR$(NumRecords%)
  138.     IF Check$ = "IN" THEN LOCATE 3, 15: PRINT Title$ + " Return Check IN"; " Records " + STR$(NumRecords%)
  139.  
  140.     LOCATE linepos + 21, pos1: PRINT "ESC key plus Enter to exit"
  141.  
  142.     611
  143.     IF Check$ <> "REPRINT" THEN
  144.         LOCATE linepos + 3, pos1: PRINT "Employee Scan"
  145.         LOCATE linepos + 3, pos2: INPUT EmployeeScan$
  146.         IF EmployeeScan$ = CHR$(27) THEN GOTO 631
  147.         CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$)
  148.         (ProductInventory.EmployeeScan) = EmployeeScan$
  149.         (ProductInventory.Employeename) = EmployeeName$
  150.  
  151.         LOCATE linepos + 3, pos1: PRINT "Captured Employee Scan      #" + RTRIM$(ProductInventory.EmployeeScan) + " " + RTRIM$(ProductInventory.Employeename)
  152.     END IF
  153.  
  154.     612
  155.     LOCATE linepos + 4, pos1: PRINT "Product Serial Code"
  156.     LOCATE linepos + 4, pos2: INPUT ProductInventoryStockUPC$
  157.    614
  158.     IF ProductInventoryStockUPC$ = CHR$(27) THEN GOTO 631
  159.     IF ProductInventoryStockUPC$ = "" THEN GOTO 612
  160.     IF LEN(ProductInventoryStockUPC$) <> 10 THEN ProductInventoryStockUPC$ = "0" + ProductInventoryStockUPC$: GOTO 614
  161.  
  162.     DO UNTIL EOF(5)
  163.         NumRecords = NumRecords + 1
  164.         GET #5, NumRecords, ProductInventory
  165.         IF ProductInventoryStockUPC$ = ProductInventory.StockUPC THEN: BEEP: EXIT DO ELSE IF NumRecords = NumRecords% THEN FOR x = 1 TO 3: BEEP: NEXT x: NumRecords = 0: ProductInventoryStockUPC$ = "": GOTO 612
  166.  
  167.     LOOP
  168.     IF Check$ <> "REPRINT" THEN
  169.         CLS
  170.         LOCATE 2, 30: PRINT "Record " + STR$(NumRecords) + " of " + STR$(NumRecords%)
  171.         LOCATE linepos + 3, pos1: PRINT "Captured Employee Scan      #" + RTRIM$(ProductInventory.EmployeeScan) + " " + RTRIM$(ProductInventory.Employeename)
  172.         LOCATE linepos + 4, pos1: PRINT "Serialized Stock UPC ": LOCATE linepos + 4, pos2: PRINT RTRIM$(ProductInventory.StockUPC)
  173.         LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT RTRIM$(ProductInventory.Brand)
  174.         LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT RTRIM$(ProductInventory.UnitName)
  175.         LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT RTRIM$(ProductInventory.Number)
  176.         LOCATE linepos + 8, pos1: PRINT "Measurement ": LOCATE linepos + 8, pos2: PRINT RTRIM$(ProductInventory.GallonorPound)
  177.         LOCATE linepos + 9, pos1: PRINT "Weight ": LOCATE linepos + 9, pos2: PRINT ProductInventory.WeightBegin
  178.         LOCATE linepos + 10, pos1: PRINT "Expiration Date ": LOCATE linepos + 10, pos2: PRINT ProductInventory.ExpirationDate
  179.         LOCATE linepos + 11, pos1: PRINT "Type of Product ": LOCATE linepos + 11, pos2: PRINT ProductInventory.TypeofProductInventory
  180.         LOCATE linepos + 12, pos1: PRINT "Room ": IF choice$ = "OUT" THEN LOCATE linepos + 12, pos2: PRINT ProductInventory.Room
  181.         LOCATE linepos + 13, pos1: PRINT "Rack ": IF choice$ = "OUT" THEN LOCATE linepos + 13, pos2: PRINT ProductInventory.Rack
  182.         LOCATE linepos + 14, pos1: PRINT "Shelf ": IF choice$ = "OUT" THEN LOCATE linepos + 14, pos2: PRINT ProductInventory.Shelf
  183.         LOCATE linepos + 15, pos1: PRINT "Bin ": IF choice$ = "OUT" THEN LOCATE linepos + 15, pos2: PRINT ProductInventory.Bin
  184.         IF choice$ = "OUT" THEN LOCATE linepos + 16, pos1: PRINT "Check Out Weight": LOCATE linepos + 16, pos2: INPUT ProductInventory.WeightCheckOut
  185.  
  186.         IF choice$ = "IN" THEN LOCATE linepos + 16, pos1: PRINT "Check in Weight": LOCATE linepos + 16, pos2: INPUT ProductInventory.WeightCheckIn
  187.         IF choice$ = "IN" THEN LOCATE linepos + 12, pos2: INPUT ProductInventory.Room
  188.         IF choice$ = "IN" THEN LOCATE linepos + 13, pos2: INPUT ProductInventory.Rack
  189.         IF choice$ = "IN" THEN LOCATE linepos + 14, pos2: INPUT ProductInventory.Shelf
  190.         IF choice$ = "IN" THEN LOCATE linepos + 15, pos2: INPUT ProductInventory.Bin
  191.  
  192.         613
  193.         DT$ = ""
  194.         LOCATE linepos + 14, pos2: INPUT DT$
  195.         akey$ = ""
  196.         IF DT$ = "" THEN DT$ = DATE$ ': GOTO 64000
  197.         Century$ = MID$(DATE$, 7, 2)
  198.         IF LEN(DT$) = 6 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + Century$ + RIGHT$(DT$, 2): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 64000
  199.         IF LEN(DT$) = 8 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + RIGHT$(DT$, 4): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 64000
  200.        64000
  201.         ProductInventory.TM = TIME$: ProductInventory.DT = DATE$
  202.         'IF Check$ = "OUT" THEN LOCATE linepos + 15, pos2: PRINT "? " + ProductInventory.DT
  203.         'IF Check$ = "IN" THEN LOCATE linepos + 15, pos2: PRINT "? " + ProductInventory.TM
  204.         'LOCATE linepos + 15, pos2 + 13: PRINT "Correct N/Y ?"
  205.         'DO UNTIL akey$ <> ""
  206.         'akey$ = INKEY$
  207.         'IF UCASE$(akey$) = "N" THEN LOCATE linepos + 15, pos2: PRINT "                              ": GOTO 613
  208.         'IF UCASE$(akey$) = CHR$(12) THEN akey$ = ""
  209.         'IF UCASE$(akey$) <> "Y" THEN akey$ = ""
  210.         'IF UCASE$(akey$) = CHR$(27) THEN GOTO 631
  211.         'LOOP
  212.  
  213.         LOCATE linepos + 21, pos1: PRINT "Only C Cancels Entry anything else to save"
  214.         DO
  215.             akey$ = INKEY$
  216.             IF UCASE$(akey$) = UCASE$("C") THEN GOTO 631
  217.         LOOP WHILE akey$ = ""
  218.         akey$ = ""
  219.  
  220.         IF Multi = 2 THEN
  221.             LOCATE linepos + 21, pos1: PRINT "ESC to Save Last Entry and Exit"
  222.             DO
  223.                 akey$ = INKEY$
  224.                 IF UCASE$(akey$) = CHR$(27) THEN Last$ = "yes"
  225.             LOOP WHILE akey$ = ""
  226.         END IF
  227.         akey$ = ""
  228.  
  229.         'Add Inventory
  230.         'NumRecords% = LOF(5) \ LEN(ProductInventory)
  231.         PUT #5, NumRecords% + 1, ProductInventory
  232.     END IF
  233.  
  234.     ' Barcode Printout
  235.     IF Check$ = "IN" OR Check$ = "REPRINT" THEN
  236.         Datapass1$ = ProductInventory.StockUPC
  237.         DATAPASS2$ = ProductInventory.ExpirationDate
  238.         DATAPASS3$ = ProductInventory.UnitName
  239.         DATAPASS4$ = ProductInventory.Number
  240.         IF Check$ = "IN" THEN DATAPASS5 = ProductInventory.WeightCheckIn
  241.         'rep
  242.         IF Check$ = "REPRINT" THEN DATAPASS5 = ProductInventory.WeightBegin
  243.  
  244.         CALL Barcode(Datapass1$, DATAPASS3$, DATAPASS4$, DATAPASS2$, DATAPASS5)
  245.     END IF
  246.     IF Multi = 1 AND NOT Last$ = "yes" THEN 600
  247.    631
  248.     CLOSE 5
  249.  
  250. SUB Part (choice$, ProductInventoryDBase$, EmployeeFile$, ProductInventoryUPCFile$, Printer$)
  251.     pos1 = 2: linepos = 2: pos2 = 30
  252.     OPEN ProductInventoryDBase$ FOR RANDOM AS #5 LEN = LEN(ProductInventory)
  253.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  254.  
  255.     400
  256.     IF UCASE$(choice$) = "1" THEN Multi = 1
  257.     IF UCASE$(choice$) = "2" THEN Multi = 2
  258.     choice$ = ""
  259.     COLOR 15, 6: CLS
  260.  
  261.     IF Multi = 1 THEN
  262.         LOCATE 3, 15: PRINT Title$ + " Single Entry"; " Records " + STR$(NumRecords%)
  263.  
  264.     ELSE
  265.         LOCATE 3, 15: PRINT Title$ + " Multiple Entry"; " Records " + STR$(NumRecords%)
  266.  
  267.     END IF
  268.  
  269.     LOCATE linepos + 21, pos1: PRINT "ESC key plus Enter to exit"
  270.     'LOCATE linepos + 21, pos2: PRINT "Default Printer " + Printerdisplay$
  271.    411
  272.     LOCATE linepos + 3, pos1: PRINT "Employee Scan"
  273.     LOCATE linepos + 3, pos2: INPUT EmployeeScan$
  274.     IF EmployeeScan$ = CHR$(27) THEN GOTO 431
  275.     CALL Employee(EmployeeScan$, EmployeeName$, EmployeeFile$)
  276.     (ProductInventory.EmployeeScan) = EmployeeScan$
  277.     (ProductInventory.Employeename) = EmployeeName$
  278.  
  279.     LOCATE linepos + 3, pos1: PRINT "Captured Employee Scan      #" + RTRIM$(ProductInventory.EmployeeScan) + " " + RTRIM$(ProductInventory.Employeename)
  280.  
  281.     412
  282.  
  283.     LOCATE linepos + 4, pos1: PRINT "ProductInventory UPC Code"
  284.     LOCATE linepos + 4, pos2: INPUT ProductInventoryUPCCode$
  285.     IF ProductInventoryUPCCode$ = "" THEN GOTO 412
  286.     IF ProductInventoryUPCCode$ = CHR$(27) THEN GOTO 431
  287.     CALL ProductInventoryFile(ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryUPCFile$, linepos, pos1, pos2)
  288.  
  289.     LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT RTRIM$(ProductInventory.Brand)
  290.     LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT RTRIM$(ProductInventory.UnitName)
  291.     LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT RTRIM$(ProductInventory.Number)
  292.     CALL SerialGen(Serial$): ProductInventory.StockUPC = Serial$
  293.     LOCATE linepos + 8, pos1: PRINT "Serialized Stock UPC": LOCATE linepos + 8, pos2: PRINT RTRIM$(ProductInventory.StockUPC)
  294.     LOCATE linepos + 9, pos1: PRINT "Batch Number"
  295.     LOCATE linepos + 10, pos1: PRINT "Box Number"
  296.     LOCATE linepos + 11, pos1: PRINT "Measured as Gallon or Pound"
  297.     LOCATE linepos + 12, pos1: PRINT "Weight/Quanity/Amount"
  298.     LOCATE linepos + 13, pos1: PRINT "Cost"
  299.  
  300.     LOCATE linepos + 9, pos2: INPUT ProductInventory.BatchNumber
  301.     IF ProductInventory.BatchNumber = CHR$(27) THEN GOTO 431
  302.  
  303.     LOCATE linepos + 10, pos2: INPUT ProductInventory.BoxNumber
  304.     IF ProductInventory.BoxNumber = CHR$(27) THEN GOTO 431
  305.    422
  306.     LOCATE linepos + 11, pos2: PRINT "?"
  307.     GallonorPound$ = INKEY$
  308.     IF UCASE$(GallonorPound$) = "G" THEN GallonorPound$ = "GALLON": GOTO 421
  309.     IF UCASE$(GallonorPound$) = "P" THEN GallonorPound$ = "POUND": GOTO 421
  310.     IF GallonorPound$ = CHR$(27) THEN GOTO 431
  311.     GOTO 422
  312.    421
  313.     ProductInventory.GallonorPound = GallonorPound$
  314.     LOCATE linepos + 11, pos2: PRINT RTRIM$(ProductInventory.GallonorPound)
  315.  
  316.     LOCATE linepos + 12, pos2: INPUT ProductInventory.WeightBegin
  317.  
  318.     LOCATE linepos + 13, pos2: INPUT ProductInventory.Cost
  319.  
  320.     LOCATE linepos + 14, pos1: PRINT "Purchase/Received Date"
  321.  
  322.     LOCATE linepos + 15, pos1: PRINT "Expiration Date"
  323.  
  324.     LOCATE linepos + 16, pos1: PRINT "Type of Product Dry or Wet"
  325.  
  326.     LOCATE linepos + 17, pos1: PRINT "Room"
  327.  
  328.     LOCATE linepos + 18, pos1: PRINT "Rack"
  329.  
  330.     LOCATE linepos + 19, pos1: PRINT "Shelf"
  331.  
  332.     LOCATE linepos + 20, pos1: PRINT "Bin"
  333.  
  334.     413 DT$ = ""
  335.     LOCATE linepos + 14, pos2: INPUT DT$
  336.     akey$ = ""
  337.     IF DT$ = "" THEN DT$ = DATE$ ': GOTO 44000
  338.     Century$ = MID$(DATE$, 7, 2)
  339.     IF LEN(DT$) = 6 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + Century$ + RIGHT$(DT$, 2): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 44000
  340.     IF LEN(DT$) = 8 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + RIGHT$(DT$, 4): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 44000
  341.    44000
  342.     ProductInventory.PurchaseDate = DT$
  343.     LOCATE linepos + 14, pos2: PRINT "? " + ProductInventory.PurchaseDate
  344.     LOCATE linepos + 14, pos2 + 13: PRINT "Correct N/Y ?"
  345.     DO UNTIL akey$ <> ""
  346.         akey$ = INKEY$
  347.         IF UCASE$(akey$) = "N" THEN LOCATE linepos + 14, pos2: PRINT "                              ": GOTO 413
  348.         IF UCASE$(akey$) = CHR$(12) THEN akey$ = ""
  349.         IF UCASE$(akey$) <> "Y" THEN akey$ = ""
  350.         IF UCASE$(akey$) = CHR$(27) THEN GOTO 431
  351.     LOOP
  352.  
  353.     414 DT$ = ""
  354.     LOCATE linepos + 15, pos2: INPUT DT$
  355.     akey$ = ""
  356.     IF DT$ = "" THEN DT$ = DATE$ ': GOTO 44001
  357.     Century$ = MID$(DATE$, 7, 2)
  358.     IF LEN(DT$) = 6 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + Century$ + RIGHT$(DT$, 2): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 44001
  359.     IF LEN(DT$) = 8 THEN DT$ = LEFT$(DT$, 2) + MID$(DT$, 3, 2) + RIGHT$(DT$, 4): DT$ = LEFT$(DT$, 2) + "-" + MID$(DT$, 3, 2) + "-" + RIGHT$(DT$, 4): GOTO 44001
  360.    44001
  361.     ProductInventory.ExpirationDate = DT$
  362.     LOCATE linepos + 15, pos2: PRINT "? " + ProductInventory.ExpirationDate
  363.     LOCATE linepos + 15, pos2 + 13: PRINT "Correct N/Y ?"
  364.     DO UNTIL akey$ <> ""
  365.         akey$ = INKEY$
  366.         IF UCASE$(akey$) = "N" THEN LOCATE linepos + 15, pos2: PRINT "                              ": GOTO 414
  367.         IF UCASE$(akey$) = CHR$(12) THEN akey$ = ""
  368.         IF UCASE$(akey$) <> "Y" THEN akey$ = ""
  369.         IF UCASE$(akey$) = CHR$(27) THEN GOTO 431
  370.     LOOP
  371.  
  372.     'LOCATE linepos + 12, pos2: INPUT ProductInventory.WeightCheckOut
  373.     'LOCATE linepos + 12, pos2: INPUT ProductInventory.WeightCheckIn
  374.  
  375.     423
  376.     LOCATE linepos + 16, pos2: PRINT "?"
  377.     DO UNTIL TypeOf$ <> ""
  378.         TypeOf$ = INKEY$
  379.         IF UCASE$(TypeOf$) = "W" THEN TypeOf$ = "LIQUID": GOTO 424
  380.         IF UCASE$(TypeOf$) = "D" THEN TypeOf$ = "POWDER": GOTO 424
  381.         IF UCASE$(TypeOf$) = CHR$(12) THEN TypeOf$ = ""
  382.         IF UCASE$(TypeOf$) = CHR$(27) THEN GOTO 431
  383.  
  384.     LOOP
  385.    424
  386.     ProductInventory.TypeofProductInventory = TypeOf$
  387.     LOCATE linepos + 16, pos2: PRINT ProductInventory.TypeofProductInventory
  388.  
  389.     LOCATE linepos + 17, pos2: INPUT ProductInventory.Room
  390.     ProductInventory.Room = UCASE$(ProductInventory.Room)
  391.     LOCATE linepos + 17, pos2: PRINT ProductInventory.Room
  392.  
  393.     LOCATE linepos + 18, pos2: INPUT ProductInventory.Rack
  394.     ProductInventory.Rack = UCASE$(ProductInventory.Rack)
  395.     LOCATE linepos + 18, pos2: PRINT ProductInventory.Rack
  396.  
  397.     LOCATE linepos + 19, pos2: INPUT ProductInventory.Shelf
  398.     ProductInventory.Shelf = UCASE$(ProductInventory.Shelf)
  399.     LOCATE linepos + 19, pos2: PRINT ProductInventory.Shelf
  400.  
  401.     LOCATE linepos + 20, pos2: INPUT ProductInventory.Bin
  402.     ProductInventory.Bin = UCASE$(ProductInventory.Bin)
  403.     LOCATE linepos + 20, pos2: PRINT ProductInventory.Bin
  404.     ProductInventory.INorOut = "IN"
  405.  
  406.     LOCATE linepos + 21, pos1: PRINT "Only C Cancels Entry anything else to save"
  407.     DO
  408.         akey$ = INKEY$
  409.         IF UCASE$(akey$) = UCASE$("C") THEN GOTO 431
  410.     LOOP WHILE akey$ = ""
  411.     akey$ = ""
  412.  
  413.     IF Multi = 2 THEN
  414.         LOCATE linepos + 21, pos1: PRINT "ESC to Save Last Entry and Exit"
  415.         DO
  416.             akey$ = INKEY$
  417.             IF UCASE$(akey$) = CHR$(27) THEN Last$ = "yes"
  418.         LOOP WHILE akey$ = ""
  419.     END IF
  420.     akey$ = ""
  421.  
  422.     ProductInventory.TM = TIME$: ProductInventory.DT = DATE$
  423.  
  424.     'Add Inventory
  425.     NumRecords% = LOF(5) \ LEN(ProductInventory)
  426.     PUT #5, NumRecords% + 1, ProductInventory
  427.  
  428.     ' Barcode Printout
  429.  
  430.     Datapass1$ = ProductInventory.StockUPC
  431.     DATAPASS2$ = ProductInventory.ExpirationDate
  432.     DATAPASS3$ = ProductInventory.UnitName
  433.     DATAPASS4$ = ProductInventory.Number
  434.     Datapass5 = ProductInventory.WeightBegin
  435.  
  436.     CALL Barcode(Datapass1$, DATAPASS3$, DATAPASS4$, DATAPASS2$, Datapass5)
  437.  
  438.     IF Multi = 2 AND NOT Last$ = "yes" THEN 400
  439.    431
  440.     ProductInventory.INorOut = ""
  441.     CLOSE 5
  442.  
  443. SUB Select_Printer (Printer$)
  444.     Pos10 = 15
  445.     CLS
  446.     COLOR 15, 0
  447.     SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt"
  448.     DIM impresora(50) AS STRING
  449.     OPEN "I", 10, "impresora.txt"
  450.     n% = 0
  451.     LINE INPUT #10, dato$
  452.     DO
  453.         LINE INPUT #10, dato$: LINE INPUT #10, dato$
  454.         IF EOF(10) THEN EXIT DO
  455.         n% = n% + 1
  456.         DO
  457.             a% = INSTR(dato$, CHR$(0))
  458.             IF a% = 0 THEN EXIT DO
  459.             IF a% = 1 THEN
  460.                 dato$ = MID$(dato$, a% + 1)
  461.             ELSEIF a% = LEN(dato$) THEN
  462.                 dato$ = LEFT$(dato$, a% - 1)
  463.             ELSE
  464.                 dato$ = LEFT$(dato$, a% - 1) + MID$(dato$, a% + 1)
  465.             END IF
  466.         LOOP
  467.         a% = INSTR(dato$, "FALSE"): b% = INSTR(dato$, "TRUE")
  468.         IF a% <> 0 THEN
  469.             MID$(dato$, a%, 5) = SPACE$(5)
  470.             dato$ = LTRIM$(RTRIM$(dato$))
  471.         END IF
  472.         IF b% <> 0 THEN
  473.             MID$(dato$, b%, 5) = SPACE$(4)
  474.             dato$ = LTRIM$(RTRIM$(dato$))
  475.             loca% = n%
  476.         END IF
  477.         impresora(n%) = dato$
  478.         impresora(0) = LTRIM$(STR$(n%))
  479.     LOOP
  480.     COLOR 7, 0
  481.     CLS
  482.     COLOR 1, 7
  483.     LOCATE 8, Pos10 - 1: PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
  484.     LOCATE 9, Pos10 - 1: PRINT "º                                        º"
  485.     LOCATE 10, Pos10 - 1: PRINT "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹"
  486.     LOCATE 11, Pos10 - 1: PRINT "º                                        º"
  487.     LOCATE 12, Pos10 - 1: PRINT "º                                        º"
  488.     LOCATE 13, Pos10 - 1: PRINT "º                                        º"
  489.     LOCATE 14, Pos10 - 1: PRINT "º                                        º"
  490.     LOCATE 15, Pos10 - 1: PRINT "º                                        º"
  491.     LOCATE 16, Pos10 - 1: PRINT "ÈÍÍÍÍÍÍÍ<Esc>ÍÍÍÍ<"; CHR$(24); ">Í<"; CHR$(25); ">ÍÍÍÍ<"; CHR$(17); CHR$(217); ">ÍÍÍÍÍÍÍÍͼ"
  492.     COLOR 15, 1
  493.     LOCATE 9, Pos10: PRINT "            SELECT PRINTER              ";
  494.     COLOR 1, 7
  495.     max% = VAL(impresora(0))
  496.     GOSUB impridatos
  497.     DO
  498.         x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
  499.         x$ = UCASE$(x$)
  500.         x% = ASC(RIGHT$(x$, 1))
  501.         SELECT CASE x%
  502.             CASE IS = 27
  503.                 a$ = "@"
  504.                 EXIT DO
  505.             CASE IS = 13
  506.                 a$ = impresora(loca%)
  507.                 EXIT DO
  508.             CASE IS = 72: '--Subir
  509.                 IF loca% > 1 THEN
  510.                     loca% = loca% - 1
  511.                     GOSUB impridatos
  512.                 END IF
  513.             CASE IS = 80: '--Bajar
  514.                 IF loca% < max% THEN
  515.                     loca% = loca% + 1
  516.                     GOSUB impridatos
  517.                 END IF
  518.         END SELECT
  519.     LOOP
  520.     COLOR 7, 0
  521.     CLS
  522.     IF a$ <> "@" THEN
  523.         OPEN "printer" FOR OUTPUT AS #44
  524.         PRINT #44, "cmd/c wmic printer where name='" + a$ + "' call setdefaultprinter"
  525.         CLOSE #44
  526.         : INPUT a
  527.         SHELL _HIDE "cmd/c wmic printer where name='" + a$ + "' call setdefaultprinter"
  528.         PRINT "Selected printer: "; a$
  529.     ELSE
  530.         PRINT "The printer has not been modified"
  531.     END IF
  532.     GOTO 700
  533.     impridatos:
  534.     y% = 1
  535.     FOR n% = loca% - 2 TO loca% + 2
  536.         IF n% < 1 OR n% > max% THEN
  537.             COLOR 1, 7: LOCATE y% + 10, Pos10: PRINT "                                        "
  538.         ELSE
  539.             IF n% = loca% THEN COLOR 15, 4 ELSE COLOR 1, 7
  540.             LOCATE y% + 10, Pos10: PRINT "                                        "
  541.             LOCATE y% + 10, Pos10: PRINT LEFT$(impresora(n%), 40)
  542.         END IF
  543.         y% = y% + 1
  544.     NEXT
  545.     RETURN
  546.    700
  547.     CLOSE 10
  548.  
  549. FUNCTION GetLocalIP$
  550.     choice$ = ""
  551.     SHELL _HIDE "cmd /c ipconfig > IPconfig.tmp"
  552.     A = FREEFILE
  553.     OPEN "IPconfig.tmp" FOR INPUT AS #A
  554.     DO
  555.         LINE INPUT #A, ipline$
  556.         IF UCASE$(LEFT$(LTRIM$(ipline$), 4)) = "IPV4" THEN
  557.             GetLocalIP$ = MID$(ipline$, INSTR(ipline$, ":") + 2)
  558.             IF GetLocalIP$ = "127.0.0.1" THEN GetLocalIP$ = "offline": GOTO 778
  559.             IF GetLocalIP$ = "" THEN GetLocalIP$ = "offline": GOTO 778
  560.             '         CLOSE #A
  561.             '         KILL "IPconfig.tmp" 'kill the messenger?
  562.             EXIT DO
  563.            778
  564.         END IF
  565.     LOOP UNTIL EOF(1)
  566.     CLOSE #A
  567.     KILL "IPconfig.tmp" 'kill the messenger?
  568.  
  569.  
  570. SUB ping
  571.     ' Shell to ping and get results 0 up 1 down
  572.     INPUT "Host to ping? ", ip$
  573.     IF ip$ = "" GOTO 777
  574.     result& = _SHELLHIDE("ping " + ip$ + " -n 1 -w 100")
  575.     IF result& = 0 THEN
  576.         'success
  577.         COLOR 2, 15
  578.         PRINT DATE$ + " " + TIME$ + " " + " Ping ("; ip$; ") "; "UP   ";
  579.         COLOR 7, 1
  580.     ELSE
  581.         COLOR 4, 15
  582.         PRINT DATE$ + " " + TIME$ + " " + " Ping ("; ip$; ") "; "DN   ";
  583.         COLOR 7, 1
  584.         REM PRINT #2, DATE$ + " " + TIME$ + " " + "Ping (" + ip$ + ") (" + desc$ + ")" + "   Down": flag = 1: set = 0
  585.     END IF
  586.     flag = 1: set = 0
  587.     INPUT "pause", ip$
  588.    777
  589.  
  590. SUB Employee (EmployeeScan$, EmployeeName$, EmployeeFile$)
  591.  
  592.     LinepPos = 5
  593.     EF = FREEFILE
  594.    651
  595.     CLOSE EF
  596.     IF _FILEEXISTS(EmployeeFile$) THEN OPEN EmployeeFile$ FOR INPUT AS #EF ELSE GOTO 652
  597.     'LOCATE linepos + 11, pos2: INPUT "Number ", EmployeeScan$
  598.  
  599.     DO WHILE NOT EOF(EF)
  600.         INPUT #EF, A$, B$
  601.         IF EmployeeScan$ = A$ THEN
  602.             EmployeeName$ = B$
  603.             ProductInventory.EmployeeScan = EmployeeScan$
  604.             ProductInventory.Employeename = EmployeeName$
  605.             EXIT DO
  606.         END IF
  607.     LOOP
  608.     IF EmployeeName$ <> "" THEN GOTO 657
  609.    652
  610.     CLS
  611.     CLOSE #EF
  612.     OPEN EmployeeFile$ FOR APPEND AS #EF
  613.     LOCATE linepos + 10, pos2: PRINT "Employee Maintance"
  614.     LOCATE linepos + 11, pos2: PRINT "Number ", EmployeeScan$
  615.     LOCATE linepos + 12, pos2: PRINT "Name ", EmployeeName$
  616.     LOCATE linepos + 14, pos2: PRINT "Do you need to Edit?"
  617.     LOCATE linepos + 15, pos2: PRINT "  (A)dd Restart, (N)umber Scan, (E)mployee Name, then finaly (S)ave, (ESC) all changes"
  618.  
  619.     DO
  620.         akey$ = INKEY$
  621.         IF UCASE$(akey$) = "N" THEN GOTO 653
  622.         IF UCASE$(akey$) = "E" THEN GOTO 654
  623.         IF UCASE$(akey$) = "A" THEN GOTO 655
  624.         IF UCASE$(akey$) = "S" THEN GOTO 656
  625.  
  626.         IF UCASE$(akey$) = CHR$(27) THEN GOTO 657
  627.     LOOP WHILE akey$ = ""
  628.  
  629.     653
  630.  
  631.     LOCATE linepos + 10, pos2: PRINT "Change Employee Number"
  632.     LOCATE linepos + 11, pos2: INPUT "Number ", EmployeeScan$
  633.     LOCATE linepos + 12, pos2: PRINT "Name ", EmployeeName$
  634.  
  635.     GOTO 652
  636.  
  637.     654
  638.  
  639.     LOCATE linepos + 10, pos2: PRINT "Change Employee Name"
  640.     LOCATE linepos + 11, pos2: PRINT "Number ", EmployeeScan$
  641.     LOCATE linepos + 12, pos2: INPUT "Name ", EmployeeName$
  642.  
  643.     GOTO 652
  644.  
  645.     655
  646.  
  647.     LOCATE linepos + 10, pos2: PRINT "Add New Employee"
  648.     LOCATE linepos + 11, pos2: INPUT "Number ", EmployeeScan$
  649.     LOCATE linepos + 12, pos2: INPUT "Name ", EmployeeName$
  650.     GOTO 652
  651.  
  652.     656
  653.     CLOSE #EF: OPEN EmployeeFile$ FOR APPEND AS #EF
  654.     WRITE #EF, EmployeeScan$, EmployeeName$
  655.     CLOSE #EF
  656.    657
  657.     CLS
  658.     CLOSE #EF
  659.  
  660.  
  661. SUB ProductInventoryFile (ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$, ProductInventoryUPCFile$, linepos, pos1, pos2)
  662.     pos1 = 2: linepos = 2: pos2 = 30
  663.     PIF = FREEFILE
  664.     IF _FILEEXISTS(ProductInventoryUPCFile$) THEN OPEN ProductInventoryUPCFile$ FOR INPUT AS #PIF ELSE GOTO 555
  665.     IF ProductInventoryUPCCode$ = CHR$(27) THEN EXIT SUB
  666.    553
  667.     DO WHILE NOT EOF(PIF)
  668.         INPUT #PIF, A$, B$, C$, D$
  669.         IF ProductInventoryUPCCode$ = A$ THEN
  670.             ProductInventoryBrand$ = B$
  671.             ProductInventoryNumber$ = C$
  672.             ProductInventoryName$ = D$
  673.             CLOSE #PIF
  674.             GOTO 554
  675.         END IF
  676.     LOOP
  677.  
  678.     555
  679.     CLOSE #PIF
  680.     OPEN ProductInventoryUPCFile$ FOR APPEND AS #PIF
  681.     LOCATE linepos + 5, pos1: PRINT "ProductInventory Brand ": LOCATE linepos + 5, pos2: PRINT ProductInventory.Brand
  682.     LOCATE linepos + 6, pos1: PRINT "ProductInventory Name ": LOCATE linepos + 6, pos2: PRINT ProductInventory.UnitName
  683.     LOCATE linepos + 7, pos1: PRINT "Part Number ": LOCATE linepos + 7, pos2: PRINT ProductInventory.Number
  684.  
  685.     LOCATE linepos + 5, pos2: INPUT ProductInventoryBrand$
  686.     LOCATE linepos + 6, pos2: INPUT ProductInventoryName$
  687.     LOCATE linepos + 7, pos2: INPUT ProductInventoryNumber$
  688.     WRITE #PIF, ProductInventoryUPCCode$, ProductInventoryBrand$, ProductInventoryNumber$, ProductInventoryName$
  689.     CLOSE #PIF
  690.  
  691.     554
  692.     ProductInventory.UPCCode = ProductInventoryUPCCode$
  693.     ProductInventory.Brand = ProductInventoryBrand$
  694.     ProductInventory.Number = ProductInventoryNumber$
  695.     ProductInventory.UnitName = ProductInventoryName$
  696.  
  697.  
  698. SUB Barcode (DATAPASS1$, DATAPASS3$, DATAPASS4$, DATAPASS2$, Datapass5)
  699.     CLS
  700.     DATAPASS1$ = "*" + RTRIM$(DATAPASS1$) + "*"
  701.  
  702.     PRINT "--------------------------------------------------------------"
  703.     PRINT "Serial " + DATAPASS1$ + "                  Use By "; DATAPASS2$
  704.     PRINT DATAPASS3$ + "                          Weight " + STR$(Datapass5)
  705.     PRINT DATAPASS4$
  706.     PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||"
  707.     PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||"
  708.     PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||"
  709.     PRINT "||| ||| || |||||||| |||||| |||||| ||||| | |||||| ||||||| |||||"
  710.     PRINT "--------------------------------------------------------------"
  711.     INPUT "Pause", a
  712.  
  713.     'Label designer for the Brother 201 (29mm x 90mm or 1-1/7" x 3-1/2") / Zebra ZDesigner LP 2844 looks compatible.
  714.     FFONT$ = "free3of9.ttf": FFSize = 170 '170 for label
  715.     EFONT$ = "Arial.ttf": EFSize = 40
  716.     AFONT$ = "Arial.ttf": AFSize = 40
  717.     PageWidth = 110 * 10 'maximized tweaks for whole label
  718.     PageHeight = 29 * 10 'Max is already set do not change.
  719.  
  720.     Colum = 10
  721.  
  722.     SCREEN _NEWIMAGE(PageWidth, PageHeight, 13)
  723.     _DEST Page&: CLS _RGB(1, 1, 1), _RGB(256, 256, 256): _DEST 0 'make background white to save ink!
  724.     COLOR
  725.     F& = _LOADFONT(FFONT$, FFSize)
  726.     E& = _LOADFONT(EFONT$, EFSize)
  727.     A& = _LOADFONT(AFONT$, AFSize)
  728.  
  729.     _FONT F&
  730.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 65), DATAPASS1$ ' Print upc bars on bottom of label
  731.  
  732.     _FONT A&
  733.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 35), DATAPASS3$ ' Print Line 2 ProductInventory description
  734.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 68), DATAPASS4$ ' Print Line 3 ProductInventory description
  735.  
  736.     _FONT A&
  737.     keep = LEN(DATAPASS1$): DATAPASS1$ = MID$(DATAPASS1$, 2, keep - 2)
  738.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 0), "Serial " + DATAPASS1$ ' Print upc bar information above bar scan font
  739.     IF DATAPASS2$ <> "" THEN COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (725, 0), "Use By " + DATAPASS2$ ' Print Product Expiry Date
  740.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (725, 35), "Weight " + STR$(Datapass5)
  741.     _PRINTIMAGE 0 'print screen page on printer
  742.     SCREEN 0
  743.  
  744. SUB SerialGen (serial$)
  745.     SN = FREEFILE
  746.     Exists = _FILEEXISTS("SerialFile.txt")
  747.     IF Exists = 0 THEN
  748.         OPEN "Serial File.txt" FOR OUTPUT AS #SN
  749.         serial$ = "000000000"
  750.         PRINT #SN, serial$
  751.         CLOSE #SN
  752.     END IF
  753.     OPEN "SerialFile.txt" FOR INPUT AS #SN
  754.     INPUT #SN, serial$: CLOSE #SN
  755.     SSerial$ = LEFT$(serial$, 1)
  756.     ISerial = VAL(serial$)
  757.     ISerial = ISerial + 1:
  758.     ISerial$ = LTRIM$(STR$(ISerial))
  759.     DO UNTIL LEN(ISerial$) = 9
  760.         ISerial$ = "0" + ISerial$
  761.     LOOP
  762.     OPEN "SerialFile.txt" FOR OUTPUT AS #SN
  763.     serial$ = SSerial$ + ISerial$
  764.     PRINT #SN, serial$
  765.     CLOSE #SN
  766.  
  767.  
  768. FUNCTION Printerdisplay$
  769.     Pos10 = 15
  770.     CLS
  771.     COLOR 15, 0
  772.     SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt"
  773.     DIM impresora(50) AS STRING
  774.     OPEN "I", 10, "impresora.txt"
  775.     n% = 0
  776.     LINE INPUT #10, dato$
  777.     DO
  778.  
  779.         LINE INPUT #10, dato$: LINE INPUT #10, dato$
  780.         IF EOF(10) THEN EXIT DO
  781.         n% = n% + 1
  782.         DO
  783.             a% = INSTR(dato$, CHR$(0))
  784.             IF a% = 0 THEN EXIT DO
  785.             IF a% = 1 THEN
  786.                 dato$ = MID$(dato$, a% + 1)
  787.             ELSEIF a% = LEN(dato$) THEN
  788.                 dato$ = LEFT$(dato$, a% - 1)
  789.             ELSE
  790.                 dato$ = LEFT$(dato$, a% - 1) + MID$(dato$, a% + 1)
  791.             END IF
  792.         LOOP
  793.         a% = INSTR(dato$, "FALSE"): b% = INSTR(dato$, "TRUE")
  794.         IF a% <> 0 THEN
  795.             MID$(dato$, a%, 5) = SPACE$(5)
  796.             dato$ = LTRIM$(RTRIM$(dato$))
  797.  
  798.         END IF
  799.         IF b% <> 0 THEN
  800.             MID$(dato$, b%, 5) = SPACE$(4)
  801.             dato$ = LTRIM$(RTRIM$(dato$))
  802.             Printerdisplay$ = dato$
  803.             loca% = n%
  804.         END IF
  805.  
  806.         impresora(n%) = dato$
  807.         impresora(0) = LTRIM$(STR$(n%))
  808.     LOOP
  809.     CLOSE 10
  810.  
  811. SUB CodeCreator (Printer1$, Printer2$, Printer3$)
  812.     CLS
  813.     'SHELL _HIDE "cmd/c wmic printer where name='" + Printer2$ + "' call setdefaultprinter"
  814.     FFONT$ = "free3of9.ttf": FFSize = 120
  815.     EFONT$ = "Arial.ttf": EFSize = 60
  816.     AFONT$ = "Arial.ttf": AFSize = 60
  817.     PageWidth = 216 * 10
  818.     PageHeight = 279 * 10
  819.  
  820.     Colum = 10
  821.     LOCATE 7, 1
  822.     PRINT "Please Enter information for the label."
  823.     INPUT "Barcode Information to print ", DATAPASS1$: DATAPASS1$ = "*" + RTRIM$(UCASE$(DATAPASS1$)) + "*"
  824.     PRINT "Please select Output printer"
  825.     PRINT "1 " + Printer1$
  826.     PRINT "2 " + Printer2$
  827.     PRINT "3 " + Printer3$
  828.     INPUT "Which Printer to send to?", a
  829.     IF a = 1 THEN
  830.         Printer$ = Printer1$
  831.         'Label designed for the Brother 201 (29mm x 90mm or 1-1/7" x 3-1/2") / Zebra ZDesigner LP 2844 looks compatible.
  832.         FFONT$ = "free3of9.ttf": FFSize = 170 '170 for label
  833.         EFONT$ = "Arial.ttf": EFSize = 40
  834.         AFONT$ = "Arial.ttf": AFSize = 40
  835.         PageWidth = 110 * 10 'maximized tweaks for whole label
  836.         PageHeight = 29 * 10 'Max is already set do not change.
  837.  
  838.     END IF
  839.  
  840.     IF a = 2 THEN
  841.         Printer$ = Printer2$
  842.         'Label designed plain paper (or 8-1/2" x 11").
  843.         FFONT$ = "free3of9.ttf": FFSize = 120
  844.         EFONT$ = "Arial.ttf": EFSize = 60
  845.         AFONT$ = "Arial.ttf": AFSize = 60
  846.         PageWidth = 216 * 10
  847.         PageHeight = 279 * 10
  848.  
  849.     END IF
  850.  
  851.     IF a = 3 THEN
  852.         Printer$ = Printer3$
  853.         'Label designed plain paper (or 8-1/2" x 11").
  854.         FFONT$ = "free3of9.ttf": FFSize = 120
  855.         EFONT$ = "Arial.ttf": EFSize = 60
  856.         AFONT$ = "Arial.ttf": AFSize = 60
  857.         PageWidth = 216 * 10
  858.         PageHeight = 279 * 10
  859.  
  860.     END IF
  861.  
  862.     SHELL _HIDE "cmd/c wmic printer where name='" + Printer$ + "' call setdefaultprinter"
  863.     SCREEN _NEWIMAGE(PageWidth, PageHeight, 13)
  864.     _DEST Page&: CLS _RGB(1, 1, 1), _RGB(256, 256, 256): _DEST 0 'make background white to save ink!
  865.     COLOR
  866.     F& = _LOADFONT(FFONT$, FFSize)
  867.     E& = _LOADFONT(EFONT$, EFSize)
  868.     A& = _LOADFONT(AFONT$, AFSize)
  869.  
  870.     _FONT F&
  871.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 45), DATAPASS1$ ' Print upc bars on bottom of label
  872.  
  873.     _FONT A&
  874.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 35), DATAPASS3$ ' Print Line 2 ProductInventory description
  875.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 68), DATAPASS4$ ' Print Line 3 ProductInventory description
  876.  
  877.     _FONT A&
  878.     keep = LEN(DATAPASS1$): DATAPASS1$ = MID$(DATAPASS1$, 2, keep - 2)
  879.     COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (Colum, 0), DATAPASS1$ ' Print upc bar information above bar scan font
  880.     IF DATAPASS2$ <> "" THEN COLOR _RGB(1, 1, 1), _RGB(256, 256, 256): _PRINTSTRING (725, 0), "Use By " + DATAPASS2$ ' Print Product Expiry Date
  881.     INPUT "", a
  882.     _PRINTIMAGE 0 'print screen page on printer
  883.     SCREEN 0
  884.