Author Topic: help my  (Read 41476 times)

0 Members and 1 Guest are viewing this topic.

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #15 on: July 01, 2020, 11:51:44 am »
about the two statements to change the number value in the string
from these types of errors

https://imgur.com/0m667QA

https://imgur.com/GGBHMsd

my intention is this that you see in the image  --> https://imgur.com/eTR37ei

which finds a distance number 30 and then add it up

and print it

I wanted to do this I'm going crazy

I thank you for helping me six friendly


when he finds the distance 30 he colors the numbers in red the numbers must be vertical
« Last Edit: July 01, 2020, 11:54:14 am by Kiara87 »
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #16 on: July 01, 2020, 12:02:51 pm »
First red line:
Code: QB64: [Select]
  1. PRINT VAL("123ABC") 'will output 123 as number type
  2.  
  3. PRINT VAL("123ABC") + VAL(".563") 'should be output 123.563 but who knows what
  4.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #17 on: July 01, 2020, 12:15:04 pm »
After first red line, I think you will find answer in this example:
Code: QB64: [Select]
  1.  
  2. a$ = "12345678901234567890"
  3. FOR i = 3 TO 20 STEP 2
  4.     'ABS() 'makes all positive
  5.     IF ABS(VAL(MID$(a$, 1, 2)) - VAL(MID$(a$, i, 2))) > 30 THEN COLOR 12 ELSE COLOR 15
  6.     PRINT MID$(a$, 1, 2); "+"; MID$(a$, i, 2); "   SUM:"; VAL(MID$(a$, 1, 2)) + VAL(MID$(a$, i, 2))
  7.  

« Last Edit: July 01, 2020, 12:18:41 pm by bplus »

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #18 on: July 01, 2020, 12:17:48 pm »
I didn't mean to print 123

I wanted to look for a distance of two numbers with distance 30 and color them as in the photo

maybe you need to do it with arrays to do this?

thanks bplus
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #19 on: July 01, 2020, 12:19:41 pm »
Check post above your last :)

To measure distance use ABS() because distance is not a negative number 10 - 40 = -30 but distance between 10 and 40 is 30 so ABS(10-40) = 30
« Last Edit: July 01, 2020, 12:21:56 pm by bplus »

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #20 on: July 01, 2020, 12:36:34 pm »
ok I'm testing thanks bplus

se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #21 on: July 01, 2020, 03:56:05 pm »
https://imgur.com/l4J5Qmt

I'm running but I can't understand why the two numbers with distance 30 don't color me red

attached image

anyone to the solution?
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #22 on: July 01, 2020, 04:21:21 pm »
Hi @Kiara87

The a$ I used in the example for coloring represented the variable "a" you are pulling from the file = 1 row of numbers.

I didn't have a file line so I made one up to show as example.

For you, after you get "a" from the file, you will have a string of numbers that you are accessing with MID$(a, position, lengthOf2) just as you use these MID$ strings to show numbers, you use them to do calculations with VAL() to transform them into numbers to add subtract and use ABS() function.

To calculate the difference in one part of "a" with another part of "a" you have position = p for first number and position + some number for the other section of "a"   or position of first number and position of second number in "a".


You will have to do that for each and every number you want to compare and color red before you print each and every number.


To post code at this forum select all the code in QB64 IDE (editor) Copy it then here at forum Reply press the button with the QB64 icon in this forum editor you will get [ code = qb64 ][ / code ] without spaces in edit window of forum.
paste your code between the two brackets  ][  in the middle of the code tag.

st [ code = qb64 ] is before the start of your code and [ / code ] is after the end of your code. You can just type it in that way only without spaces inside the brackets.

Then maybe I can write in comments on your code for easier understanding. :)

« Last Edit: July 01, 2020, 04:28:05 pm by bplus »

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #23 on: July 01, 2020, 05:19:21 pm »
I'm still trying
where I am wrong

