|
Post by musaaa on Jun 8, 2024 20:01:56 GMT
Hey everyone! I'm working on a program that simulates pressure waves in an internal combustion engine. It's a bit of a blast from the past - the PDF documentation is from 1990, LOL. But I've hit a snag with a syntax error in QBASIC, and I'm stumped on how to fix it. If anyone has a spare moment, I'd really appreciate some assistance in getting the app up and running smoothly. Check the link below for more info and the program files. Thanks a bunch! 🫠" heres the link github.com/musss1s/programingQBASIC.git
|
|
|
Post by bplus on Jun 9, 2024 0:27:50 GMT
works fine for me, but haven't a clue what it's looking for from inputs
are you using qb64 v 2.1? are even using qb64?
|
|
|
Post by musaaa on Jun 9, 2024 1:55:00 GMT
yes, QBasic qb64 version 2.1 and yes, are parameters of the Engine such as piston diameter, stroke, exhaust temperature, cylinder, type of fuel, etc., you can enter them manually by pressing "N" or automatically by pressing "F", so you save time. that's why there is the file called (EXMDATA.BOX), it contains all the input information, in order to run the program Here I leave you a Video Test, of what happens when I run the program, www.youtube.com/watch?v=HQaFz83Gqrk&ab_channel=HelloYTshortsas you can see it starts to generate errors between lines 1122, 1123, 1124, 1125, I think it's because the arrays?, it's strange because the code is from the PDF, so it shouldn't be an issue but IDK :/
|
|
|
Post by bplus on Jun 9, 2024 13:38:53 GMT
thats funny the git file doesn't even go that high in line numbers? you are getting it to draw stuff which is farther than i got, with random inputs.
subscript out of range, yeah either not big enough array or the other way ie should be zero based not 1 are typical causes.
|
|
|
Post by musaaa on Jun 9, 2024 21:35:15 GMT
thats funny the git file doesn't even go that high in line numbers? you are getting it to draw stuff which is farther than i got, with random inputs. subscript out of range, yeah either not big enough array or the other way ie should be zero based not 1 are typical causes. how can i solve that?, cant figured out, im not qbasic programmer, i just know little c++ c#
|
|
|
Post by bplus on Jun 9, 2024 23:47:43 GMT
try increasing the size of the arrays being called out in the lines of error, that is worth a shot everything else I think of is way too complicated.
if line says dim arr(1 to 100) try dim arr(0 to 1000) that should cover being big enough
|
|
|
Post by musaaa on Jun 10, 2024 0:41:08 GMT
try increasing the size of the arrays being called out in the lines of error, that is worth a shot everything else I think of is way too complicated. if line says dim arr(1 to 100) try dim arr(0 to 1000) that should cover being big enough you mean increasing the numbers on the red arrow?, I think that has to do with the information from uflo.data, which I highlighted in yellow. It stores numbers in a 21x41 array format, with 21 columns and each column containing 41 numbers, separated by commas. I = 21 J =41 Hmm, the error comes from these lines here. the final output should looks like this
|
|
|
Post by bplus on Jun 10, 2024 18:05:02 GMT
ah good, looks like you found help at the other forum
|
|
|
Post by musaaa on Jun 10, 2024 21:27:28 GMT
ah good, looks like you found help at the other forum yeah, i still cant figured out, btw thanks for the patience !
|
|
|
Post by aurelvz on Jun 13, 2024 6:12:51 GMT
you doing some nasty array calculations and why you use shared ( global ) arrays inside subroutine? that is not good way ... if you use global arrays ..define it in program begining and use size
|
|