Great program that runs my ancient programs flawlessly, with one exception. A couple of my programs create schematic diagrams on-screen using string variables that contain numbers generated in FOR-NEXT loops. Below is a simplified example that prints a "7" on the screen in native GWBasic, but produces an "Illegal function call" error in PCBasic.
10 CLS
20 J=1
30 PSET(30,50)
40 N$(J)="S16;R2;NG2"
50 DRAW"xN$(J);"
Thanks for any help with this.
Don Jackson
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, it looks like you posted this ages ago but I seem to have missed it. This looks like a bug, probably related to parsing array indices. I'll see if I can fix it. Meanwhile you could try the variant
50DRAW"x"+VARPTR(N$(J))
not sure if it'll work, but if it does it could work around the issue for now.
Thanks
Rob
Last edit: Rob Hagemans 2016-11-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can't seem to get the VARPTR$ alternative to work, but that could be due to operator error. I'm not an expert in GWBasic. Please let me know if you come up with a solution.
Thanks,
Don
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Don, thanks for getting back - you're right, it doesn't work either, which is a bug. The latter version does work in the most recent source version, but that is not yet released. I'll include this in the fix.
Meanwhile, the only workaround I can think of is to rewrite so that you don't need the "x" operation - in the above program, you could simply do 50 DRAW N$(J). I appreciate that this is a simplified version and it is probably more difficult in the original version, but perhaps it's possible to split the DRAW statement into multiple statements and do it like this.
Rob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Don, I've fixed the bug so that your original program should work with 15.08.11 when that is released (I expect soon).
The VARPTR$ fix is too dependent on the new version to be backported to 15.08 but it works in the source version, and will thus work with the next major release (hopefully 16.something but it may end up being 17.something at the current pace ...).
Rob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Rob,
I tried your "DRAW N$(J)" approach and I could get some of my very large schematic subroutine to work, but not all of it. Using this method would require an extensive re-write, so I look forward to your 15.08.11 release. Thanks so much for your attention to this problem.
Don
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "[CLOSED] Bug reports" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Great program that runs my ancient programs flawlessly, with one exception. A couple of my programs create schematic diagrams on-screen using string variables that contain numbers generated in FOR-NEXT loops. Below is a simplified example that prints a "7" on the screen in native GWBasic, but produces an "Illegal function call" error in PCBasic.
10 CLS
20 J=1
30 PSET(30,50)
40 N$(J)="S16;R2;NG2"
50 DRAW"xN$(J);"
Thanks for any help with this.
Don Jackson
Sorry, it looks like you posted this ages ago but I seem to have missed it. This looks like a bug, probably related to parsing array indices. I'll see if I can fix it. Meanwhile you could try the variant
Thanks
Rob
Last edit: Rob Hagemans 2016-11-10
that should be
VARPTR$
notVARPTR
, sorry.View and moderate all "[CLOSED] Bug reports" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
I can't seem to get the VARPTR$ alternative to work, but that could be due to operator error. I'm not an expert in GWBasic. Please let me know if you come up with a solution.
Thanks,
Don
Hi Don, thanks for getting back - you're right, it doesn't work either, which is a bug. The latter version does work in the most recent source version, but that is not yet released. I'll include this in the fix.
Meanwhile, the only workaround I can think of is to rewrite so that you don't need the
"x"
operation - in the above program, you could simply do50 DRAW N$(J)
. I appreciate that this is a simplified version and it is probably more difficult in the original version, but perhaps it's possible to split theDRAW
statement into multiple statements and do it like this.Rob
Hi Don, I've fixed the bug so that your original program should work with 15.08.11 when that is released (I expect soon).
The
VARPTR$
fix is too dependent on the new version to be backported to 15.08 but it works in the source version, and will thus work with the next major release (hopefully 16.something but it may end up being 17.something at the current pace ...).Rob
View and moderate all "[CLOSED] Bug reports" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hi Rob,
I tried your "DRAW N$(J)" approach and I could get some of my very large schematic subroutine to work, but not all of it. Using this method would require an extensive re-write, so I look forward to your 15.08.11 release. Thanks so much for your attention to this problem.
Don
The new version is available for download now so give it a go! Let me know if you run into further issues.
View and moderate all "[CLOSED] Bug reports" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Rob, I downloaded 15.08.11 and it runs my schematic program like a charm. Thanks for creating this lifesaver of a program!
Don