Code: QB64: [Select]
  1. OPTION _EXPLICIT 'for typo's   yep lineMun blah!
  2.  
  3. DIM a AS STRING, count AS INTEGER, lineNum AS INTEGER, Q$, num AS INTEGER
  4.  
  5. 'count lines in file
  6. OPEN "lotto.dat" FOR INPUT AS #1
  7.     INPUT #1, a
  8.     'PRINT a
  9.     'INPUT " OK enter "; w$
  10.     IF LEN(_TRIM$(a)) THEN count = count + 1
  11. 'CLS: PRINT count '480 lines
  12. 'END
  13. 'CLS
  14.  
  15. LOCATE 1, 1
  16. PRINT "BARI"
  17. LOCATE 3, 1
  18. PRINT "CAGLIARI"
  19. LOCATE 5, 1
  20. PRINT "FIRENZE"
  21. LOCATE 7, 1
  22. PRINT "GENOVA"
  23. LOCATE 9, 1
  24. PRINT "MILANO"
  25. LOCATE 11, 1
  26. PRINT "NAPOLI"
  27. LOCATE 13, 1
  28. PRINT "PALERMO"
  29. LOCATE 15, 1
  30. PRINT "ROMA"
  31. LOCATE 17, 1
  32. PRINT "TORINO"
  33. LOCATE 19, 1
  34. PRINT "VENEZIA"
  35. LOCATE 21, 1
  36. PRINT "NAZIONALE"
  37.  
  38. LOCATE 23, 1
  39. PRINT " + to move on"
  40. LOCATE 23, 16
  41. PRINT "- to back"
  42.  
  43.  
  44.  
  45. lineNum = 1
  46. GOSUB get_a
  47.  
  48.  
  49.     a$ = "12345678901234567890"
  50.     Q$ = INKEY$
  51.     IF Q$ = "+" THEN lineNum = lineNum + 1
  52.     IF lineNum > count THEN lineNum = 1
  53.  
  54.     IF Q$ = "-" THEN lineNum = lineNum - 1
  55.     IF lineNum < 1 THEN lineNum = count
  56.  
  57.     IF ABS(VAL(MID$(a$, 15, 2)) - VAL(MID$(a$, 45, 2))) > 30 THEN COLOR 2 ELSE COLOR 15
  58.  
  59.     GOSUB get_a
  60.  
  61.  
  62.     LOCATE 1, 34
  63.     PRINT "estraz.num "; LEFT$(a, 4); "   lineNum:"; STR$(lineNum)
  64.  
  65.     REM bari
  66.     LOCATE 1, 13
  67.     PRINT VAL(MID$(a, 5, 2))
  68.     LOCATE 1, 16
  69.     PRINT VAL(MID$(a, 7, 2))
  70.     LOCATE 1, 19
  71.     PRINT VAL(MID$(a, 9, 2))
  72.     LOCATE 1, 22
  73.     PRINT VAL(MID$(a, 11, 2))
  74.     LOCATE 1, 25
  75.     PRINT VAL(MID$(a, 13, 2))
  76.  
  77.     REM cagliari
  78.     LOCATE 3, 13
  79.     PRINT VAL(MID$(a, 15, 2))
  80.     LOCATE 3, 16
  81.     PRINT VAL(MID$(a, 17, 2))
  82.     LOCATE 3, 19
  83.     PRINT VAL(MID$(a, 19, 2))
  84.     LOCATE 3, 22
  85.     PRINT VAL(MID$(a, 21, 2))
  86.     LOCATE 3, 25
  87.     PRINT VAL(MID$(a, 23, 2))
  88.  
  89.     REM firenze
  90.     LOCATE 5, 13
  91.     PRINT VAL(MID$(a, 25, 2))
  92.     LOCATE 5, 16
  93.     PRINT VAL(MID$(a, 27, 2))
  94.     LOCATE 5, 19
  95.     PRINT VAL(MID$(a, 29, 2))
  96.     LOCATE 5, 22
  97.     PRINT VAL(MID$(a, 31, 2))
  98.     LOCATE 5, 25
  99.     PRINT VAL(MID$(a, 33, 2))
  100.  
  101.     REM genova
  102.     LOCATE 7, 13
  103.     PRINT VAL(MID$(a, 35, 2))
  104.     LOCATE 7, 16
  105.     PRINT VAL(MID$(a, 37, 2))
  106.     LOCATE 7, 19
  107.     PRINT VAL(MID$(a, 39, 2))
  108.     LOCATE 7, 22
  109.     PRINT VAL(MID$(a, 41, 2))
  110.     LOCATE 7, 25
  111.     PRINT VAL(MID$(a, 43, 2))
  112.  
  113.     REM milano
  114.     LOCATE 9, 13
  115.     PRINT VAL(MID$(a, 45, 2))
  116.     LOCATE 9, 16
  117.     PRINT VAL(MID$(a, 47, 2))
  118.     LOCATE 9, 19
  119.     PRINT VAL(MID$(a, 49, 2))
  120.     LOCATE 9, 22
  121.     PRINT VAL(MID$(a, 51, 2))
  122.     LOCATE 9, 25
  123.     PRINT VAL(MID$(a, 53, 2))
  124.  
  125.     REM napoli
  126.     LOCATE 11, 13
  127.     PRINT VAL(MID$(a, 55, 2))
  128.     LOCATE 11, 16
  129.     PRINT VAL(MID$(a, 57, 2))
  130.     LOCATE 11, 19
  131.     PRINT VAL(MID$(a, 59, 2))
  132.     LOCATE 11, 22
  133.     PRINT VAL(MID$(a, 61, 2))
  134.     LOCATE 11, 25
  135.     PRINT VAL(MID$(a, 63, 2))
  136.  
  137.     REM palermo
  138.     LOCATE 13, 13
  139.     PRINT VAL(MID$(a, 65, 2))
  140.     LOCATE 13, 16
  141.     PRINT VAL(MID$(a, 67, 2))
  142.     LOCATE 13, 19
  143.     PRINT VAL(MID$(a, 69, 2))
  144.     LOCATE 13, 22
  145.     PRINT VAL(MID$(a, 71, 2))
  146.     LOCATE 13, 25
  147.     PRINT VAL(MID$(a, 73, 2))
  148.  
  149.     REM roma
  150.     LOCATE 15, 13
  151.     PRINT VAL(MID$(a, 75, 2))
  152.     LOCATE 15, 16
  153.     PRINT VAL(MID$(a, 77, 2))
  154.     LOCATE 15, 19
  155.     PRINT VAL(MID$(a, 79, 2))
  156.     LOCATE 15, 22
  157.     PRINT VAL(MID$(a, 81, 2))
  158.     LOCATE 15, 25
  159.     PRINT VAL(MID$(a, 83, 2))
  160.  
  161.     REM torino
  162.     LOCATE 17, 13
  163.     PRINT VAL(MID$(a, 85, 2))
  164.     LOCATE 17, 16
  165.     PRINT VAL(MID$(a, 87, 2))
  166.     LOCATE 17, 19
  167.     PRINT VAL(MID$(a, 89, 2))
  168.     LOCATE 17, 22
  169.     PRINT VAL(MID$(a, 91, 2))
  170.     LOCATE 17, 25
  171.     PRINT VAL(MID$(a, 93, 2))
  172.  
  173.     REM venezia
  174.     LOCATE 19, 13
  175.     PRINT VAL(MID$(a, 95, 2))
  176.     LOCATE 19, 16
  177.     PRINT VAL(MID$(a, 97, 2))
  178.     LOCATE 19, 19
  179.     PRINT VAL(MID$(a, 99, 2))
  180.     LOCATE 19, 22
  181.     PRINT VAL(MID$(a, 101, 2))
  182.     LOCATE 19, 25
  183.     PRINT VAL(MID$(a, 103, 2))
  184.  
  185.     REM nazionale
  186.     LOCATE 21, 13
  187.     PRINT VAL(MID$(a, 105, 2))
  188.     LOCATE 21, 16
  189.     PRINT VAL(MID$(a, 107, 2))
  190.     LOCATE 21, 19
  191.     PRINT VAL(MID$(a, 109, 2))
  192.     LOCATE 21, 22
  193.     PRINT VAL(MID$(a, 111, 2))
  194.     LOCATE 21, 25
  195.     PRINT VAL(MID$(a, 113, 2))
  196.  
  197.     _LIMIT 30
  198.  
  199.  
  200. 'this sub retrieves a line number from file  the hard way
  201. get_a:
  202. num = 0
  203. OPEN "lotto.dat" FOR INPUT AS #1
  204.     INPUT #1, a
  205.     IF LEN(_TRIM$(a)) THEN num = num + 1
  206.     IF num = lineNum THEN EXIT WHILE 'a is set on line we want
  207.  
  208.  
  209.  
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #24 on: July 01, 2020, 05:30:12 pm »
Congratulations code has been posted successfully! :)

