Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Chris80194

Pages: [1] 2 3
1
So I made the changes and a few tweaks

Code: QB64: [Select]
  1. '$DYNAMIC
  2. ReDim IPs$(0) ' <<<<
  3. ReDim Found$(0)
  4. Print GetLocalIP$(IPs$()); ""
  5. For i = 1 To UBound(IPs$) 'OK it does look like it starts at item #1
  6.        Stack$ = Stack$ + " " + IPs$(i)
  7. Print Stack$
  8.  
  9.  
  10. Function GetLocalIP$ (Found$())
  11.  
  12.     'Shell _Hide "cmd /c ipconfig > IPconfig.tmp" ' << still need this commented for current conditions
  13.     Open "IPconfig.tmp" For Input As #3
  14.     Do
  15.         If Not EOF(3) Then Line Input #3, ipline$ Else GoTo 888
  16.         If Left$(LTrim$(ipline$), 2) = "IP" Then
  17.             'Close #3
  18.             GetLocalIP$ = Mid$(ipline$, InStr(ipline$, ":") + 1)
  19.             If Left$(ipline$, 3) = "169" Then ipline$ = "Invalid IP" + ipline$
  20.             IPP = 1 + IPP
  21.             ReDim _Preserve Found$(IPP)
  22.             Found$(IPP) = Mid$(ipline$, InStr(ipline$, ":") + 1)
  23.             'Exit Do
  24.         End If
  25.     Loop Until EOF(3)
  26.    888
  27.     Close #3
  28.     'Kill "IPconfig.tmp" 'kill the messenger? still need this for not cluttering folder
  29.  
When it is run I get the print out of the

Print GetLocalIP$(IPs$()); ""

But I get the great idea that I would have eventually tried to figure out, I probably would have made a file and then loaded it again in the main program, this is a much better way.

For i = 1 To UBound(IPs$) 'OK it does look like it starts at item #1
    Print i, IPs$(i)
Next


So now I am trying to figure out how to "CALL" the function with out printing the extra line.

This is a part of another program and the invalid IP is part of the devices that we may need to factory reset, its IP sets to a 169 by default, so the idea is to set the Stack to each IP we use.

I am thinking of pulling the network card from the file to create the batch file also...
Thanks for the kick in the right direction bplus

Edit:
Quick read only print function works...

2
Aww Let me try these things, then.
I will post results.

3
'$DYNAMIC
Still have one error to look at.
Spoke to soon still have the out or subscription error...

4
I forgot that command...
But I get a error line one which is that line...

5
So I am working n a TCPIP tool to make identifying issues faster and this program works but has errors on lines 15 and 16 so I am trying to figure out how to fix that.
Code: QB64: [Select]
  1. Print GetLocalIP$
  2.  
  3. Function GetLocalIP$
  4.  
  5.     'Shell _Hide "cmd /c ipconfig > IPconfig.tmp"
  6.     Open "IPconfig.tmp" For Input As #3
  7.     Do
  8.         If Not EOF(3) Then Line Input #3, ipline$ Else GoTo 888
  9.         If Left$(LTrim$(ipline$), 2) = "IP" Then
  10.             'Close #3
  11.             GetLocalIP$ = Mid$(ipline$, InStr(ipline$, ":") + 1)
  12.             If Left$(ipline$, 3) = "169" Then ipline$ = "Invalid IP" + ipline$
  13.             Print Mid$(ipline$, InStr(ipline$, ":") + 1): IPP = 1 + IPP
  14.             Found$(IPP) = Mid$(ipline$, InStr(ipline$, ":") + 1)
  15.             Print Found$(IPP)
  16.             'Exit Do
  17.         End If
  18.     Loop Until EOF(3)
  19.    888
  20.     Close #3
  21.     'Kill "IPconfig.tmp" 'kill the messenger?
  22.  

The file that is loaded and searched is this IPconfig.tmp

Quote
Windows IP Configuration


Unknown adapter VPN - VPN Client:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter TAP-Windows Adapter V9:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Wi-Fi:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : autumn.com

