Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: pya
  • Order by date
  1. pya

    Label Not Defined ERROR

    Thank you mikrom and Geates for your help. I am constantly learning through this forum. pya
  2. pya

    Label Not Defined ERROR

    Gents, I checked again and rectified the error. Although the conversion from Celsius to Fahrenheit and back is a simple calculation, one of my objectives is to keep learning through coding and invoking new functionality e g CASE SELECT, something which I had never heard of...
  3. pya

    Label Not Defined ERROR

    Hi Mikrom, After a long time I am trying to code with Subroutines. I get Error: Label Not Defined on Line 145 but not on 95. Why should this be? And what is the error trying to tell me? And how do I get rid of it? Thanx for your help...
  4. pya

    Branching with Strings Input

    Hi Mikrom, I am writing a simple Temperature conversion QBASIC Program for my grandson. Psuedo code looks like this INPUT T$ IF T$ C F K Depending on whether input is C F or K I will use a GOTO to carry out different calculations I am trying to avoid multiple IF statements and would like to...
  5. pya

    Name already in use ERROR

    Thanx Nice to know you are still in the game. Been a year since I last communicated with you. pa99
  6. pya

    Name already in use ERROR

    Writing a simple program which I will tidy up later but I need to resolve this Error. Please help. pa99https://files.engineering.com/getfile.aspx?folder=131b8266-c764-4ae2-bb74-d7d57165949b&file=QBASIC_Error.JPG
  7. pya

    Data Type Mismatch in QBASIC

    Hi Mikrom, Thanx for your help. The Code works, but ChatGPT is not impressed! Can this code be improved V15.3 100 REM 6N +- 1 Test V15.3 110 DIM P1, P2, N1, N2 AS _Unsigned _Integer64 120 INPUT “Number “; N 130 IF N <= 0 THEN GOTO 999 140 N1 = N 150 N2 = N 200 P1 = (6 *...
  8. pya

    Data Type Mismatch in QBASIC

    Hi Mikrom, Thanx for the tip. Code works for small numbers; I will now test for 10+ digit numbers. One more question: Is there a way of combining the 4 DIM statements into 1 line? eg DIM P1, P2, N1, N2 AS LONG Thanx pya
  9. pya

    Data Type Mismatch in QBASIC

    Hi Mikrom, Further to my post if I use PRINT instead of PRINT USING , the code works fine. But, PRINT USING should allow me to display the output number in detail instead of in scientific exp notation. Try the code with N = 3, 4, 5, 6, 59 and 288 to see how it works. Pervez
  10. pya

    Data Type Mismatch in QBASIC

    Hi Mikrom, Your help appreciated please. I keep getting a TYPE MISMATCH Error on Line 14 ( Line No 240) Can you help please. 100 REM 6N +- 1 Test V15.3 110 DIM P1 AS LONG 115 DIM P2 AS LONG 120 DIM N1 AS LONG 125 DIM N2 AS LONG 130 INPUT “Number “; N 140 IF N <= 0 THEN GOTO...
  11. pya

    Travelling Salesman Problem in QBasic

    Hi mikrom, One last question: How do I insert spaces between the brackets in the output? ( 2, .....7, 2 ) and ( 23, .... 19, 24 ) At my age I can get confused if the output is like (2, ....7, 2) and (23, .....19,24) I modified a few lines but got no change. Regards...
  12. pya

    Travelling Salesman Problem in QBasic

    Hi mikrom, I ran your code for 10 cities and it worked fine. But, I have a couple of questions and would be grateful if you could answer at your convenience. 1. I do not understand the first set of Distance Matrix - DATA 0,34,36 and the following 2 lines. 2. My 2nd question is where is the...
  13. pya

    Travelling Salesman Problem in QBasic

    Hi mikrom, Mea Culpa! I took your advice and your untouched (untouched by human hands?) version worked! I must have screwed up during line numbering. Thanx for all your help. Pervez
  14. pya

    Travelling Salesman Problem in QBasic

    Hi mikrom, Attached is the compilelog which I forgot to attach before. Pervezhttps://files.engineering.com/getfile.aspx?folder=348400e3-87d5-4daf-8ffc-724b6913af15&file=compilelog.txt
  15. pya

    Travelling Salesman Problem in QBasic

    Hi mikrom, When you have time can you please look at the ERROR I get when running your code. Also, I do not understand Lines 2320 - 2360. The Distance Matrix lines 2370 - 2384 I recognise as the distance between cities 1 to 7. But what do lines 2320 - 2360 represent? Regards Pervez PS: No...
  16. pya

    Travelling Salesman Problem in QBasic

    Hi Mikrom, Just thrilled to receive your response. Will try it out later. If it works I will give you another star. If it does not I will take back the first star :) Thanx Pervez
  17. pya

    Travelling Salesman Problem in QBasic

    Hi Mikrom, I think I did not make myself clear. I am trying to find the shortest route from any city (example 4) back to 4, while going through ALL cities exactly once. Travelling Salesman Problem – Qbasic 5 'Travelling Salesman Problem 10 'number of cities 20 N = 10 30 Dim...
  18. pya

    Travelling Salesman Problem in QBasic

    Has anyone written a code in QBasic to solve the Travelling Salesman Problem? I can solve it in Excel Solver but would be interested in the code. Pervezhttps://files.engineering.com/getfile.aspx?folder=855c4bc6-288a-40e1-b531-4633fbe519ff&file=TSP_-_SOLVER_v1.xlsx
  19. pya

    Error in Exponentiation

    Hi mikrom, A kindred spirit. Studied maths at uni but never enjoyed it. Too many exams and too much pressure. Now I enjoy it thoroughly (along with Physics). My main interests are in Prime Numbers and Cantor's Infinite Set theory. I also enjoy Linear Programming and use Excel's Solver to keep...
  20. pya

    Error in Exponentiation

    Thanx Great help.

Part and Inventory Search

Back
Top