Take just one thing you are printing for an example:
Code: QB64: [Select]
  1.     REM bari
  2.     LOCATE 1, 13
  3.     PRINT VAL(MID$(a, 5, 2))  '<<< the 5 in here id's the number.  
  4. ' I need to know what id number you want to compare this number to decide if it is red.
  5. ' If all the id's are a set amount from each other, do you want to compare
  6. 'MID$(a, 5, 2) to MID$(a, 35, 2)  and all the other MID$(a, x, 2) to MID$(a, x+30, 2) ????
  7.  
« Last Edit: July 01, 2020, 05:32:24 pm by bplus »

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #25 on: July 01, 2020, 05:41:46 pm »
Code: QB64: [Select]
  1. REM cagliari
  2.     LOCATE 3, 13
  3.     PRINT VAL(MID$(a, 15, 2))  'I wanted to compare the first of Cagliari with the first of Milano that year the distance 30, and the two with the distance 30 color them red and all other numbers that remain white
  4. MID$(a, 45, 2)   TO MID$
    REM cagliari
    LOCATE 3, 13
    PRINT VAL(MID$(a, 15, 2))  'I wanted to compare the first of Cagliari with the first of Milano that year the distance 30, and the two with the distance 30 color them red and all other numbers that remain white
MID$(a, 45, 2)   TO MID$
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #26 on: July 01, 2020, 05:47:50 pm »
OK I think I have idea what you want, here is Bari started for you, you will have to do the rest (if it is right).
Code: QB64: [Select]
  1. OPTION _EXPLICIT 'for typo's   yep lineMun blah!
  2.  
  3. DIM a AS STRING, count AS INTEGER, lineNum AS INTEGER, Q$, num AS INTEGER
  4.  
  5. 'count lines in file
  6. OPEN "lotto.dat" FOR INPUT AS #1
  7.     INPUT #1, a
  8.     'PRINT a
  9.     'INPUT " OK enter "; w$
  10.     IF LEN(_TRIM$(a)) THEN count = count + 1
  11. 'CLS: PRINT count '480 lines
  12. 'END
  13. 'CLS
  14.  
  15. LOCATE 1, 1
  16. PRINT "BARI"
  17. LOCATE 3, 1
  18. PRINT "CAGLIARI"
  19. LOCATE 5, 1
  20. PRINT "FIRENZE"
  21. LOCATE 7, 1
  22. PRINT "GENOVA"
  23. LOCATE 9, 1
  24. PRINT "MILANO"
  25. LOCATE 11, 1
  26. PRINT "NAPOLI"
  27. LOCATE 13, 1
  28. PRINT "PALERMO"
  29. LOCATE 15, 1
  30. PRINT "ROMA"
  31. LOCATE 17, 1
  32. PRINT "TORINO"
  33. LOCATE 19, 1
  34. PRINT "VENEZIA"
  35. LOCATE 21, 1
  36. PRINT "NAZIONALE"
  37.  
  38. LOCATE 23, 1
  39. PRINT " + to move on"
  40. LOCATE 23, 16
  41. PRINT "- to back"
  42.  
  43.  
  44.  
  45. lineNum = 1
  46. GOSUB get_a
  47.  
  48.  
  49.     a$ = "12345678901234567890"
  50.     Q$ = INKEY$
  51.     IF Q$ = "+" THEN lineNum = lineNum + 1
  52.     IF lineNum > count THEN lineNum = 1
  53.  
  54.     IF Q$ = "-" THEN lineNum = lineNum - 1
  55.     IF lineNum < 1 THEN lineNum = count
  56.  
  57.  
  58.  
  59.     GOSUB get_a
  60.  
  61.  
  62.     LOCATE 1, 34
  63.     PRINT "estraz.num "; LEFT$(a, 4); "   lineNum:"; STR$(lineNum)
  64.  
  65.     REM bari
  66.     LOCATE 1, 13
  67.     IF ABS(VAL(MID$(a, 5, 2)) - VAL(MID$(a, 15, 2))) > 30 THEN COLOR 2 ELSE COLOR 15
  68.     PRINT VAL(MID$(a, 5, 2))
  69.     LOCATE 1, 16
  70.     IF ABS(VAL(MID$(a, 7, 2)) - VAL(MID$(a, 17, 2))) > 30 THEN COLOR 2 ELSE COLOR 15
  71.     PRINT VAL(MID$(a, 7, 2))
  72.     LOCATE 1, 19
  73.     IF ABS(VAL(MID$(a, 8, 2)) - VAL(MID$(a, 19, 2))) > 30 THEN COLOR 2 ELSE COLOR 15
  74.     PRINT VAL(MID$(a, 9, 2))
  75.     LOCATE 1, 22
  76.     IF ABS(VAL(MID$(a, 11, 2)) - VAL(MID$(a, 21, 2))) > 30 THEN COLOR 2 ELSE COLOR 15
  77.     PRINT VAL(MID$(a, 11, 2))
  78.     LOCATE 1, 25
  79.     IF ABS(VAL(MID$(a, 13, 2)) - VAL(MID$(a, 23, 2))) > 30 THEN COLOR 2 ELSE COLOR 15
  80.     PRINT VAL(MID$(a, 13, 2))
  81.  
  82.     REM cagliari
  83.     LOCATE 3, 13
  84.     PRINT VAL(MID$(a, 15, 2))
  85.     LOCATE 3, 16
  86.     PRINT VAL(MID$(a, 17, 2))
  87.     LOCATE 3, 19
  88.     PRINT VAL(MID$(a, 19, 2))
  89.     LOCATE 3, 22
  90.     PRINT VAL(MID$(a, 21, 2))
  91.     LOCATE 3, 25
  92.     PRINT VAL(MID$(a, 23, 2))
  93.  
  94.     REM firenze
  95.     LOCATE 5, 13
  96.     PRINT VAL(MID$(a, 25, 2))
  97.     LOCATE 5, 16
  98.     PRINT VAL(MID$(a, 27, 2))
  99.     LOCATE 5, 19
  100.     PRINT VAL(MID$(a, 29, 2))
  101.     LOCATE 5, 22
  102.     PRINT VAL(MID$(a, 31, 2))
  103.     LOCATE 5, 25
  104.     PRINT VAL(MID$(a, 33, 2))
  105.  
  106.     REM genova
  107.     LOCATE 7, 13
  108.     PRINT VAL(MID$(a, 35, 2))
  109.     LOCATE 7, 16
  110.     PRINT VAL(MID$(a, 37, 2))
  111.     LOCATE 7, 19
  112.     PRINT VAL(MID$(a, 39, 2))
  113.     LOCATE 7, 22
  114.     PRINT VAL(MID$(a, 41, 2))
  115.     LOCATE 7, 25
  116.     PRINT VAL(MID$(a, 43, 2))
  117.  
  118.     REM milano
  119.     LOCATE 9, 13
  120.     PRINT VAL(MID$(a, 45, 2))
  121.     LOCATE 9, 16
  122.     PRINT VAL(MID$(a, 47, 2))
  123.     LOCATE 9, 19
  124.     PRINT VAL(MID$(a, 49, 2))
  125.     LOCATE 9, 22
  126.     PRINT VAL(MID$(a, 51, 2))
  127.     LOCATE 9, 25
  128.     PRINT VAL(MID$(a, 53, 2))
  129.  
  130.     REM napoli
  131.     LOCATE 11, 13
  132.     PRINT VAL(MID$(a, 55, 2))
  133.     LOCATE 11, 16
  134.     PRINT VAL(MID$(a, 57, 2))
  135.     LOCATE 11, 19
  136.     PRINT VAL(MID$(a, 59, 2))
  137.     LOCATE 11, 22
  138.     PRINT VAL(MID$(a, 61, 2))
  139.     LOCATE 11, 25
  140.     PRINT VAL(MID$(a, 63, 2))
  141.  
  142.     REM palermo
  143.     LOCATE 13, 13
  144.     PRINT VAL(MID$(a, 65, 2))
  145.     LOCATE 13, 16
  146.     PRINT VAL(MID$(a, 67, 2))
  147.     LOCATE 13, 19
  148.     PRINT VAL(MID$(a, 69, 2))
  149.     LOCATE 13, 22
  150.     PRINT VAL(MID$(a, 71, 2))
  151.     LOCATE 13, 25
  152.     PRINT VAL(MID$(a, 73, 2))
  153.  
  154.     REM roma
  155.     LOCATE 15, 13
  156.     PRINT VAL(MID$(a, 75, 2))
  157.     LOCATE 15, 16
  158.     PRINT VAL(MID$(a, 77, 2))
  159.     LOCATE 15, 19
  160.     PRINT VAL(MID$(a, 79, 2))
  161.     LOCATE 15, 22
  162.     PRINT VAL(MID$(a, 81, 2))
  163.     LOCATE 15, 25
  164.     PRINT VAL(MID$(a, 83, 2))
  165.  
  166.     REM torino
  167.     LOCATE 17, 13
  168.     PRINT VAL(MID$(a, 85, 2))
  169.     LOCATE 17, 16
  170.     PRINT VAL(MID$(a, 87, 2))
  171.     LOCATE 17, 19
  172.     PRINT VAL(MID$(a, 89, 2))
  173.     LOCATE 17, 22
  174.     PRINT VAL(MID$(a, 91, 2))
  175.     LOCATE 17, 25
  176.     PRINT VAL(MID$(a, 93, 2))
  177.  
  178.     REM venezia
  179.     LOCATE 19, 13
  180.     PRINT VAL(MID$(a, 95, 2))
  181.     LOCATE 19, 16
  182.     PRINT VAL(MID$(a, 97, 2))
  183.     LOCATE 19, 19
  184.     PRINT VAL(MID$(a, 99, 2))
  185.     LOCATE 19, 22
  186.     PRINT VAL(MID$(a, 101, 2))
  187.     LOCATE 19, 25
  188.     PRINT VAL(MID$(a, 103, 2))
  189.  
  190.     REM nazionale
  191.     LOCATE 21, 13
  192.     PRINT VAL(MID$(a, 105, 2))
  193.     LOCATE 21, 16
  194.     PRINT VAL(MID$(a, 107, 2))
  195.     LOCATE 21, 19
  196.     PRINT VAL(MID$(a, 109, 2))
  197.     LOCATE 21, 22
  198.     PRINT VAL(MID$(a, 111, 2))
  199.     LOCATE 21, 25
  200.     PRINT VAL(MID$(a, 113, 2))
  201.  
  202.     _LIMIT 30
  203.  
  204.  
  205. 'this sub retrieves a line number from file  the hard way
  206. get_a:
  207. num = 0
  208. OPEN "lotto.dat" FOR INPUT AS #1
  209.     INPUT #1, a
  210.     IF LEN(_TRIM$(a)) THEN num = num + 1
  211.     IF num = lineNum THEN EXIT WHILE 'a is set on line we want
  212.  
  213.  