Wireless LAN adapter Local Area Connection* 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 4:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet 2 Dock:

   Connection-specific DNS Suffix  . : owentechnologysolutions.com
   Link-local IPv6 Address . . . . . : fe80::b509:444b:7e06:265a%24
   IPv4 Address. . . . . . . . . . . : 10.1.1.105
   Subnet Mask . . . . . . . . . . . : 255.0.0.0
   IPv4 Address. . . . . . . . . . . : 10.11.1.105
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   IPv4 Address. . . . . . . . . . . : 192.168.0.105
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   IPv4 Address. . . . . . . . . . . : 192.168.51.105
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   IPv4 Address. . . . . . . . . . . : 169.254.198.161
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :

Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Bluetooth Network Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

So it runs and finds each IP but gives a subscript error for each instance...

6
Programs / Re: QB64 Spell Checker
« on: August 08, 2019, 11:17:51 pm »
Just 20K words???  I think I would never have gotten past 200.
A nice example though.  Who would have thought a "BASIC" program could do that.
I think some of these examples are really breathing life into the language.
Thanks for the help, ideas, and tutoring.

7
Programs / Re: Scrollable output in QB64
« on: August 08, 2019, 11:13:13 pm »
OldMoses  Ok I hate you.... Now I have another idea to try in my program ughhhhh and if I only DID NOT KNOW how to do that I would not have even worried about but NOW I have to make it work.  LOL

SMcNeill That works great in the test window the data looks a bit corrupted which could be the issue I am having with some searching...
Of course I have also made changes and did not clear that main data file too but that is what I was looking for.
Thanks.

8
Programs / Re: Scrollable output in QB64
« on: August 08, 2019, 11:03:30 pm »
Thank you ill bang it into the compiler.

I have this bad habit of falling asleep from time to time, I just can not seem to get over it. 
Not sure if there is a support group that can help with it either.

9
Programs / Re: Inventory with barcode print out
« 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.  

10
Yeah pretty much what I did.
I was able to get the laser sheets right but had to buy a label printer to format it right.

The laser printer was just not formating it right.

so 40 bucks later a week wait and a trip to office depot for an extra 400 labels....

Got it all working  Then someone gave me a Zebra label printer,  it works too.

But yeah had to print adjust and print again.  That is where the mash came from.

I like how Petr's output looks but it is not working with my printers. (frown face)

really in my program, once the data is scanned in the last thing it does is make a serialized label for that box to be used for control purposes of a "perishable" product.
Also to check in and out that product you "scan" that serial number.

11
Petr
So I tried the printout and the barcode won't scan????  Most likely spacing.
I like the output this makes using any other font, some tweaking.
Would be good for making return labels and send to labels.

The Barcode has to be JUSssttttttttt--------rrrriiiiigghhHHTTTTT.
30 some wasted labels until I got one to read on the scanner.

Bplus that is what happened on the above code I supplied to start out with.
Trial by error until the label worked right.  Messy but functional, pretty much how I do most things.
LOL
Thanks,

12
Petr
Nice output.
It was what I was going for.
I have a whole program that I have wacked keys on it does a decent job of input so now I have to work on retrieval.
the employee edit part sucks but that is a low priority to the other aspects that I am working towards.
Got rid of the append to file for random access hopefully much faster.
Sure there is code to remove edit and tweak.  Have a peek and a good laugh it's at.

https://www.qb64.org/forum/index.php?topic=1545.0

I am mashing things back and forth, then the next part will be retrieval and editing of the parts section...

13
Petr I wacked this together for a complete printing program for labels with a 3 of 9 barcode the 128 does not seem to work and since it is not really needed I did not want to waste more labels adjusting the font size so it would also scan.

I cut this out to make it available to others that might want to print labels.
I have it set for my mom to print return labels and labels to the girls on the WPGA that she heads up.

Ill have a look at your code.  Thanks for edits, it is probably cleaner then mine.  I added and removed things until it did what I needed in my full code program.

Bplus yeah I was stopping the run to show what the label would look like before it prints out on the printer.
A pause in the actual label was causing a ? to appear in the screen that would then print on the actual label.
I put this on here so that others could use it, adjust it, clean it up some, and in general a decent place to start from.

My code is more like a monkey in a cage throwing feces.  throw things around and see what sticks.

14
Programs / Re: Inventory with barcode print out
« 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.  

15
Programs / Re: Inventory with barcode print out
« on: July 29, 2019, 03:48:36 am »
ok

Pages: [1] 2 3