Wait do you want to compare ( row, col )  to  ( row + 1, col ) and if they are different by 30 or more make them red?

Rows are 10 places apart, I edited above to compare each row and column with the next row and same column I think. Only first line Bari colored right??

Gotta go feed people :)
« Last Edit: July 01, 2020, 05:59:17 pm by bplus »

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #27 on: July 01, 2020, 06:29:34 pm »
they must be the same vertical column the same position one below the other

and the two numbers with distance 30 I have to color them red

Note every single number comes in 90

so if there is the number 60

in the column below I find the number 90

if instead I find the number 61

in the column below I find the number 1
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: help my
« Reply #28 on: July 01, 2020, 07:56:31 pm »
Is first row Bari colored correctly?

Offline Kiara87

  • Forum Regular
  • Posts: 164
    • View Profile
Re: help my
« Reply #29 on: July 01, 2020, 08:09:26 pm »
no because it must be colored only if the distance 30 is in the same row in the same row
the numbers must all be white, must turn red if under 82 there is 52 or 22 because 82 and 52  distance 30

22 and 52 distance 30

and 22 and 82 distance 30 going beyond  90

only the numbers with distance 30 that are one below the other in the same row must change color


I know and a somewhat complicated program, however, helps to learn new things
Thanks for your patience bplus
se avessi solo un'ora per salvare il mondo, passerei 55 minuti per definire bene il problema e 5 a trovare la soluzione